lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 10 Sep 2008 09:00:36 -0400
From:	Dmitry Torokhov <dmitry.torokhov@...il.com>
To:	Andres Salomon <dilinger@...ued.net>
Cc:	linux-input@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/3] OLPC: touchpad driver (take 2)

On Fri, Aug 29, 2008 at 02:49:59AM -0400, Andres Salomon wrote:
> > > +static void hgpk_spewing_hack(struct psmouse *psmouse, int l, int
> > > r, int x,
> > > +		int y)
> > > +{
> > > +	struct hgpk_data *priv = psmouse->private;
> > > +	static int count;
> > > +	static int x_tally;
> > > +	static int y_tally;
> > 
> > Hmm, I guess we'll never see 2 such devices in one box, but still
> > moving it to psmouse->private woudl be a good practice.
> 
> 
> Can you please clarify this comment?
> 

If you ever have 2 such devices in the same box use of static variables
will cause the code to not work properly because they will be shared
between the devices. Proper way is to move them into per-device
structure.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ