linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix logic error in rfkill_check_duplicity
       [not found]   ` <20081030102746.GI3162@earth.li>
@ 2008-10-30 22:46     ` Jonathan McDowell
  0 siblings, 0 replies; only message in thread
From: Jonathan McDowell @ 2008-10-30 22:46 UTC (permalink / raw)
  To: linux-wireless
  Cc: Ivo van Doorn, John W. Linville, Henrique de Moraes Holschuh

(already sent to lkml & netdev, resending here with Henrique's Ack as
per his followup there)

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.

Signed-Off-By: Jonathan McDowell <noodles@earth.li>
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.

-- 
/-\                             |  Shall I call the United Nations?
|@/  Debian GNU/Linux Developer |
\-                              |

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2008-10-31 20:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20081029164006.GH3162@earth.li>
     [not found] ` <1225309212.3068.44.camel@achroite>
     [not found]   ` <20081030102746.GI3162@earth.li>
2008-10-30 22:46     ` [PATCH] Fix logic error in rfkill_check_duplicity Jonathan McDowell

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).