Skip to content

Commit

Permalink
Move UNUSED definition to common header utils.h
Browse files Browse the repository at this point in the history
Let's move UNUSED defition to avoid redundancy.

Signed-off-by: Giulio Benetti <[email protected]>
  • Loading branch information
giuliobenetti committed Jan 20, 2024
1 parent 65f50bf commit 3734b50
Show file tree
Hide file tree
Showing 23 changed files with 6 additions and 22 deletions.
1 change: 0 additions & 1 deletion src/plugins/btrfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ void bd_btrfs_close (void) {
}


#define UNUSED __attribute__((unused))

/**
* bd_btrfs_is_tech_avail:
Expand Down
1 change: 0 additions & 1 deletion src/plugins/crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
#define DEFAULT_LUKS2_SECTOR_SIZE 512
#endif

#define UNUSED __attribute__((unused))

/**
* SECTION: crypto
Expand Down
1 change: 0 additions & 1 deletion src/plugins/dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

#define DM_MIN_VERSION "1.02.93"

#define UNUSED __attribute__((unused))

/**
* SECTION: dm
Expand Down
1 change: 0 additions & 1 deletion src/plugins/fs/btrfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion src/plugins/fs/exfat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion src/plugins/fs/ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/plugins/fs/f2fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
1 change: 0 additions & 1 deletion src/plugins/fs/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
#include "ntfs.h"
#include "f2fs.h"

#define UNUSED __attribute__((unused))


typedef enum {
Expand Down
1 change: 0 additions & 1 deletion src/plugins/fs/nilfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
Expand Down
1 change: 0 additions & 1 deletion src/plugins/fs/ntfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion src/plugins/fs/udf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion src/plugins/fs/vfat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
Expand Down
1 change: 0 additions & 1 deletion src/plugins/fs/xfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
Expand Down
1 change: 0 additions & 1 deletion src/plugins/loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ void bd_loop_close (void) {
/* nothing to do here */
}

#define UNUSED __attribute__((unused))

/**
* bd_loop_is_tech_avail:
Expand Down
1 change: 0 additions & 1 deletion src/plugins/lvm-dbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 0 additions & 1 deletion src/plugins/lvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion src/plugins/mdraid.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ void bd_md_close (void) {
/* nothing to do here */
}

#define UNUSED __attribute__((unused))

/**
* bd_md_is_tech_avail:
Expand Down
1 change: 0 additions & 1 deletion src/plugins/nvdimm.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ void bd_nvdimm_close (void) {
return;
}

#define UNUSED __attribute__((unused))

/**
* bd_nvdimm_is_tech_avail:
Expand Down
1 change: 0 additions & 1 deletion src/plugins/part.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ static gint log2i (guint x) {
return ret;
}

#define UNUSED __attribute__((unused))

/**
* get_part_num: (skip)
Expand Down
1 change: 0 additions & 1 deletion src/plugins/swap.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ void bd_swap_close (void) {
/* nothing to do here */
}

#define UNUSED __attribute__((unused))

/**
* bd_swap_is_tech_avail:
Expand Down
2 changes: 1 addition & 1 deletion src/utils/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include "utils.h"

#ifdef __clang__
#define ZERO_INIT {}
#else
#define ZERO_INIT {0}
#endif

#define UNUSED __attribute__((unused))

extern char **environ;

Expand Down
2 changes: 1 addition & 1 deletion src/utils/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
#include <syslog.h>
#include <locale.h>
#include <sys/utsname.h>
#include "utils.h"

#include "module.h"
#include "exec.h"
#include "logging.h"

#define UNUSED __attribute__((unused))

/**
* bd_utils_module_error_quark: (skip)
Expand Down
4 changes: 4 additions & 0 deletions src/utils/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3734b50

Please sign in to comment.