linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Henrik Rydberg <rydberg@euromail.se>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/6] input: bcm5974: Prepare for a new trackpad header type
Date: Thu, 29 Jan 2009 00:33:21 -0800	[thread overview]
Message-ID: <20090129003321.e9c8c36c.akpm@linux-foundation.org> (raw)
In-Reply-To: <1233138229-12489-2-git-send-email-rydberg@euromail.se>

On Wed, 28 Jan 2009 11:23:44 +0100 "Henrik Rydberg" <rydberg@euromail.se> wrote:

> static int report_tp_state(struct bcm5974 *dev, int size)
>  {
>  	const struct bcm5974_config *c = &dev->cfg;
> -	const struct tp_finger *f = dev->tp_data->finger;
> +	const struct tp_finger *f;
>  	struct input_dev *input = dev->input;
> -	const int fingers = (size - 26) / 28;
> -	int raw_p, raw_w, raw_x, raw_y;
> +	int raw_p, raw_w, raw_x, raw_y, raw_n;
>  	int ptest = 0, origin = 0, nmin = 0, nmax = 0;
>  	int abs_p = 0, abs_w = 0, abs_x = 0, abs_y = 0;
>  
> -	if (size < 26 || (size - 26) % 28 != 0)
> +	if (size < c->tp_offset || (size - c->tp_offset) % SIZEOF_FINGER != 0)
>  		return -EIO;
>  
> +	f = (const struct tp_finger *)(dev->tp_data + c->tp_offset);

Is there anything which guarantees that `f' is sufficiently aligned? 
If not, the code might cause unaligned exceptions on some
architectures?


  parent reply	other threads:[~2009-01-29  8:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-28 10:23 [PATCH 0/6] input: resend of pending patches Henrik Rydberg
2009-01-28 10:23 ` [PATCH 1/6] input: bcm5974: Prepare for a new trackpad header type Henrik Rydberg
2009-01-28 10:23   ` [PATCH 2/6] input: bcm5974: Add quad-finger tapping Henrik Rydberg
2009-01-28 10:23     ` [PATCH 3/6] input: bcm5974: Add support for the Macbook 5 (Unibody) Henrik Rydberg
2009-01-28 10:23       ` [PATCH 4/6] input: bcm5974: Augmented debug information Henrik Rydberg
2009-01-28 10:23         ` [PATCH 5/6] input: Allow certain EV_ABS events to bypass all filtering Henrik Rydberg
2009-01-28 10:23           ` [PATCH 6/6] input: Add a detailed multi-touch finger data report protocol (rev2) Henrik Rydberg
2009-01-30  5:54             ` Joon Young Shim
2009-01-30  6:10             ` Joon Young Shim
2009-01-30 13:10               ` Henrik Rydberg
2009-01-29  8:29           ` [PATCH 5/6] input: Allow certain EV_ABS events to bypass all filtering Andrew Morton
2009-01-29  8:33   ` Andrew Morton [this message]
2009-01-29 22:30     ` [PATCH 1/6] input: bcm5974: Prepare for a new trackpad header type Henrik Rydberg

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=20090129003321.e9c8c36c.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rydberg@euromail.se \
    /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;
as well as URLs for NNTP newsgroup(s).