Re: [PATCH] HID: Major update to N-Trig touchscreen

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Will do.

Dmitry Torokhov wrote:
On Thu, Feb 04, 2010 at 10:52:43PM -0500, Rafi Rubin wrote:
 +
+		if (matched < nd->contact_count) {
+			for (i = 0; i < nd->contact_count; i++) {
+				if (nd->contacts[i].logical_id < 0) {
+					for (j = 0; j < nd->prev_contact_count;
+					     j++) {
+						if (nd->
+						    prev_contacts[j].confidence
+						    &&
+						    (contact_map
+						     [nd->
+						      prev_contacts
+						      [j].logical_id] < 0)
+						    &&
+						    (abs
+						     (nd->contacts[i].x -
+						      nd->prev_contacts[j].x) <
+						     nd->max_width)
+						    &&
+						    (abs
+						     (nd->contacts[i].y -
+						      nd->prev_contacts[j].y) <
+						     nd->max_height)) {
+							nd->contacts
+							    [i].logical_id =
+							    nd->prev_contacts
+							    [j].logical_id;
+							contact_map
+							    [nd->prev_contacts
+							     [j].logical_id]
+							    = i;
+							matched++;

OK, this kind code just makes me want to poke my eyes with a fork... 5
times...

Seriously, either factor it out into a nice function, or say "screw it"
to the 80 columt limit, or maybe both. Anything but this.

Thanks.

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux