lkml.org 
[lkml]   [2008]   [Sep]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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


\
 
 \ /
  Last update: 2008-09-10 15:03    [W:0.056 / U:0.700 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site