lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1421700835-22157-2-git-send-email-benjamin.tissoires@redhat.com>
Date:	Mon, 19 Jan 2015 15:53:50 -0500
From:	Benjamin Tissoires <benjamin.tissoires@...hat.com>
To:	Henrik Rydberg <rydberg@...omail.se>,
	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	Hans de Goede <hdegoede@...hat.com>
Cc:	Peter Hutterer <peter.hutterer@...-t.net>,
	linux-input@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [RFC 1/6] Input: mt: make input_mt_assign_slots() a little bit more readable

Rename "nrc" into "n_elems" and explicitly name the number of
rows and the number of columns.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@...hat.com>
---
 drivers/input/input-mt.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/input/input-mt.c b/drivers/input/input-mt.c
index fbe29fc..b6ee42a 100644
--- a/drivers/input/input-mt.c
+++ b/drivers/input/input-mt.c
@@ -404,7 +404,7 @@ int input_mt_assign_slots(struct input_dev *dev, int *slots,
 			  const struct input_mt_pos *pos, int num_pos)
 {
 	struct input_mt *mt = dev->mt;
-	int nrc;
+	int n_elems, n_rows, n_columns;
 
 	if (!mt || !mt->red)
 		return -ENXIO;
@@ -413,8 +413,10 @@ int input_mt_assign_slots(struct input_dev *dev, int *slots,
 	if (num_pos < 1)
 		return 0;
 
-	nrc = input_mt_set_matrix(mt, pos, num_pos);
-	find_reduced_matrix(mt->red, num_pos, nrc / num_pos, nrc);
+	n_elems = input_mt_set_matrix(mt, pos, num_pos);
+	n_rows = n_elems / num_pos;
+	n_columns = num_pos;
+	find_reduced_matrix(mt->red, n_columns, n_rows, n_elems);
 	input_mt_set_slots(mt, slots, num_pos);
 
 	return 0;
-- 
2.1.0

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ