[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <491DCBDD.4000703@linuxtv.org>
Date: Fri, 14 Nov 2008 14:05:01 -0500
From: Michael Krufky <mkrufky@...uxtv.org>
To: Harvey Harrison <harvey.harrison@...il.com>
CC: Mauro Carvalho Chehab <mchehab@...radead.org>,
v4l-maintainer <v4l-dvb-maintainer@...uxtv.org>,
Andrew Morton <akpm@...ux-foundation.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [v4l-dvb-maintainer] [PATCH] dvb: usb vendor_ids/product_ids
are __le16
Harvey, et al:
Harvey Harrison wrote:
> Noticed by sparse:
> drivers/media/dvb/dvb-usb/af9015.c:756:25: warning: restricted __le16 degrades to integer
> drivers/media/dvb/dvb-usb/af9015.c:744:28: warning: restricted __le16 degrades to integer
>
> Signed-off-by: Harvey Harrison <harvey.harrison@...il.com>
> ---
> drivers/media/dvb/dvb-usb/af9015.c | 12 ++++++------
> 1 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/media/dvb/dvb-usb/af9015.c b/drivers/media/dvb/dvb-usb/af9015.c
> index 4b2af32..eb4495a 100644
> --- a/drivers/media/dvb/dvb-usb/af9015.c
> +++ b/drivers/media/dvb/dvb-usb/af9015.c
> @@ -742,7 +742,7 @@ static int af9015_read_config(struct usb_device *udev)
> }
> } else {
> switch (udev->descriptor.idVendor) {
> - case USB_VID_LEADTEK:
> + case cpu_to_le16(USB_VID_LEADTEK):
> af9015_properties[i].rc_key_map =
> af9015_rc_keys_leadtek;
> af9015_properties[i].rc_key_map_size =
>
Wouldn't it be nicer to just switch on
cpu_to_le16(udev->descriptor.idVendor) ? This would be a 1-line change,
compile to a smaller footprint, and be easier to read.
Personally, I prefer to try to avoid duplicating code in places where a
single operation may occur centrally.
Regards,
Mike
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists