|
@@ -1349,14 +1349,14 @@ ssize_t psmouse_attr_set_helper(struct device *dev, struct device_attribute *dev
|
|
|
|
|
|
static ssize_t psmouse_show_int_attr(struct psmouse *psmouse, void *offset, char *buf)
|
|
static ssize_t psmouse_show_int_attr(struct psmouse *psmouse, void *offset, char *buf)
|
|
{
|
|
{
|
|
- unsigned long *field = (unsigned long *)((char *)psmouse + (size_t)offset);
|
|
|
|
|
|
+ unsigned int *field = (unsigned int *)((char *)psmouse + (size_t)offset);
|
|
|
|
|
|
- return sprintf(buf, "%lu\n", *field);
|
|
|
|
|
|
+ return sprintf(buf, "%u\n", *field);
|
|
}
|
|
}
|
|
|
|
|
|
static ssize_t psmouse_set_int_attr(struct psmouse *psmouse, void *offset, const char *buf, size_t count)
|
|
static ssize_t psmouse_set_int_attr(struct psmouse *psmouse, void *offset, const char *buf, size_t count)
|
|
{
|
|
{
|
|
- unsigned long *field = (unsigned long *)((char *)psmouse + (size_t)offset);
|
|
|
|
|
|
+ unsigned int *field = (unsigned int *)((char *)psmouse + (size_t)offset);
|
|
unsigned long value;
|
|
unsigned long value;
|
|
char *rest;
|
|
char *rest;
|
|
|
|
|
|
@@ -1364,6 +1364,9 @@ static ssize_t psmouse_set_int_attr(struct psmouse *psmouse, void *offset, const
|
|
if (*rest)
|
|
if (*rest)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
+ if ((unsigned int)value != value)
|
|
|
|
+ return -EINVAL;
|
|
|
|
+
|
|
*field = value;
|
|
*field = value;
|
|
|
|
|
|
return count;
|
|
return count;
|