From 87531054fd9898a0d75a13f09f20edc57c203e4e Mon Sep 17 00:00:00 2001 From: Giulio Benetti Date: Sat, 20 Jan 2024 13:26:13 +0100 Subject: [PATCH] Move UNUSED definition to common header utils.h Let's move UNUSED defition to avoid redundancy. Signed-off-by: Giulio Benetti --- src/plugins/btrfs.c | 1 - src/plugins/crypto.c | 1 - src/plugins/dm.c | 1 - src/plugins/fs/btrfs.c | 1 - src/plugins/fs/exfat.c | 1 - src/plugins/fs/ext.c | 1 - src/plugins/fs/f2fs.c | 1 - src/plugins/fs/generic.c | 1 - src/plugins/fs/nilfs.c | 1 - src/plugins/fs/ntfs.c | 1 - src/plugins/fs/udf.c | 1 - src/plugins/fs/vfat.c | 1 - src/plugins/fs/xfs.c | 1 - src/plugins/loop.c | 1 - src/plugins/lvm-dbus.c | 1 - src/plugins/lvm.c | 1 - src/plugins/mdraid.c | 1 - src/plugins/nvdimm.c | 1 - src/plugins/part.c | 1 - src/plugins/swap.c | 1 - src/utils/exec.c | 2 +- src/utils/module.c | 2 +- src/utils/utils.h | 4 ++++ 23 files changed, 6 insertions(+), 22 deletions(-) diff --git a/src/plugins/btrfs.c b/src/plugins/btrfs.c index 809e3947c..2b93316eb 100644 --- a/src/plugins/btrfs.c +++ b/src/plugins/btrfs.c @@ -154,7 +154,6 @@ void bd_btrfs_close (void) { } -#define UNUSED __attribute__((unused)) /** * bd_btrfs_is_tech_avail: diff --git a/src/plugins/crypto.c b/src/plugins/crypto.c index 5120ec57a..830010aba 100644 --- a/src/plugins/crypto.c +++ b/src/plugins/crypto.c @@ -60,7 +60,6 @@ #define DEFAULT_LUKS2_SECTOR_SIZE 512 #endif -#define UNUSED __attribute__((unused)) /** * SECTION: crypto diff --git a/src/plugins/dm.c b/src/plugins/dm.c index 98b570a34..02302f1dd 100644 --- a/src/plugins/dm.c +++ b/src/plugins/dm.c @@ -30,7 +30,6 @@ #define DM_MIN_VERSION "1.02.93" -#define UNUSED __attribute__((unused)) /** * SECTION: dm diff --git a/src/plugins/fs/btrfs.c b/src/plugins/fs/btrfs.c index 3f8567ef0..83dda2289 100644 --- a/src/plugins/fs/btrfs.c +++ b/src/plugins/fs/btrfs.c @@ -57,7 +57,6 @@ static guint32 fs_mode_util[BD_FS_MODE_LAST+1] = { DEPS_BTRFSTUNE_MASK, /* set-uuid */ }; -#define UNUSED __attribute__((unused)) /** * bd_fs_btrfs_is_tech_avail: diff --git a/src/plugins/fs/exfat.c b/src/plugins/fs/exfat.c index 7092f9dcd..53ea38938 100644 --- a/src/plugins/fs/exfat.c +++ b/src/plugins/fs/exfat.c @@ -63,7 +63,6 @@ static guint32 fs_mode_util[BD_FS_MODE_LAST+1] = { #define CLUSTERS_PREFIX_LEN 25 -#define UNUSED __attribute__((unused)) /** * bd_fs_exfat_is_tech_avail: diff --git a/src/plugins/fs/ext.c b/src/plugins/fs/ext.c index 87a8787e2..198c59b64 100644 --- a/src/plugins/fs/ext.c +++ b/src/plugins/fs/ext.c @@ -63,7 +63,6 @@ static guint32 fs_mode_util[BD_FS_MODE_LAST+1] = { DEPS_TUNE2FS_MASK /* set-uuid */ }; -#define UNUSED __attribute__((unused)) static gint8 compute_percents (guint8 pass_cur, guint8 pass_total, gint val_cur, gint val_total) { gint perc; diff --git a/src/plugins/fs/f2fs.c b/src/plugins/fs/f2fs.c index 20df63a44..83c930d21 100644 --- a/src/plugins/fs/f2fs.c +++ b/src/plugins/fs/f2fs.c @@ -70,7 +70,6 @@ static guint32 fs_mode_util[BD_FS_MODE_LAST+1] = { 0 /* set-uuid */ }; -#define UNUSED __attribute__((unused)) /* option to get version was added in 1.11.0 so we need to cover situation where the version is too old to check the version */ diff --git a/src/plugins/fs/generic.c b/src/plugins/fs/generic.c index add470123..7bc80b2a2 100644 --- a/src/plugins/fs/generic.c +++ b/src/plugins/fs/generic.c @@ -40,7 +40,6 @@ #include "ntfs.h" #include "f2fs.h" -#define UNUSED __attribute__((unused)) typedef enum { diff --git a/src/plugins/fs/nilfs.c b/src/plugins/fs/nilfs.c index aec41af88..92ec39974 100644 --- a/src/plugins/fs/nilfs.c +++ b/src/plugins/fs/nilfs.c @@ -54,7 +54,6 @@ static guint32 fs_mode_util[BD_FS_MODE_LAST+1] = { DEPS_NILFSTUNE_MASK, /* set-uuid */ }; -#define UNUSED __attribute__((unused)) #ifdef __clang__ #define ZERO_INIT {} diff --git a/src/plugins/fs/ntfs.c b/src/plugins/fs/ntfs.c index f7c49773b..66ea78a86 100644 --- a/src/plugins/fs/ntfs.c +++ b/src/plugins/fs/ntfs.c @@ -61,7 +61,6 @@ static guint32 fs_mode_util[BD_FS_MODE_LAST+1] = { DEPS_NTFSLABEL_MASK /* set-uuid */ }; -#define UNUSED __attribute__((unused)) /** * bd_fs_ntfs_is_tech_avail: diff --git a/src/plugins/fs/udf.c b/src/plugins/fs/udf.c index 787bea0d7..b22d98c73 100644 --- a/src/plugins/fs/udf.c +++ b/src/plugins/fs/udf.c @@ -60,7 +60,6 @@ static guint32 fs_mode_util[BD_FS_MODE_LAST+1] = { DEPS_UDFLABEL_MASK, /* set-uuid */ }; -#define UNUSED __attribute__((unused)) /** * bd_fs_udf_is_tech_avail: diff --git a/src/plugins/fs/vfat.c b/src/plugins/fs/vfat.c index 3f3024ffa..97390c58d 100644 --- a/src/plugins/fs/vfat.c +++ b/src/plugins/fs/vfat.c @@ -63,7 +63,6 @@ static guint32 fs_mode_util[BD_FS_MODE_LAST+1] = { DEPS_FATLABELUUID_MASK, /* set-uuid */ }; -#define UNUSED __attribute__((unused)) #ifdef __clang__ #define ZERO_INIT {} diff --git a/src/plugins/fs/xfs.c b/src/plugins/fs/xfs.c index c73eb69f7..0429fd824 100644 --- a/src/plugins/fs/xfs.c +++ b/src/plugins/fs/xfs.c @@ -61,7 +61,6 @@ static guint32 fs_mode_util[BD_FS_MODE_LAST+1] = { DEPS_XFS_ADMIN_MASK /* set-uuid */ }; -#define UNUSED __attribute__((unused)) #ifdef __clang__ #define ZERO_INIT {} diff --git a/src/plugins/loop.c b/src/plugins/loop.c index c7b6bb99c..6407a383a 100644 --- a/src/plugins/loop.c +++ b/src/plugins/loop.c @@ -75,7 +75,6 @@ void bd_loop_close (void) { /* nothing to do here */ } -#define UNUSED __attribute__((unused)) /** * bd_loop_is_tech_avail: diff --git a/src/plugins/lvm-dbus.c b/src/plugins/lvm-dbus.c index 01adbea49..dae059fb5 100644 --- a/src/plugins/lvm-dbus.c +++ b/src/plugins/lvm-dbus.c @@ -97,7 +97,6 @@ static gchar *global_devices_str = NULL; #define METHOD_CALL_TIMEOUT 5000 #define PROGRESS_WAIT 500 * 1000 /* microseconds */ -#define UNUSED __attribute__((unused)) static GDBusConnection *bus = NULL; diff --git a/src/plugins/lvm.c b/src/plugins/lvm.c index 361a084bd..439392e2e 100644 --- a/src/plugins/lvm.c +++ b/src/plugins/lvm.c @@ -331,7 +331,6 @@ static const UtilFeatureDep features[FEATURES_LAST] = { static const gchar*const module_deps[MODULE_DEPS_LAST] = { "kvdo" }; -#define UNUSED __attribute__((unused)) /** * bd_lvm_init: diff --git a/src/plugins/mdraid.c b/src/plugins/mdraid.c index 53b7eb48f..b6f64cef6 100644 --- a/src/plugins/mdraid.c +++ b/src/plugins/mdraid.c @@ -179,7 +179,6 @@ void bd_md_close (void) { /* nothing to do here */ } -#define UNUSED __attribute__((unused)) /** * bd_md_is_tech_avail: diff --git a/src/plugins/nvdimm.c b/src/plugins/nvdimm.c index dd52b8565..3bb3204f3 100644 --- a/src/plugins/nvdimm.c +++ b/src/plugins/nvdimm.c @@ -109,7 +109,6 @@ void bd_nvdimm_close (void) { return; } -#define UNUSED __attribute__((unused)) /** * bd_nvdimm_is_tech_avail: diff --git a/src/plugins/part.c b/src/plugins/part.c index 20bb3628a..164200c77 100644 --- a/src/plugins/part.c +++ b/src/plugins/part.c @@ -122,7 +122,6 @@ static gint log2i (guint x) { return ret; } -#define UNUSED __attribute__((unused)) /** * get_part_num: (skip) diff --git a/src/plugins/swap.c b/src/plugins/swap.c index d9b0f7bad..cd1acfd89 100644 --- a/src/plugins/swap.c +++ b/src/plugins/swap.c @@ -87,7 +87,6 @@ void bd_swap_close (void) { /* nothing to do here */ } -#define UNUSED __attribute__((unused)) /** * bd_swap_is_tech_avail: diff --git a/src/utils/exec.c b/src/utils/exec.c index 4acaeab30..28e7ef944 100644 --- a/src/utils/exec.c +++ b/src/utils/exec.c @@ -28,6 +28,7 @@ #include #include #include +#include "utils.h #ifdef __clang__ #define ZERO_INIT {} @@ -35,7 +36,6 @@ #define ZERO_INIT {0} #endif -#define UNUSED __attribute__((unused)) extern char **environ; diff --git a/src/utils/module.c b/src/utils/module.c index 6557c3ab6..e29f2c824 100644 --- a/src/utils/module.c +++ b/src/utils/module.c @@ -24,12 +24,12 @@ #include #include #include +#include "utils.h" #include "module.h" #include "exec.h" #include "logging.h" -#define UNUSED __attribute__((unused)) /** * bd_utils_module_error_quark: (skip) diff --git a/src/utils/utils.h b/src/utils/utils.h index 801a8b6e3..6df11bbf6 100644 --- a/src/utils/utils.h +++ b/src/utils/utils.h @@ -9,6 +9,10 @@ #include "dbus.h" #include "logging.h" +#ifndef UNUSED +#define UNUSED __attribute__((unused)) +#endif + /** * SECTION: utils * @short_description: library providing utility functions used by the blockdev library and its plugins