linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Roskin <proski@gnu.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: Michael Buesch <mb@bu3sch.de>,
	linux-wireless <linux-wireless@vger.kernel.org>,
	James Ketrenos <jketreno@linux.intel.com>
Subject: Re: cfg80211 wext compat w/o wext code changes, rtnl locking
Date: Mon, 02 Apr 2007 14:00:59 -0400	[thread overview]
Message-ID: <1175536859.25048.6.camel@dv> (raw)
In-Reply-To: <1175251051.19085.2.camel@johannes.berg>

On Fri, 2007-03-30 at 12:37 +0200, Johannes Berg wrote:
> On Fri, 2007-03-30 at 12:11 +0200, Michael Buesch wrote:
> > On Thursday 29 March 2007 01:00, Johannes Berg wrote:
> > > -			if(handler != NULL) {
> > > +			if (handler) {
> > > +				if (!dev->wireless_handlers->no_locking)
> > > +					rtnl_lock();
> > 
> > Is sparse OK with this conditional locking?
> 
> I also thought it wasn't but it didn't complain. The only reason why I
> didn't just duplicate the code was the deep indentation here...

Just for your information, rtnl_lock() is actually a mutex.  Neither
rtnl_lock() nor any mutex operation are annotated to give sparse any
idea of what they are doing.

If sparse learns about mutexes, expect it to give a warning.  Please
consider if the code between rtnl_lock() and rtnl_unlock() could be
moved to a separate function so that locking and unlocking would happen
in the same basic block.

-- 
Regards,
Pavel Roskin


  reply	other threads:[~2007-04-02 18:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-28 23:00 cfg80211 wext compat w/o wext code changes, rtnl locking Johannes Berg
2007-03-30 10:11 ` Michael Buesch
2007-03-30 10:37   ` Johannes Berg
2007-04-02 18:00     ` Pavel Roskin [this message]
2007-04-02 18:15       ` Johannes Berg
2007-04-02 18:23         ` Pavel Roskin

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=1175536859.25048.6.camel@dv \
    --to=proski@gnu.org \
    --cc=jketreno@linux.intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mb@bu3sch.de \
    /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).