Move xlat/evdev_abs.h inclusion from ioctl.c to evdev.c

Also introduce evdev_abs_size constant, which will be needed later.

* defs.h (evdev_abs_size): New declaration.
* ioctl.c: Move xlat/evdev_abs.h inclusion ...
* evdev.c: ... here.
(evdev_abs_size): New constant variable.
This commit is contained in:
Eugene Syromyatnikov 2018-04-02 20:16:00 +02:00 committed by Dmitry V. Levin
parent 25d6ed1600
commit ea61622226
3 changed files with 7 additions and 1 deletions

3
defs.h
View File

@ -296,6 +296,9 @@ extern const struct xlat ethernet_protocols[];
extern const size_t ethernet_protocols_size;
extern const struct xlat evdev_abs[];
/** Number of elements in evdev_abs array without the terminating record. */
extern const size_t evdev_abs_size;
extern const struct xlat iffflags[];
extern const struct xlat inet_protocols[];
extern const struct xlat ip_type_of_services[];

View File

@ -29,6 +29,8 @@
#include "defs.h"
#include "xlat/evdev_abs.h"
#ifdef HAVE_LINUX_INPUT_H
# include <linux/ioctl.h>
@ -51,6 +53,8 @@
# define SYN_MAX 0xf
# endif
const size_t evdev_abs_size = ARRAY_SIZE(evdev_abs) - 1;
static int
abs_ioctl(struct tcb *const tcp, const kernel_ulong_t arg)
{

View File

@ -33,7 +33,6 @@
#include <linux/ioctl.h>
#include "xlat/ioctl_dirs.h"
#include "xlat/evdev_abs.h"
#include "xlat/evdev_ev.h"
static int