aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/trackpoint.c
diff options
context:
space:
mode:
authorJoe Rouvier <joe@rouvier.org>2008-08-10 00:29:25 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2008-09-10 12:11:57 -0400
commit160f1fef7e52e974489b3c70fbd4e094c06965c2 (patch)
tree80423a45a9a57736e6ce6351da0801e1a5b02b8c /drivers/input/mouse/trackpoint.c
parentInput: appletouch - handle geyser 3/4 status bits (diff)
downloadlinux-dev-160f1fef7e52e974489b3c70fbd4e094c06965c2.tar.xz
linux-dev-160f1fef7e52e974489b3c70fbd4e094c06965c2.zip
Input: convert drivers to use strict_strtoul()
strict_strtoul() allows newline character at the end of the the input string and therefore is more user-friendly. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/mouse/trackpoint.c')
-rw-r--r--drivers/input/mouse/trackpoint.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/input/mouse/trackpoint.c b/drivers/input/mouse/trackpoint.c
index 26b845fc186a..e68c814c4361 100644
--- a/drivers/input/mouse/trackpoint.c
+++ b/drivers/input/mouse/trackpoint.c
@@ -89,10 +89,8 @@ static ssize_t trackpoint_set_int_attr(struct psmouse *psmouse, void *data,
struct trackpoint_attr_data *attr = data;
unsigned char *field = (unsigned char *)((char *)tp + attr->field_offset);
unsigned long value;
- char *rest;
- value = simple_strtoul(buf, &rest, 10);
- if (*rest || value > 255)
+ if (strict_strtoul(buf, 10, &value) || value > 255)
return -EINVAL;
*field = value;
@@ -117,10 +115,8 @@ static ssize_t trackpoint_set_bit_attr(struct psmouse *psmouse, void *data,
struct trackpoint_attr_data *attr = data;
unsigned char *field = (unsigned char *)((char *)tp + attr->field_offset);
unsigned long value;
- char *rest;
- value = simple_strtoul(buf, &rest, 10);
- if (*rest || value > 1)
+ if (strict_strtoul(buf, 10, &value) || value > 1)
return -EINVAL;
if (attr->inverted)