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 14:12:52 +0100 [thread overview]
Message-ID: <200903211412.52749.mb@bu3sch.de> (raw)
In-Reply-To: <1237640079.5100.185.camel@johannes.local>
On Saturday 21 March 2009 13:54:39 Johannes Berg wrote:
> 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;
Patches that change the code into code with _better_ style are accepted.
However, I don't think introducing more foo(); calls __foo(); style stuff is better.
It's just a workaround to sparse.
> 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.
Did you look at the example I gave?
--
Greetings, Michael.
next prev parent reply other threads:[~2009-03-21 13:14 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
2009-03-21 13:12 ` Michael Buesch [this message]
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=200903211412.52749.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).