linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Buesch <mb@bu3sch.de>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: Christian Lamparter <chunkeey@web.de>,
	linux-wireless@vger.kernel.org,
	"Luis R. Rodriguez" <lrodriguez@atheros.com>
Subject: Re: [RFC][PATCH 4/5] ar9170: USB frontend driver
Date: Sat, 21 Mar 2009 13:49:02 +0100	[thread overview]
Message-ID: <200903211349.02761.mb@bu3sch.de> (raw)
In-Reply-To: <1237635266.5100.174.camel@johannes.local>

On Saturday 21 March 2009 12:34:26 Johannes Berg wrote:
> On Sat, 2009-03-21 at 12:20 +0100, Michael Buesch wrote:
> 
> > > > > +#if 0
> > > > > +#include <linux/mutex.h>
> > > > > +#define mutex_lock(m) do { mutex_lock(m); __acquire(m); } while (0)
> > > > > +#define mutex_unlock(m) do { mutex_unlock(m); __release(m); } while (0)
> > > > > +#endif
> > > > > +
> > > > > +#endif /* __USB_H */
> > > > 
> > > > Whoops, debugging code? :)
> > > 
> > > sparse, for some reason mutex operations aren't annotated... Probably
> > > because Ingo wrote the code...
> > 
> > Well I think it would currently generate lots of errors, because we have
> > code like this in the kernel:
> > 
> > if (x)
> > 	mutex_lock();
> > ...
> > if (x)
> > 	mutex_unlock();
> 
> That's sloppy code anyway. Not to be encouraged.

That's not true. Sometimes it is the cleanest way to do things.
Look at drivers/ssb/main.c. To make this mutex-sparse compliant, we'd
need to introduce quite a few sub-functions.

It simply is a limitation of sparse. Nothing else.

-- 
Greetings, Michael.

  reply	other threads:[~2009-03-21 12:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-17  3:10 [RFC][PATCH 4/5] ar9170: USB frontend driver Christian Lamparter
2009-03-20 19:36 ` Christian Lamparter
2009-03-20 19:58   ` Michael Buesch
2009-03-20 20:22     ` Christian Lamparter
2009-03-21 11:10     ` Johannes Berg
2009-03-21 11:20       ` Michael Buesch
2009-03-21 11:34         ` Johannes Berg
2009-03-21 12:49           ` Michael Buesch [this message]
2009-03-21 12:54             ` Johannes Berg
2009-03-21 13:12               ` Michael Buesch
2009-03-21 14:58   ` [PATCH 4/5 v6] " Christian Lamparter

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=200903211349.02761.mb@bu3sch.de \
    --to=mb@bu3sch.de \
    --cc=chunkeey@web.de \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lrodriguez@atheros.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 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).