mirror of
https://gitlab.freedesktop.org/libevdev/libevdev.git
synced 2025-12-28 10:50:08 +01:00
Return -1 for failing to enable/disable bits
as the documentation says Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
cbb2d1391b
commit
5bdd321d43
1 changed files with 6 additions and 6 deletions
|
|
@ -785,7 +785,7 @@ int
|
|||
libevdev_enable_event_type(struct libevdev *dev, unsigned int type)
|
||||
{
|
||||
if (type > EV_MAX)
|
||||
return 1;
|
||||
return -1;
|
||||
|
||||
set_bit(dev->bits, type);
|
||||
|
||||
|
|
@ -796,7 +796,7 @@ int
|
|||
libevdev_disable_event_type(struct libevdev *dev, unsigned int type)
|
||||
{
|
||||
if (type > EV_MAX)
|
||||
return 1;
|
||||
return -1;
|
||||
|
||||
clear_bit(dev->bits, type);
|
||||
|
||||
|
|
@ -811,12 +811,12 @@ libevdev_enable_event_code(struct libevdev *dev, unsigned int type,
|
|||
unsigned long *mask;
|
||||
|
||||
if (libevdev_enable_event_type(dev, type))
|
||||
return 1;
|
||||
return -1;
|
||||
|
||||
max = type_to_mask(dev, type, &mask);
|
||||
|
||||
if (code > max)
|
||||
return 1;
|
||||
return -1;
|
||||
|
||||
set_bit(mask, code);
|
||||
|
||||
|
|
@ -835,12 +835,12 @@ libevdev_disable_event_code(struct libevdev *dev, unsigned int type, unsigned in
|
|||
unsigned long *mask;
|
||||
|
||||
if (type > EV_MAX)
|
||||
return 1;
|
||||
return -1;
|
||||
|
||||
max = type_to_mask(dev, type, &mask);
|
||||
|
||||
if (code > max)
|
||||
return 1;
|
||||
return -1;
|
||||
|
||||
clear_bit(mask, code);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue