lkml.org 
[lkml]   [2015]   [Jan]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC 1/6] Input: mt: make input_mt_assign_slots() a little bit more readable
Date
Rename "nrc" into "n_elems" and explicitly name the number of
rows and the number of columns.

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


\
 
 \ /
  Last update: 2015-01-19 22:01    [W:0.056 / U:16.780 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site