Loading drivers/input/keyboard/atkbd.c +5 −15 Original line number Diff line number Diff line Loading @@ -1207,15 +1207,13 @@ static ssize_t atkbd_set_extra(struct atkbd *atkbd, const char *buf, size_t coun { struct input_dev *old_dev, *new_dev; unsigned long value; char *rest; int err; unsigned char old_extra, old_set; if (!atkbd->write) return -EIO; value = simple_strtoul(buf, &rest, 10); if (*rest || value > 1) if (strict_strtoul(buf, 10, &value) || value > 1) return -EINVAL; if (atkbd->extra != value) { Loading Loading @@ -1264,12 +1262,10 @@ static ssize_t atkbd_set_scroll(struct atkbd *atkbd, const char *buf, size_t cou { struct input_dev *old_dev, *new_dev; unsigned long value; char *rest; int err; unsigned char old_scroll; value = simple_strtoul(buf, &rest, 10); if (*rest || value > 1) if (strict_strtoul(buf, 10, &value) || value > 1) return -EINVAL; if (atkbd->scroll != value) { Loading Loading @@ -1310,15 +1306,13 @@ static ssize_t atkbd_set_set(struct atkbd *atkbd, const char *buf, size_t count) { struct input_dev *old_dev, *new_dev; unsigned long value; char *rest; int err; unsigned char old_set, old_extra; if (!atkbd->write) return -EIO; value = simple_strtoul(buf, &rest, 10); if (*rest || (value != 2 && value != 3)) if (strict_strtoul(buf, 10, &value) || (value != 2 && value != 3)) return -EINVAL; if (atkbd->set != value) { Loading Loading @@ -1361,15 +1355,13 @@ static ssize_t atkbd_set_softrepeat(struct atkbd *atkbd, const char *buf, size_t { struct input_dev *old_dev, *new_dev; unsigned long value; char *rest; int err; unsigned char old_softrepeat, old_softraw; if (!atkbd->write) return -EIO; value = simple_strtoul(buf, &rest, 10); if (*rest || value > 1) if (strict_strtoul(buf, 10, &value) || value > 1) return -EINVAL; if (atkbd->softrepeat != value) { Loading Loading @@ -1413,12 +1405,10 @@ static ssize_t atkbd_set_softraw(struct atkbd *atkbd, const char *buf, size_t co { struct input_dev *old_dev, *new_dev; unsigned long value; char *rest; int err; unsigned char old_softraw; value = simple_strtoul(buf, &rest, 10); if (*rest || value > 1) if (strict_strtoul(buf, 10, &value) || value > 1) return -EINVAL; if (atkbd->softraw != value) { Loading drivers/input/mouse/logips2pp.c +1 −3 Original line number Diff line number Diff line Loading @@ -157,10 +157,8 @@ static ssize_t ps2pp_attr_show_smartscroll(struct psmouse *psmouse, void *data, static ssize_t ps2pp_attr_set_smartscroll(struct psmouse *psmouse, void *data, const char *buf, size_t count) { 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; ps2pp_set_smartscroll(psmouse, value); Loading drivers/input/mouse/psmouse-base.c +3 −9 Original line number Diff line number Diff line Loading @@ -1433,10 +1433,8 @@ static ssize_t psmouse_set_int_attr(struct psmouse *psmouse, void *offset, const { unsigned int *field = (unsigned int *)((char *)psmouse + (size_t)offset); unsigned long value; char *rest; value = simple_strtoul(buf, &rest, 10); if (*rest) if (strict_strtoul(buf, 10, &value)) return -EINVAL; if ((unsigned int)value != value) Loading Loading @@ -1549,10 +1547,8 @@ static ssize_t psmouse_attr_set_protocol(struct psmouse *psmouse, void *data, co static ssize_t psmouse_attr_set_rate(struct psmouse *psmouse, void *data, const char *buf, size_t count) { unsigned long value; char *rest; value = simple_strtoul(buf, &rest, 10); if (*rest) if (strict_strtoul(buf, 10, &value)) return -EINVAL; psmouse->set_rate(psmouse, value); Loading @@ -1562,10 +1558,8 @@ static ssize_t psmouse_attr_set_rate(struct psmouse *psmouse, void *data, const static ssize_t psmouse_attr_set_resolution(struct psmouse *psmouse, void *data, const char *buf, size_t count) { unsigned long value; char *rest; value = simple_strtoul(buf, &rest, 10); if (*rest) if (strict_strtoul(buf, 10, &value)) return -EINVAL; psmouse->set_resolution(psmouse, value); Loading drivers/input/mouse/trackpoint.c +2 −6 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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) Loading drivers/input/tablet/aiptek.c +38 −15 Original line number Diff line number Diff line Loading @@ -1202,16 +1202,22 @@ static ssize_t store_tabletXtilt(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct aiptek *aiptek = dev_get_drvdata(dev); int x; long x; if (strict_strtol(buf, 10, &x)) { size_t len = buf[count - 1] == '\n' ? count - 1 : count; if (strncmp(buf, "disable", len)) return -EINVAL; if (strcmp(buf, "disable") == 0) { aiptek->newSetting.xTilt = AIPTEK_TILT_DISABLE; } else { x = (int)simple_strtol(buf, NULL, 10); if (x >= AIPTEK_TILT_MIN && x <= AIPTEK_TILT_MAX) { if (x < AIPTEK_TILT_MIN || x > AIPTEK_TILT_MAX) return -EINVAL; aiptek->newSetting.xTilt = x; } } return count; } Loading @@ -1238,16 +1244,22 @@ static ssize_t store_tabletYtilt(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct aiptek *aiptek = dev_get_drvdata(dev); int y; long y; if (strict_strtol(buf, 10, &y)) { size_t len = buf[count - 1] == '\n' ? count - 1 : count; if (strncmp(buf, "disable", len)) return -EINVAL; if (strcmp(buf, "disable") == 0) { aiptek->newSetting.yTilt = AIPTEK_TILT_DISABLE; } else { y = (int)simple_strtol(buf, NULL, 10); if (y >= AIPTEK_TILT_MIN && y <= AIPTEK_TILT_MAX) { if (y < AIPTEK_TILT_MIN || y > AIPTEK_TILT_MAX) return -EINVAL; aiptek->newSetting.yTilt = y; } } return count; } Loading @@ -1269,8 +1281,12 @@ static ssize_t store_tabletJitterDelay(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct aiptek *aiptek = dev_get_drvdata(dev); long j; aiptek->newSetting.jitterDelay = (int)simple_strtol(buf, NULL, 10); if (strict_strtol(buf, 10, &j)) return -EINVAL; aiptek->newSetting.jitterDelay = (int)j; return count; } Loading @@ -1294,8 +1310,12 @@ static ssize_t store_tabletProgrammableDelay(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct aiptek *aiptek = dev_get_drvdata(dev); long d; if (strict_strtol(buf, 10, &d)) return -EINVAL; aiptek->newSetting.programmableDelay = (int)simple_strtol(buf, NULL, 10); aiptek->newSetting.programmableDelay = (int)d; return count; } Loading Loading @@ -1541,8 +1561,11 @@ static ssize_t store_tabletWheel(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct aiptek *aiptek = dev_get_drvdata(dev); long w; if (strict_strtol(buf, 10, &w)) return -EINVAL; aiptek->newSetting.wheel = (int)simple_strtol(buf, NULL, 10); aiptek->newSetting.wheel = (int)w; return count; } Loading Loading
drivers/input/keyboard/atkbd.c +5 −15 Original line number Diff line number Diff line Loading @@ -1207,15 +1207,13 @@ static ssize_t atkbd_set_extra(struct atkbd *atkbd, const char *buf, size_t coun { struct input_dev *old_dev, *new_dev; unsigned long value; char *rest; int err; unsigned char old_extra, old_set; if (!atkbd->write) return -EIO; value = simple_strtoul(buf, &rest, 10); if (*rest || value > 1) if (strict_strtoul(buf, 10, &value) || value > 1) return -EINVAL; if (atkbd->extra != value) { Loading Loading @@ -1264,12 +1262,10 @@ static ssize_t atkbd_set_scroll(struct atkbd *atkbd, const char *buf, size_t cou { struct input_dev *old_dev, *new_dev; unsigned long value; char *rest; int err; unsigned char old_scroll; value = simple_strtoul(buf, &rest, 10); if (*rest || value > 1) if (strict_strtoul(buf, 10, &value) || value > 1) return -EINVAL; if (atkbd->scroll != value) { Loading Loading @@ -1310,15 +1306,13 @@ static ssize_t atkbd_set_set(struct atkbd *atkbd, const char *buf, size_t count) { struct input_dev *old_dev, *new_dev; unsigned long value; char *rest; int err; unsigned char old_set, old_extra; if (!atkbd->write) return -EIO; value = simple_strtoul(buf, &rest, 10); if (*rest || (value != 2 && value != 3)) if (strict_strtoul(buf, 10, &value) || (value != 2 && value != 3)) return -EINVAL; if (atkbd->set != value) { Loading Loading @@ -1361,15 +1355,13 @@ static ssize_t atkbd_set_softrepeat(struct atkbd *atkbd, const char *buf, size_t { struct input_dev *old_dev, *new_dev; unsigned long value; char *rest; int err; unsigned char old_softrepeat, old_softraw; if (!atkbd->write) return -EIO; value = simple_strtoul(buf, &rest, 10); if (*rest || value > 1) if (strict_strtoul(buf, 10, &value) || value > 1) return -EINVAL; if (atkbd->softrepeat != value) { Loading Loading @@ -1413,12 +1405,10 @@ static ssize_t atkbd_set_softraw(struct atkbd *atkbd, const char *buf, size_t co { struct input_dev *old_dev, *new_dev; unsigned long value; char *rest; int err; unsigned char old_softraw; value = simple_strtoul(buf, &rest, 10); if (*rest || value > 1) if (strict_strtoul(buf, 10, &value) || value > 1) return -EINVAL; if (atkbd->softraw != value) { Loading
drivers/input/mouse/logips2pp.c +1 −3 Original line number Diff line number Diff line Loading @@ -157,10 +157,8 @@ static ssize_t ps2pp_attr_show_smartscroll(struct psmouse *psmouse, void *data, static ssize_t ps2pp_attr_set_smartscroll(struct psmouse *psmouse, void *data, const char *buf, size_t count) { 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; ps2pp_set_smartscroll(psmouse, value); Loading
drivers/input/mouse/psmouse-base.c +3 −9 Original line number Diff line number Diff line Loading @@ -1433,10 +1433,8 @@ static ssize_t psmouse_set_int_attr(struct psmouse *psmouse, void *offset, const { unsigned int *field = (unsigned int *)((char *)psmouse + (size_t)offset); unsigned long value; char *rest; value = simple_strtoul(buf, &rest, 10); if (*rest) if (strict_strtoul(buf, 10, &value)) return -EINVAL; if ((unsigned int)value != value) Loading Loading @@ -1549,10 +1547,8 @@ static ssize_t psmouse_attr_set_protocol(struct psmouse *psmouse, void *data, co static ssize_t psmouse_attr_set_rate(struct psmouse *psmouse, void *data, const char *buf, size_t count) { unsigned long value; char *rest; value = simple_strtoul(buf, &rest, 10); if (*rest) if (strict_strtoul(buf, 10, &value)) return -EINVAL; psmouse->set_rate(psmouse, value); Loading @@ -1562,10 +1558,8 @@ static ssize_t psmouse_attr_set_rate(struct psmouse *psmouse, void *data, const static ssize_t psmouse_attr_set_resolution(struct psmouse *psmouse, void *data, const char *buf, size_t count) { unsigned long value; char *rest; value = simple_strtoul(buf, &rest, 10); if (*rest) if (strict_strtoul(buf, 10, &value)) return -EINVAL; psmouse->set_resolution(psmouse, value); Loading
drivers/input/mouse/trackpoint.c +2 −6 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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) Loading
drivers/input/tablet/aiptek.c +38 −15 Original line number Diff line number Diff line Loading @@ -1202,16 +1202,22 @@ static ssize_t store_tabletXtilt(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct aiptek *aiptek = dev_get_drvdata(dev); int x; long x; if (strict_strtol(buf, 10, &x)) { size_t len = buf[count - 1] == '\n' ? count - 1 : count; if (strncmp(buf, "disable", len)) return -EINVAL; if (strcmp(buf, "disable") == 0) { aiptek->newSetting.xTilt = AIPTEK_TILT_DISABLE; } else { x = (int)simple_strtol(buf, NULL, 10); if (x >= AIPTEK_TILT_MIN && x <= AIPTEK_TILT_MAX) { if (x < AIPTEK_TILT_MIN || x > AIPTEK_TILT_MAX) return -EINVAL; aiptek->newSetting.xTilt = x; } } return count; } Loading @@ -1238,16 +1244,22 @@ static ssize_t store_tabletYtilt(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct aiptek *aiptek = dev_get_drvdata(dev); int y; long y; if (strict_strtol(buf, 10, &y)) { size_t len = buf[count - 1] == '\n' ? count - 1 : count; if (strncmp(buf, "disable", len)) return -EINVAL; if (strcmp(buf, "disable") == 0) { aiptek->newSetting.yTilt = AIPTEK_TILT_DISABLE; } else { y = (int)simple_strtol(buf, NULL, 10); if (y >= AIPTEK_TILT_MIN && y <= AIPTEK_TILT_MAX) { if (y < AIPTEK_TILT_MIN || y > AIPTEK_TILT_MAX) return -EINVAL; aiptek->newSetting.yTilt = y; } } return count; } Loading @@ -1269,8 +1281,12 @@ static ssize_t store_tabletJitterDelay(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct aiptek *aiptek = dev_get_drvdata(dev); long j; aiptek->newSetting.jitterDelay = (int)simple_strtol(buf, NULL, 10); if (strict_strtol(buf, 10, &j)) return -EINVAL; aiptek->newSetting.jitterDelay = (int)j; return count; } Loading @@ -1294,8 +1310,12 @@ static ssize_t store_tabletProgrammableDelay(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct aiptek *aiptek = dev_get_drvdata(dev); long d; if (strict_strtol(buf, 10, &d)) return -EINVAL; aiptek->newSetting.programmableDelay = (int)simple_strtol(buf, NULL, 10); aiptek->newSetting.programmableDelay = (int)d; return count; } Loading Loading @@ -1541,8 +1561,11 @@ static ssize_t store_tabletWheel(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct aiptek *aiptek = dev_get_drvdata(dev); long w; if (strict_strtol(buf, 10, &w)) return -EINVAL; aiptek->newSetting.wheel = (int)simple_strtol(buf, NULL, 10); aiptek->newSetting.wheel = (int)w; return count; } Loading