[PATCH] Input: wacom: Remove code duplication

Subsystems: input (keyboard, mouse, joystick, touchscreen) drivers, the rest

STALE5183d

2 messages, 2 authors, 2012-06-03 · open the first message on its own page

[PATCH] Input: wacom: Remove code duplication

From: Jason Gerecke <hidden>
Date: 2012-06-01 16:39:12

Replaces code to calculate Intuos5 physical dimensions with a call
to an existing function that performs the same task.

Signed-off-by: Jason Gerecke <redacted>
---
 drivers/input/tablet/wacom_sys.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index b3a8bd3..50a804d 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -1144,10 +1144,7 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
 			features->device_type = BTN_TOOL_FINGER;
 			features->pktlen = WACOM_PKGLEN_BBTOUCH3;
 
-			features->x_phy =
-				(features->x_max * 100) / features->x_resolution;
-			features->y_phy =
-				(features->y_max * 100) / features->y_resolution;
+			wacom_set_phy_from_res(features);
 
 			features->x_max = 4096;
 			features->y_max = 4096;
-- 
1.7.10.3

Re: [PATCH] Input: wacom: Remove code duplication

From: Chris Bagwell <hidden>
Date: 2012-06-03 21:45:53

On Fri, Jun 1, 2012 at 11:39 AM, Jason Gerecke [off-list ref] wrote:
Replaces code to calculate Intuos5 physical dimensions with a call
to an existing function that performs the same task.

Signed-off-by: Jason Gerecke <redacted>
Reviewed-by: Chris Bagwell <redacted>
quoted hunk
---
 drivers/input/tablet/wacom_sys.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index b3a8bd3..50a804d 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -1144,10 +1144,7 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
                       features->device_type = BTN_TOOL_FINGER;
                       features->pktlen = WACOM_PKGLEN_BBTOUCH3;

-                       features->x_phy =
-                               (features->x_max * 100) / features->x_resolution;
-                       features->y_phy =
-                               (features->y_max * 100) / features->y_resolution;
+                       wacom_set_phy_from_res(features);

                       features->x_max = 4096;
                       features->y_max = 4096;
--
1.7.10.3

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help