lkml.org 
[lkml]   [2009]   [Jan]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/6] input: bcm5974: Prepare for a new trackpad header type
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?



\
 
 \ /
  Last update: 2009-01-29 09:37    [W:0.240 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site