doc: fix uinput device creation warnings
authorJosé Expósito <jose.exposito89@gmail.com>
Sat, 4 Sep 2021 11:21:42 +0000 (13:21 +0200)
committerJihoon Kim <jihoon48.kim@samsung.com>
Fri, 17 Nov 2023 10:41:23 +0000 (19:41 +0900)
The example code for creating uinput devices produces the following
warnings:

warning: unused variable ‘ev’ [-Wunused-variable]
   | struct input_event ev[2];
   |                    ^~
warning: unused variable ‘new_fd’ [-Wunused-variable]
   | int fd, new_fd, uifd;
   |         ^~~~~~
warning: ‘err’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   |     return err;
   |            ^~~

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
libevdev/libevdev-uinput.h

index 4b21f8abc556b39340c773508c363a35e6e1bd71..b54ec026eba791f76b7d87fa51ca56ec769e2336 100644 (file)
@@ -42,14 +42,13 @@ struct libevdev_uinput;
  *
  * @code
  * int err;
- * int fd, new_fd, uifd;
+ * int fd, uifd;
  * struct libevdev *dev;
  * struct libevdev_uinput *uidev;
- * struct input_event ev[2];
  *
  * fd = open("/dev/input/event0", O_RDONLY);
  * if (fd < 0)
- *     return err;
+ *     return -errno;
  *
  * err = libevdev_new_from_fd(fd, &dev);
  * if (err != 0)