LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
To: Jonathan McDowell <noodles@earth.li>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH] Fix logic error in rfkill_check_duplicity
Date: Thu, 30 Oct 2008 18:49:05 -0200	[thread overview]
Message-ID: <20081030204905.GB29976@khazad-dum.debian.net> (raw)
In-Reply-To: <20081030144409.GJ3162@earth.li>

On Thu, 30 Oct 2008, Jonathan McDowell wrote:
> On Thu, Oct 30, 2008 at 10:27:46AM +0000, Jonathan McDowell wrote:
> > I'll have a prod at why the [hso] rfkill stuff isn't working next
> 
> Ok, I believe this is due to the addition of rfkill_check_duplicity in
> rfkill and the fact that test_bit actually returns a negative value
> rather than the postive one expected (which is of course equally true).
> So when the second WLAN device (the hso device, with the EEE PC WLAN
> being the first) comes along rfkill_check_duplicity returns a negative
> value and so rfkill_register returns an error. Patch below fixes this
> for me.

Good catch, I screwed up on that one.  Please forward it with my ack to
linux-wireless@kernel.org and to Ivo van Doorn <IvDoorn@gmail.com> and John
W. Linville <linville@tuxdriver.com>.

Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>

> -----
> diff --git a/net/rfkill/rfkill.c b/net/rfkill/rfkill.c
> index f949a48..1ba35a7 100644
> --- a/net/rfkill/rfkill.c
> +++ b/net/rfkill/rfkill.c
> @@ -603,7 +603,7 @@ static int rfkill_check_duplicity(const struct rfkill *rfkil
>         }
>  
>         /* 0: first switch of its kind */
> -       return test_bit(rfkill->type, seen);
> +       return (test_bit(rfkill->type, seen)) ? 1 : 0;
>  }
>  
>  static int rfkill_add_switch(struct rfkill *rfkill)
> -----
> 
> J.
> 

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

      reply	other threads:[~2008-10-30 20:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-29 16:40 2.6.28-rc2 / hso driver oops Jonathan McDowell
2008-10-29 19:40 ` Ben Hutchings
2008-10-30 10:27   ` [PATCH] Cleanup hso rfkill error handling [was: 2.6.28-rc2 / hso driver oops] Jonathan McDowell
2008-10-30 14:44     ` [PATCH] Fix logic error in rfkill_check_duplicity Jonathan McDowell
2008-10-30 20:49       ` Henrique de Moraes Holschuh [this message]

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=20081030204905.GB29976@khazad-dum.debian.net \
    --to=hmh@hmh.eng.br \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=noodles@earth.li \
    --subject='Re: [PATCH] Fix logic error in rfkill_check_duplicity' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).