Thread (25 messages) 25 messages, 3 authors, 2010-09-21

Re: [PATCH 2/3] hid: 3m: Convert to MT slots

From: Stéphane Chatty <hidden>
Date: 2010-09-20 20:02:06
Also in: lkml

Le 20 sept. 10 à 21:51, Henrik Rydberg a écrit :
On 09/20/2010 09:46 PM, Stéphane Chatty wrote:
quoted
Le 28 août 10 à 16:29, Henrik Rydberg a écrit :
quoted
 #define MAX_SLOTS        60
-#define MAX_TRKID        59
+#define MAX_TRKID        USHRT_MAX
Oops, I forgot this one: in the rest of the code, it seems to me  
that you use
your knowledge that TRACKINGID cannot be more than 59 (you use it  
to map the
tracking ID onto the slot ID). Therefore, why change TRKID to a  
larger value?

There are only 60 slots available, but an infinite number of  
tracking ids.
Nowhere is the tracking id assumed to be bounded by anything but  
MAX_TRKID.
What about this:
+			value = clamp_val(value, 0, MAX_SLOTS - 1);
  			if (md->valid) {
  				md->curid = value;
  				md->f[value].touch = md->touch;

If you had tracking IDs 59, 60 and 61 in the same frame, this would  
not work properly would it?

St.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help