From: Marcel Holtmann <marcel@holtmann.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: John Linville <linville@tuxdriver.com>,
linux-wireless <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH] rfkill: print events when input handler is disabled/enabled
Date: Sun, 07 Jun 2009 17:25:31 +0200 [thread overview]
Message-ID: <1244388331.23850.85.camel@localhost.localdomain> (raw)
In-Reply-To: <1244370412.2907.2.camel@johannes.local>
Hi Johannes,
> It is useful for debugging when we know if something disabled
> the in-kernel rfkill input handler.
>
> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
> ---
> net/rfkill/core.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> --- wireless-testing.orig/net/rfkill/core.c 2009-06-07 11:46:05.000000000 +0200
> +++ wireless-testing/net/rfkill/core.c 2009-06-07 11:53:40.000000000 +0200
> @@ -1134,7 +1134,8 @@ static int rfkill_fop_release(struct ino
>
> #ifdef CONFIG_RFKILL_INPUT
> if (data->input_handler)
> - atomic_dec(&rfkill_input_disabled);
> + if (atomic_dec_return(&rfkill_input_disabled) == 0)
> + printk(KERN_DEBUG "rfkill: input handler enabled\n");
> #endif
>
> kfree(data);
> @@ -1157,7 +1158,8 @@ static long rfkill_fop_ioctl(struct file
> mutex_lock(&data->mtx);
>
> if (!data->input_handler) {
> - atomic_inc(&rfkill_input_disabled);
> + if (atomic_inc_return(&rfkill_input_disabled) == 1)
> + printk(KERN_DEBUG "rfkill: input handler disabled\n");
> data->input_handler = true;
> }
do you really think the == 1 is the correct thing here. I think that
should be a > 0.
Regards
Marcel
next prev parent reply other threads:[~2009-06-07 15:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-07 10:26 [PATCH] rfkill: print events when input handler is disabled/enabled Johannes Berg
2009-06-07 15:25 ` Marcel Holtmann [this message]
2009-06-07 17:18 ` Johannes Berg
2009-06-08 0:18 ` Marcel Holtmann
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=1244388331.23850.85.camel@localhost.localdomain \
--to=marcel@holtmann.org \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.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.