[PATCH v2] staging: lirc: Fix sparse warnings
Dan Carpenter
dan.carpenter at oracle.com
Thu May 8 11:35:06 UTC 2014
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 at iki.fi>
Thanks.
Reviewed-by: Dan Carpenter <dan.carpenter at oracle.com>
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
More information about the devel
mailing list