Re: [PATCH v2] staging: lirc: Fix sparse warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 08, 2014 at 02:13:17PM +0300, Tuomas Tynkkynen wrote:
> Fix sparse warnings by adding __user and __iomem annotations where
> necessary and removing certain unnecessary casts. While at it,
> also use u32 in place of __u32.
> 
> Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@xxxxxx>

Thanks.

Reviewed-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

Btw, don't resend this (someone will have to fix it in a later patch)
but I notice that these IOCTLs are not implemented consistently.  Even
outside of staging we have this problem.  For example lirc_rx51_ioctl().

In this function the user gets a u32.

>  	case LIRC_GET_FEATURES:
> -		result = put_user(features, (__u32 *) arg);
> +		result = put_user(features, uptr);
>  		if (result)
>  			return result;
>  		break;

But here they get a long.

>  	case LIRC_GET_FEATURES:
> -		result = put_user(features, (unsigned long *) arg);
> +		result = put_user(features, uptr);
>  		break;

My feeling it should always be u32 so we don't have to write a
compatability layer for 32 bit applications on a 64 bit kernel.

regards,
dan carpenter

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux