From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Torokhov Subject: Re: [PATCH 1/3] picolcd: driver for PicoLCD HID device Date: Fri, 26 Feb 2010 00:15:15 -0800 Message-ID: <20100226081514.GB17444@core.coreip.homeip.net> References: <20100221002001.0a7e05a7@neptune.home> <20100224170049.0d04af3c@neptune.home> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-usb-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Jiri Kosina Cc: Bruno =?iso-8859-1?Q?Pr=E9mont?= , linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, "Rick L. Vinyard Jr." , Nicu Pavel List-Id: linux-input@vger.kernel.org On Thu, Feb 25, 2010 at 12:07:38PM +0100, Jiri Kosina wrote: > On Wed, 24 Feb 2010, Bruno Pr=E9mont wrote: >=20 > > +/* Update fb_vbitmap from the screen_base and send changed tiles t= o 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); >=20 > Please put the brackets to the else branch as well. >=20 Well, it looks like it can be rewritten as: spin_lock(&data->lock); need_reset =3D !(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. --=20 Dmitry -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html