Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 40703
b: refs/heads/master
c: eb5d582
h: refs/heads/master
i:
  40701: 805df0f
  40699: 0131d28
  40695: ef8b65f
  40687: 02e350f
  40671: c4badc0
  40639: 904cf75
  40575: 18aa6bd
  40447: 88bcbb1
v: v3
  • Loading branch information
Sergey Vlasov authored and Dmitry Torokhov committed Nov 9, 2006
1 parent 916ca4b commit b27c2e0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 721556150e397f606a3f029736d77a27503f94e2
refs/heads/master: eb5d5829b368c5e32f248a70797bee5a414a2ef0
9 changes: 6 additions & 3 deletions trunk/drivers/input/mouse/psmouse-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1349,21 +1349,24 @@ 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)
{
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)
{
unsigned long *field = (unsigned long *)((char *)psmouse + (size_t)offset);
unsigned int *field = (unsigned int *)((char *)psmouse + (size_t)offset);
unsigned long value;
char *rest;

value = simple_strtoul(buf, &rest, 10);
if (*rest)
return -EINVAL;

if ((unsigned int)value != value)
return -EINVAL;

*field = value;

return count;
Expand Down

0 comments on commit b27c2e0

Please sign in to comment.