Patchwork [Precise/Quantal] HID: ntrig: change default value of logical/physical width/height to 1

login
register
mail settings
Submitter Jesse Sung
Date Sept. 28, 2012, 12:13 p.m.
Message ID <1348834385-1082-1-git-send-email-jesse.sung@canonical.com>
Download mbox | patch
Permalink /patch/187774/
State New
Headers show

Comments

Jesse Sung - Sept. 28, 2012, 12:13 p.m.
From: Wen-chien Jesse Sung <jesse.sung@canonical.com>

BugLink: https://launchpad.net/bugs/1044248

Since something will be divided by these variables in
show_min_width()/show_min_height() and show_activate_width()/
show_activate_height(), a divided error would be triggered if
they are zero.

Signed-off-by: Wen-chien Jesse Sung <jesse.sung@canonical.com>
Acked-by: Rafi Rubin <rafi@seas.upenn.edu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
(cherry picked from commit 4cc9834518efed3b69d3a8ff3bd162e089f68d34 in hid git tree)

Signed-off-by: Wen-chien Jesse Sung <jesse.sung@canonical.com>
---
 drivers/hid/hid-ntrig.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
Tim Gardner - Sept. 28, 2012, 12:43 p.m.
Applied to Quantal
Herton Ronaldo Krzesinski - Sept. 28, 2012, 1:35 p.m.

Tim Gardner - Sept. 28, 2012, 3:15 p.m.

Patch

diff --git a/drivers/hid/hid-ntrig.c b/drivers/hid/hid-ntrig.c
index 9fae2eb..86a969f 100644
--- a/drivers/hid/hid-ntrig.c
+++ b/drivers/hid/hid-ntrig.c
@@ -882,10 +882,10 @@  static int ntrig_probe(struct hid_device *hdev, const struct hid_device_id *id)
 	nd->activate_slack = activate_slack;
 	nd->act_state = activate_slack;
 	nd->deactivate_slack = -deactivate_slack;
-	nd->sensor_logical_width = 0;
-	nd->sensor_logical_height = 0;
-	nd->sensor_physical_width = 0;
-	nd->sensor_physical_height = 0;
+	nd->sensor_logical_width = 1;
+	nd->sensor_logical_height = 1;
+	nd->sensor_physical_width = 1;
+	nd->sensor_physical_height = 1;
 
 	hid_set_drvdata(hdev, nd);