linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "John W. Linville" <linville@tuxdriver.com>
To: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: linux-wireless@vger.kernel.org, Ivo van Doorn <ivdoorn@gmail.com>
Subject: Re: [PATCH 2/2] rfkill: use strict_strtoul
Date: Sun, 17 Aug 2008 14:16:17 -0400	[thread overview]
Message-ID: <20080817181617.GA30679@tuxdriver.com> (raw)
In-Reply-To: <1217699786-20672-3-git-send-email-hmh@hmh.eng.br>

On Sat, Aug 02, 2008 at 02:56:26PM -0300, Henrique de Moraes Holschuh wrote:
> Switch sysfs parsing to something that actually works properly.

> @@ -402,7 +410,7 @@ static ssize_t rfkill_claim_store(struct device *dev,
>  	if (error)
>  		return error;
>  
> -	if (rfkill->user_claim != claim) {
> +	if (!!rfkill->user_claim != !!claim) {
>  		if (!claim) {
>  			mutex_lock(&rfkill->mutex);
>  			rfkill_toggle_radio(rfkill,

This looks a bit funny.  Is the '!!' in front of 'rfkill->user_claim'
really necessary?  Especially since...

> @@ -410,7 +418,7 @@ static ssize_t rfkill_claim_store(struct device *dev,
>  					    0);
>  			mutex_unlock(&rfkill->mutex);
>  		}
> -		rfkill->user_claim = claim;
> +		rfkill->user_claim = !!claim;
>  	}
>  
>  	mutex_unlock(&rfkill_mutex);

You seem to be doing the only assignment to 'rfkill->user_claim',
using a '!!' to condition the input?

John
-- 
John W. Linville
linville@tuxdriver.com

  parent reply	other threads:[~2008-08-17 18:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-02 17:56 [GIT PATCH] rfkill fixes, set 3 Henrique de Moraes Holschuh
2008-08-02 17:56 ` [PATCH 1/2] rfkill: protect suspended rfkill controllers Henrique de Moraes Holschuh
2008-08-02 18:25   ` Ivo van Doorn
2008-08-02 17:56 ` [PATCH 2/2] rfkill: use strict_strtoul Henrique de Moraes Holschuh
2008-08-02 18:25   ` Ivo van Doorn
2008-08-17 18:16   ` John W. Linville [this message]
2008-08-17 19:31     ` Michael Buesch
2008-08-19 21:53     ` Henrique de Moraes Holschuh

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=20080817181617.GA30679@tuxdriver.com \
    --to=linville@tuxdriver.com \
    --cc=hmh@hmh.eng.br \
    --cc=ivdoorn@gmail.com \
    --cc=linux-wireless@vger.kernel.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 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).