[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090714203301.GA11390@rhlx01.hs-esslingen.de>
Date: Tue, 14 Jul 2009 22:33:01 +0200
From: Andreas Mohr <andi@...as.de>
To: Andreas Mohr <andi@...as.de>
Cc: Pavel Machek <pavel@....cz>, Andrew Morton <akpm@...l.org>,
Arve Hj?nnev?g <arve@...roid.com>,
kernel list <linux-kernel@...r.kernel.org>,
Brian Swetland <swetland@...gle.com>,
dmitry.torokhov@...il.com, dtor@...l.ru,
linux-input@...r.kernel.org
Subject: Re: Support for synaptic touchscreen in HTC dream
Hi,
On Tue, Jul 14, 2009 at 10:25:45PM +0200, Andreas Mohr wrote:
> Hi,
>
> > + ts->snap_down[swapped] = -inactive_area_left;
> > + ts->snap_up[swapped] = max_x + inactive_area_right;
> > + ts->snap_down[!swapped] = -inactive_area_top;
> > + ts->snap_up[!swapped] = max_y + inactive_area_bottom;
> > + ts->snap_down_on[swapped] = snap_left_on;
> > + ts->snap_down_off[swapped] = snap_left_off;
> > + ts->snap_up_on[swapped] = max_x - snap_right_on;
> > + ts->snap_up_off[swapped] = max_x - snap_right_off;
> > + ts->snap_down_on[!swapped] = snap_top_on;
> > + ts->snap_down_off[!swapped] = snap_top_off;
> > + ts->snap_up_on[!swapped] = max_y - snap_bottom_on;
> > + ts->snap_up_off[!swapped] = max_y - snap_bottom_off;
>
> Could this perhaps be represented by _one_ struct definition
> and two representations of it, one for swapped and one for non-swapped case or so?
> (although sometimes it´s reverted logic, might need more thought)
> Sounds like an awful lot of repeated array calculations for no overly good reason
> (unless gcc happens to fully optimize it into oblivion automatically).
-ETOOMUCHBEER
Of course we need to swap orthogonal members individually,
thus this kind of code.
However maybe there´s still a more elegant way of doing this.
Andreas Mohr
--
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