linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Greear <greearb@candelatech.com>
To: Arend van Spriel <arend@broadcom.com>
Cc: Johannes Berg <johannes@sipsolutions.net>,
	linux-wireless <linux-wireless@vger.kernel.org>
Subject: Re: [RFC V4] cfg80211: introduce critical protocol indication from user-space
Date: Fri, 05 Apr 2013 12:29:43 -0700	[thread overview]
Message-ID: <515F2627.4050908@candelatech.com> (raw)
In-Reply-To: <515F23A4.3040906@broadcom.com>

On 04/05/2013 12:19 PM, Arend van Spriel wrote:

>>> +    trace_rdev_crit_proto_stop(&rdev->wiphy, wdev);
>>> +    if (rdev->crit_proto_started) {
>>> +        ret = rdev->ops->crit_proto_stop(&rdev->wiphy, wdev);
>>> +        rdev->crit_proto_started = ret != 0;
>>
>> Maybe:  rdev->crit_proto_started = !ret;
>
> Maybe not. If ret == 0, crit_proto_started should be false. If ret != 0, ie. crit_proto_stop() failed, it should remain true. It is a bit of reverse logic. I
> could change it to !!ret or make it more clear using !ret ? false : true. Another idea is changing the return type of crit_proto_stop() to void and always set
> crit_proto_started to false.

Well, I had a hard time figuring out what that code was supposed to do (obviously).

Maybe just:
	if (ret == 0)
		rdev->crit_proto_started = false;

Or just require that the driver not fail this operation ever and always set crit_proto_started to false.

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


  reply	other threads:[~2013-04-05 19:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-05 13:25 [RFC V4] cfg80211: introduce critical protocol indication from user-space Arend van Spriel
2013-04-05 14:03 ` Ben Greear
2013-04-05 19:19   ` Arend van Spriel
2013-04-05 19:29     ` Ben Greear [this message]
2013-04-05 20:50       ` Arend van Spriel

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=515F2627.4050908@candelatech.com \
    --to=greearb@candelatech.com \
    --cc=arend@broadcom.com \
    --cc=johannes@sipsolutions.net \
    --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).