[RFC 1/6] Input: mt: make input_mt_assign_slots() a little bit more readable

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

 



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

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@xxxxxxxxxx>
---
 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-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