Re: [v4l-dvb-maintainer] [PATCH] dvb: usb vendor_ids/product_idsare __le16

From: Michael Krufky
Date: Fri Nov 14 2008 - 14:20:55 EST


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@xxxxxxxxx>
---
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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/