All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Michael Buesch <mb@bu3sch.de>
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:54:39 +0100	[thread overview]
Message-ID: <1237640079.5100.185.camel@johannes.local> (raw)
In-Reply-To: <200903211349.02761.mb@bu3sch.de>

[-- Attachment #1: Type: text/plain, Size: 837 bytes --]

On Sat, 2009-03-21 at 13:49 +0100, Michael Buesch wrote:

> > > 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.

No, I still think it's sloppy code; some future work will in most cases
invariably move the conditions further apart, at which point it becomes
more and more unlikely that the invariant that the "x" doesn't change
inbetween is maintained.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2009-03-21 12:54 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
2009-03-21 12:54             ` Johannes Berg [this message]
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=1237640079.5100.185.camel@johannes.local \
    --to=johannes@sipsolutions.net \
    --cc=chunkeey@web.de \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lrodriguez@atheros.com \
    --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 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.