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

From: Dan Carpenter
Date: Thu May 08 2014 - 07:35:32 EST


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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/