diff mbox

[2/3,media] tw68: Remove a sparse warning

Message ID fafeea3682cc2da98f05138ec4b1c8ebc6798b5d.1409841955.git.m.chehab@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Mauro Carvalho Chehab Sept. 4, 2014, 2:46 p.m. UTC
drivers/media/pci/tw68/tw68-video.c:351:9: warning: incorrect type in argument 1 (different base types)
drivers/media/pci/tw68/tw68-video.c:351:9:    expected unsigned int [unsigned] val
drivers/media/pci/tw68/tw68-video.c:351:9:    got restricted __le32 [usertype] <noident>

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>

Comments

Hans Verkuil (hansverk) Sept. 4, 2014, 2:54 p.m. UTC | #1
I'll need to review this as well. Perhaps tw_writel should expect a __le32?

	Hans

On 09/04/14 16:46, Mauro Carvalho Chehab wrote:
> drivers/media/pci/tw68/tw68-video.c:351:9: warning: incorrect type in argument 1 (different base types)
> drivers/media/pci/tw68/tw68-video.c:351:9:    expected unsigned int [unsigned] val
> drivers/media/pci/tw68/tw68-video.c:351:9:    got restricted __le32 [usertype] <noident>
> 
> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
> 
> diff --git a/drivers/media/pci/tw68/tw68-video.c b/drivers/media/pci/tw68/tw68-video.c
> index 66fae2345fdd..4dd38578cf1b 100644
> --- a/drivers/media/pci/tw68/tw68-video.c
> +++ b/drivers/media/pci/tw68/tw68-video.c
> @@ -348,7 +348,7 @@ int tw68_video_start_dma(struct tw68_dev *dev, struct tw68_buf *buf)
>  	 *  a new address can be set.
>  	 */
>  	tw_clearl(TW68_DMAC, TW68_DMAP_EN);
> -	tw_writel(TW68_DMAP_SA, cpu_to_le32(buf->dma));
> +	tw_writel(TW68_DMAP_SA, (__force u32)cpu_to_le32(buf->dma));
>  	/* Clear any pending interrupts */
>  	tw_writel(TW68_INTSTAT, dev->board_virqmask);
>  	/* Enable the risc engine and the fifo */
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Mauro Carvalho Chehab Sept. 4, 2014, 3:05 p.m. UTC | #2
Em Thu, 04 Sep 2014 16:54:38 +0200
Hans Verkuil <hansverk@cisco.com> escreveu:

> I'll need to review this as well. Perhaps tw_writel should expect a __le32?

There are several other parts where it is using the address as CPU endian.

Anyway, if you have some BE system, then you can test the board there and
see what would work.

Regards,
Mauro

> 
> 	Hans
> 
> On 09/04/14 16:46, Mauro Carvalho Chehab wrote:
> > drivers/media/pci/tw68/tw68-video.c:351:9: warning: incorrect type in argument 1 (different base types)
> > drivers/media/pci/tw68/tw68-video.c:351:9:    expected unsigned int [unsigned] val
> > drivers/media/pci/tw68/tw68-video.c:351:9:    got restricted __le32 [usertype] <noident>
> > 
> > Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
> > 
> > diff --git a/drivers/media/pci/tw68/tw68-video.c b/drivers/media/pci/tw68/tw68-video.c
> > index 66fae2345fdd..4dd38578cf1b 100644
> > --- a/drivers/media/pci/tw68/tw68-video.c
> > +++ b/drivers/media/pci/tw68/tw68-video.c
> > @@ -348,7 +348,7 @@ int tw68_video_start_dma(struct tw68_dev *dev, struct tw68_buf *buf)
> >  	 *  a new address can be set.
> >  	 */
> >  	tw_clearl(TW68_DMAC, TW68_DMAP_EN);
> > -	tw_writel(TW68_DMAP_SA, cpu_to_le32(buf->dma));
> > +	tw_writel(TW68_DMAP_SA, (__force u32)cpu_to_le32(buf->dma));
> >  	/* Clear any pending interrupts */
> >  	tw_writel(TW68_INTSTAT, dev->board_virqmask);
> >  	/* Enable the risc engine and the fifo */
> > 
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Hans Verkuil Sept. 4, 2014, 4:20 p.m. UTC | #3
On 09/04/2014 04:46 PM, Mauro Carvalho Chehab wrote:
> drivers/media/pci/tw68/tw68-video.c:351:9: warning: incorrect type in argument 1 (different base types)
> drivers/media/pci/tw68/tw68-video.c:351:9:    expected unsigned int [unsigned] val
> drivers/media/pci/tw68/tw68-video.c:351:9:    got restricted __le32 [usertype] <noident>
> 
> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>

Nacked-by: Hans Verkuil <hverkuil@xs4all.nl>

tw_writel maps to writel which already does cpu_to_le32(), so doing it again is once
too many. I'll post a patch that removes the bogus cpu_to_le32().

	Hans

> 
> diff --git a/drivers/media/pci/tw68/tw68-video.c b/drivers/media/pci/tw68/tw68-video.c
> index 66fae2345fdd..4dd38578cf1b 100644
> --- a/drivers/media/pci/tw68/tw68-video.c
> +++ b/drivers/media/pci/tw68/tw68-video.c
> @@ -348,7 +348,7 @@ int tw68_video_start_dma(struct tw68_dev *dev, struct tw68_buf *buf)
>  	 *  a new address can be set.
>  	 */
>  	tw_clearl(TW68_DMAC, TW68_DMAP_EN);
> -	tw_writel(TW68_DMAP_SA, cpu_to_le32(buf->dma));
> +	tw_writel(TW68_DMAP_SA, (__force u32)cpu_to_le32(buf->dma));
>  	/* Clear any pending interrupts */
>  	tw_writel(TW68_INTSTAT, dev->board_virqmask);
>  	/* Enable the risc engine and the fifo */
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/media/pci/tw68/tw68-video.c b/drivers/media/pci/tw68/tw68-video.c
index 66fae2345fdd..4dd38578cf1b 100644
--- a/drivers/media/pci/tw68/tw68-video.c
+++ b/drivers/media/pci/tw68/tw68-video.c
@@ -348,7 +348,7 @@  int tw68_video_start_dma(struct tw68_dev *dev, struct tw68_buf *buf)
 	 *  a new address can be set.
 	 */
 	tw_clearl(TW68_DMAC, TW68_DMAP_EN);
-	tw_writel(TW68_DMAP_SA, cpu_to_le32(buf->dma));
+	tw_writel(TW68_DMAP_SA, (__force u32)cpu_to_le32(buf->dma));
 	/* Clear any pending interrupts */
 	tw_writel(TW68_INTSTAT, dev->board_virqmask);
 	/* Enable the risc engine and the fifo */