doc: fix uinput device creation warnings

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>
This commit is contained in:
José Expósito 2021-09-04 13:21:42 +02:00
parent 9b918d316a
commit 8a4f45df5b

View 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)