Messages in this thread | | | Date | Fri, 14 Nov 2008 14:05:01 -0500 | From | Michael Krufky <> | 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@gmail.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
| |