treewide: unexport GPIOD_UNUSED
authorBartosz Golaszewski <bgolaszewski@baylibre.com>
Fri, 13 Nov 2020 13:20:12 +0000 (14:20 +0100)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Wed, 18 Nov 2020 08:33:58 +0000 (09:33 +0100)
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 <bgolaszewski@baylibre.com>
include/gpiod.h
tools/gpiomon.c
tools/gpioset.c
tools/tools-common.h

index 098321de60a909ed290857b4d54f316c4f964f3b..8513b7bf198d9f9d526fc0bc5b41a9b5187ec403 100644 (file)
@@ -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.
index 000b34b9358255e160a1a6a9e051e1566a260369..44fb431264587624ebece79d604d3c0d3175b98c 100644 (file)
@@ -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);
 }
index 82dfa71a40ad87adbc13d731eb2a4c3c69c8e73f..7f4615a5ca58ce4cb9f02034511676787bc30418 100644 (file)
@@ -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();
 }
index 9f1b801c2b510144839da86f8a0d1e6037bdf10e..8ccde62aa36958887f583e860a41be65655aecc9 100644 (file)
@@ -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)))