From d76c0cdbab34c8baaeb89ab5dcef84858e5152bf Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Fri, 13 Nov 2020 14:20:12 +0100 Subject: [PATCH] treewide: unexport GPIOD_UNUSED GPIOD_UNUSED symbol isn't used in any public part of the library. We can unexport it and put it into tools-common.h for use by tools only. Signed-off-by: Bartosz Golaszewski --- include/gpiod.h | 5 ----- tools/gpiomon.c | 2 +- tools/gpioset.c | 2 +- tools/tools-common.h | 1 + 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/include/gpiod.h b/include/gpiod.h index 098321d..8513b7b 100644 --- a/include/gpiod.h +++ b/include/gpiod.h @@ -62,11 +62,6 @@ struct gpiod_line_bulk_iter; */ #define GPIOD_API __attribute__((visibility("default"))) -/** - * @brief Marks a function argument or variable as potentially unused. - */ -#define GPIOD_UNUSED __attribute__((unused)) - /** * @brief Shift 1 by given offset. * @param nr Bit position. diff --git a/tools/gpiomon.c b/tools/gpiomon.c index 000b34b..44fb431 100644 --- a/tools/gpiomon.c +++ b/tools/gpiomon.c @@ -150,7 +150,7 @@ static void handle_event(unsigned int line_offset, unsigned int event_type, } } -static void handle_signal(int signum GPIOD_UNUSED) +static void handle_signal(int signum UNUSED) { exit(EXIT_SUCCESS); } diff --git a/tools/gpioset.c b/tools/gpioset.c index 82dfa71..7f4615a 100644 --- a/tools/gpioset.c +++ b/tools/gpioset.c @@ -90,7 +90,7 @@ static void maybe_daemonize(bool daemonize) } } -static void wait_enter(void *data GPIOD_UNUSED) +static void wait_enter(void *data UNUSED) { getchar(); } diff --git a/tools/tools-common.h b/tools/tools-common.h index 9f1b801..8ccde62 100644 --- a/tools/tools-common.h +++ b/tools/tools-common.h @@ -16,6 +16,7 @@ */ #define NORETURN __attribute__((noreturn)) +#define UNUSED __attribute__((unused)) #define PRINTF(fmt, arg) __attribute__((format(printf, fmt, arg))) #define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x))) -- 2.30.2