Search Linux Wireless

Re: [RFC][PATCH 4/5] ar9170: USB frontend driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux