From ea6162222622dc03564ef7b56a3ef885a9040d45 Mon Sep 17 00:00:00 2001 From: Eugene Syromyatnikov Date: Mon, 2 Apr 2018 20:16:00 +0200 Subject: [PATCH] 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. --- defs.h | 3 +++ evdev.c | 4 ++++ ioctl.c | 1 - 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/defs.h b/defs.h index 72789e26..62705316 100644 --- a/defs.h +++ b/defs.h @@ -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[]; diff --git a/evdev.c b/evdev.c index ccf41a19..6616eca1 100644 --- a/evdev.c +++ b/evdev.c @@ -29,6 +29,8 @@ #include "defs.h" +#include "xlat/evdev_abs.h" + #ifdef HAVE_LINUX_INPUT_H # include @@ -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) { diff --git a/ioctl.c b/ioctl.c index 59b0a6b5..4cae802c 100644 --- a/ioctl.c +++ b/ioctl.c @@ -33,7 +33,6 @@ #include #include "xlat/ioctl_dirs.h" -#include "xlat/evdev_abs.h" #include "xlat/evdev_ev.h" static int -- 2.40.0