lkml.org 
[lkml]   [2010]   [Feb]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/3] picolcd: driver for PicoLCD HID device
On Thu, Feb 25, 2010 at 12:07:38PM +0100, Jiri Kosina wrote:
> On Wed, 24 Feb 2010, Bruno Prémont wrote:
>
> > +/* Update fb_vbitmap from the screen_base and send changed tiles to device */
> > +static void picolcd_fb_update(struct picolcd_data *data)
> > +{
> > + int chip, tile;
> > +
> > + spin_lock(&data->lock);
> > + if (!(data->status & PICOLCD_READY_FB)) {
> > + spin_unlock(&data->lock);
> > + picolcd_fb_reset(data->hdev, 0);
> > + } else
> > + spin_unlock(&data->lock);
>
> Please put the brackets to the else branch as well.
>
Well, it looks like it can be rewritten as:

spin_lock(&data->lock);
need_reset = !(data->status & PICOLCD_READY_FB);
spin_unlock(&data->lock);

if (need_reset)
picolcd_fb_reset(data->hdev, 0);

Which plainly shows that the locking here is bogus.

--
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2010-02-26 09:17    [W:0.208 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site