public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Michael Krufky <mkrufky@linuxtv.org>
To: Harvey Harrison <harvey.harrison@gmail.com>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>,
	v4l-maintainer <v4l-dvb-maintainer@linuxtv.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [v4l-dvb-maintainer] [PATCH] dvb: usb vendor_ids/product_ids are	__le16
Date: Fri, 14 Nov 2008 14:05:01 -0500	[thread overview]
Message-ID: <491DCBDD.4000703@linuxtv.org> (raw)
In-Reply-To: <1226686796.5483.33.camel@brick>

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

  reply	other threads:[~2008-11-14 19:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-14 18:19 [PATCH] dvb: usb vendor_ids/product_ids are __le16 Harvey Harrison
2008-11-14 19:05 ` Michael Krufky [this message]
2008-11-14 19:07   ` [v4l-dvb-maintainer] " Harvey Harrison
2008-11-14 19:15     ` Michael Krufky
2008-11-14 19:20       ` Harvey Harrison
2008-11-14 19:25         ` Devin Heitmueller
2008-11-14 19:44           ` Harvey Harrison
2008-11-14 20:55             ` Andy Walls
2008-11-14 21:08               ` Harvey Harrison
2008-11-15 10:42                 ` Hans Verkuil
2008-11-15  7:21             ` Jean-Francois Moine

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=491DCBDD.4000703@linuxtv.org \
    --to=mkrufky@linuxtv.org \
    --cc=akpm@linux-foundation.org \
    --cc=harvey.harrison@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@infradead.org \
    --cc=v4l-dvb-maintainer@linuxtv.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox