From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Andres Salomon <dilinger@queued.net>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] OLPC: touchpad driver (take 2)
Date: Wed, 10 Sep 2008 09:00:36 -0400 [thread overview]
Message-ID: <20080910130035.GB25221@anvil.corenet.prv> (raw)
In-Reply-To: <20080829024959.68bcdc98@fred>
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
next prev parent reply other threads:[~2008-09-10 13:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-13 19:24 Andres Salomon
2008-08-15 3:14 ` Dmitry Torokhov
2008-08-29 6:49 ` Andres Salomon
2008-09-10 13:00 ` Dmitry Torokhov [this message]
2008-09-10 21:55 ` Andres Salomon
2008-09-11 5:01 ` Andres Salomon
2008-09-11 5:32 ` Andres Salomon
2008-09-11 13:05 ` Dmitry Torokhov
2008-09-11 14:32 ` Andres Salomon
2008-09-11 18:32 ` Andres Salomon
2008-09-11 18:34 ` Andres Salomon
2008-09-11 12:59 ` Dmitry Torokhov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080910130035.GB25221@anvil.corenet.prv \
--to=dmitry.torokhov@gmail.com \
--cc=dilinger@queued.net \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®