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 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: signature.asc
Description: This is a digitally signed message part


[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