From: Jonathan McDowell <noodles@earth.li>
To: linux-wireless@kernel.org
Cc: Ivo van Doorn <IvDoorn@gmail.com>,
"John W. Linville" <linville@tuxdriver.com>,
Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Subject: [PATCH] Fix logic error in rfkill_check_duplicity
Date: Thu, 30 Oct 2008 22:46:48 +0000 [thread overview]
Message-ID: <20081030224648.GL3162@earth.li> (raw)
In-Reply-To: <20081030102746.GI3162@earth.li>
(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 |
\- |
prev parent reply other threads:[~2008-10-31 20:11 UTC|newest]
Thread overview: 6+ 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
2008-10-30 22:46 ` Jonathan McDowell [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=20081030224648.GL3162@earth.li \
--to=noodles@earth.li \
--cc=IvDoorn@gmail.com \
--cc=hmh@hmh.eng.br \
--cc=linux-wireless@kernel.org \
--cc=linville@tuxdriver.com \
/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.