From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935555Ab0BZIPY (ORCPT ); Fri, 26 Feb 2010 03:15:24 -0500 Received: from mail-gw0-f46.google.com ([74.125.83.46]:65141 "EHLO mail-gw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935455Ab0BZIPV (ORCPT ); Fri, 26 Feb 2010 03:15:21 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; b=kQ3htwSyR5/gVs+9rFdEArTumDQvHFmE3MnJNpUC3HowhiiGpN3i8mjNb79Mes/OYg ERixteQjuH7e2/3qRjdZU6LwBzYTRISM7IzJRqHlDw6/MGGHzozLSQbYE3phqHZn3Wb4 xDKMNs37o/RTh8TAF9KF5+cjCPhWDOYDIR0XQ= Date: Fri, 26 Feb 2010 00:15:15 -0800 From: Dmitry Torokhov To: Jiri Kosina Cc: Bruno =?iso-8859-1?Q?Pr=E9mont?= , linux-input@vger.kernel.org, linux-usb@vger.kernel.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Rick L. Vinyard Jr." , Nicu Pavel Subject: Re: [PATCH 1/3] picolcd: driver for PicoLCD HID device 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-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.20 (2009-08-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Torokhov Date: Fri, 26 Feb 2010 08:15:15 +0000 Subject: Re: [PATCH 1/3] picolcd: driver for PicoLCD HID device Message-Id: <20100226081514.GB17444@core.coreip.homeip.net> List-Id: References: <20100221002001.0a7e05a7@neptune.home> <20100224170049.0d04af3c@neptune.home> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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 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 to de= vice */ > > +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