On Friday 23 May 2008, Andrew Morton wrote:
> On Thu, 22 May 2008 13:48:38 -0700 David Brownell <[EMAIL PROTECTED]> wrote:
> 
> > +           /* ... after we unbound from the underlying device? */
> > +           spin_lock_irq(&spidev->spi_lock);
> > +           dofree = (spidev->spi == NULL);
> > +           spin_unlock_irq(&spidev->spi_lock);
> > +
> > +           if (dofree)
> > +                   kfree(spidev);
> 
> that's very weird-looking code.

Just sticking to the locking policy that access to that field is
always protected by that lock ... "clearly OK", even if it might
be a bit on the overkill side.

I'd rather be consistent in that than have to worry about whether,
in this one path, it's OK to switch to a different policy since
something else ensures that didn't race with spidev_remove().

- Dave


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
spi-devel-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/spi-devel-general

Reply via email to