All of lore.kernel.org
 help / color / mirror / Atom feed
From: "John W. Linville" <linville@tuxdriver.com>
To: Pavel Roskin <proski@gnu.org>
Cc: linux-wireless@vger.kernel.org, Daniel Drake <dsd@gentoo.org>,
	Ulrich Kunitz <kune@deine-taler.de>
Subject: Re: [PATCH] zd1211rw: make CR_INTERRUPT cast explicit
Date: Thu, 22 Jul 2010 15:03:39 -0400	[thread overview]
Message-ID: <20100722190339.GD2616@tuxdriver.com> (raw)
In-Reply-To: <1279730218.9003.7.camel@mj>

On Wed, Jul 21, 2010 at 12:36:58PM -0400, Pavel Roskin wrote:
> On Wed, 2010-07-21 at 11:08 -0400, John W. Linville wrote:
> > CHECK   drivers/net/wireless/zd1211rw/zd_usb.c
> > drivers/net/wireless/zd1211rw/zd_usb.c:376:24: warning: implicit cast from nocast type
> > 
> > The value comparison is intentional, so forcing the cast seems warranted
> > in order to silence the sparse warning.
> > 
> > Signed-off-by: John W. Linville <linville@tuxdriver.com>
> > ---
> >  drivers/net/wireless/zd1211rw/zd_usb.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c
> > index 818e148..acbf4d9 100644
> > --- a/drivers/net/wireless/zd1211rw/zd_usb.c
> > +++ b/drivers/net/wireless/zd1211rw/zd_usb.c
> > @@ -373,7 +373,7 @@ static inline void handle_regs_int(struct urb *urb)
> >  	spin_lock(&intr->lock);
> >  
> >  	int_num = le16_to_cpu(*(__le16 *)(urb->transfer_buffer+2));
> > -	if (int_num == CR_INTERRUPT) {
> > +	if (int_num == (u16 __force) CR_INTERRUPT) {
> 
> I think __force should be used sparingly, especially outside headers.  I
> tried other ways to prevent the warning.  I tried declaring int_num as
> zd_addr_t, but sparse keeps complaining about the same comparison.

Actually, it looks like it works w/o the "__force" as well.
Any objection to a version like that?

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

  reply	other threads:[~2010-07-22 19:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-21 15:08 [PATCH] zd1211rw: make CR_INTERRUPT cast explicit John W. Linville
2010-07-21 16:36 ` Pavel Roskin
2010-07-22 19:03   ` John W. Linville [this message]
2010-07-23 22:55     ` Pavel Roskin

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=20100722190339.GD2616@tuxdriver.com \
    --to=linville@tuxdriver.com \
    --cc=dsd@gentoo.org \
    --cc=kune@deine-taler.de \
    --cc=linux-wireless@vger.kernel.org \
    --cc=proski@gnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.