summaryrefslogtreecommitdiffstats
path: root/disk-utils
diff options
context:
space:
mode:
authorSami Kerola2017-02-12 01:19:33 +0100
committerKarel Zak2017-02-20 12:58:49 +0100
commit2ba641e5f3879593e36fa84872289872a4060d03 (patch)
tree4381e82a91b01343555d803c8afe772e1d15826d /disk-utils
parentmisc: do not use plain 0 as NULL [smatch scan] (diff)
downloadkernel-qcow2-util-linux-2ba641e5f3879593e36fa84872289872a4060d03.tar.gz
kernel-qcow2-util-linux-2ba641e5f3879593e36fa84872289872a4060d03.tar.xz
kernel-qcow2-util-linux-2ba641e5f3879593e36fa84872289872a4060d03.zip
misc: add static keyword to where needed [smatch scan]
text-utils/rev.c:68:9: warning: symbol 'buf' was not declared. Should it be static? Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'disk-utils')
-rw-r--r--disk-utils/cfdisk.c6
-rw-r--r--disk-utils/fdformat.c2
-rw-r--r--disk-utils/fdisk-menu.c16
-rw-r--r--disk-utils/fsck.c2
-rw-r--r--disk-utils/fsck.cramfs.c4
-rw-r--r--disk-utils/partx.c4
-rw-r--r--disk-utils/raw.c8
-rw-r--r--disk-utils/sfdisk.c2
8 files changed, 22 insertions, 22 deletions
diff --git a/disk-utils/cfdisk.c b/disk-utils/cfdisk.c
index 4ad52842c..f06dad1c8 100644
--- a/disk-utils/cfdisk.c
+++ b/disk-utils/cfdisk.c
@@ -150,8 +150,8 @@ static int ui_resize;
/* ncurses LINES and COLS may be actual variables or *macros*, but we need
* something portable and writable */
-size_t ui_lines;
-size_t ui_cols;
+static size_t ui_lines;
+static size_t ui_cols;
/* menu item */
struct cfdisk_menuitem {
@@ -245,7 +245,7 @@ struct cfdisk {
/*
* let's use include/debug.h stuff for cfdisk too
*/
-UL_DEBUG_DEFINE_MASK(cfdisk);
+static UL_DEBUG_DEFINE_MASK(cfdisk);
UL_DEBUG_DEFINE_MASKNAMES(cfdisk) = UL_DEBUG_EMPTY_MASKNAMES;
#define CFDISK_DEBUG_INIT (1 << 1)
diff --git a/disk-utils/fdformat.c b/disk-utils/fdformat.c
index ad6b62b50..142bca0ec 100644
--- a/disk-utils/fdformat.c
+++ b/disk-utils/fdformat.c
@@ -20,7 +20,7 @@
#define SECTOR_SIZE 512
-struct floppy_struct param;
+static struct floppy_struct param;
static void format_begin(int ctrl)
diff --git a/disk-utils/fdisk-menu.c b/disk-utils/fdisk-menu.c
index baac9791a..9ab28c43f 100644
--- a/disk-utils/fdisk-menu.c
+++ b/disk-utils/fdisk-menu.c
@@ -89,7 +89,7 @@ DECLARE_MENU_CB(generic_menu_cb);
#define MENU_XENT_NEST(k, t, l, p) { .title = t, .key = k, .expert = 1, .label = l, .parent = p }
/* Generic menu */
-struct menu menu_generic = {
+static const struct menu menu_generic = {
.callback = generic_menu_cb,
.entries = {
MENU_BSEP(N_("Generic")),
@@ -127,7 +127,7 @@ struct menu menu_generic = {
}
};
-struct menu menu_createlabel = {
+static const struct menu menu_createlabel = {
.callback = createlabel_menu_cb,
.exclude = FDISK_DISKLABEL_BSD,
.nonested = 1,
@@ -145,7 +145,7 @@ struct menu menu_createlabel = {
}
};
-struct menu menu_geo = {
+static const struct menu menu_geo = {
.callback = geo_menu_cb,
.exclude = FDISK_DISKLABEL_GPT | FDISK_DISKLABEL_BSD,
.entries = {
@@ -157,7 +157,7 @@ struct menu menu_geo = {
}
};
-struct menu menu_gpt = {
+static const struct menu menu_gpt = {
.callback = gpt_menu_cb,
.label = FDISK_DISKLABEL_GPT,
.entries = {
@@ -178,7 +178,7 @@ struct menu menu_gpt = {
}
};
-struct menu menu_sun = {
+static const struct menu menu_sun = {
.callback = sun_menu_cb,
.label = FDISK_DISKLABEL_SUN,
.entries = {
@@ -195,7 +195,7 @@ struct menu menu_sun = {
}
};
-struct menu menu_sgi = {
+static const struct menu menu_sgi = {
.callback = sgi_menu_cb,
.label = FDISK_DISKLABEL_SGI,
.entries = {
@@ -208,7 +208,7 @@ struct menu menu_sgi = {
}
};
-struct menu menu_dos = {
+static const struct menu menu_dos = {
.callback = dos_menu_cb,
.label = FDISK_DISKLABEL_DOS,
.entries = {
@@ -226,7 +226,7 @@ struct menu menu_dos = {
}
};
-struct menu menu_bsd = {
+static const struct menu menu_bsd = {
.callback = bsd_menu_cb,
.label = FDISK_DISKLABEL_BSD,
.entries = {
diff --git a/disk-utils/fsck.c b/disk-utils/fsck.c
index 93296c97d..cb1b21278 100644
--- a/disk-utils/fsck.c
+++ b/disk-utils/fsck.c
@@ -931,7 +931,7 @@ err:
/*
* Deal with the fsck -t argument.
*/
-struct fs_type_compile {
+static struct fs_type_compile {
char **list;
int *type;
int negate;
diff --git a/disk-utils/fsck.cramfs.c b/disk-utils/fsck.cramfs.c
index 81e17be27..63033d626 100644
--- a/disk-utils/fsck.cramfs.c
+++ b/disk-utils/fsck.cramfs.c
@@ -69,11 +69,11 @@
static int fd; /* ROM image file descriptor */
static char *filename; /* ROM image filename */
-struct cramfs_super super; /* just find the cramfs superblock once */
+static struct cramfs_super super; /* just find the cramfs superblock once */
static int cramfs_is_big_endian = 0; /* source is big endian */
static int opt_verbose = 0; /* 1 = verbose (-v), 2+ = very verbose (-vv) */
static int opt_extract = 0; /* extract cramfs (-x) */
-char *extract_dir = ""; /* optional extraction directory (-x) */
+static char *extract_dir = ""; /* optional extraction directory (-x) */
#define PAD_SIZE 512
diff --git a/disk-utils/partx.c b/disk-utils/partx.c
index d1964b458..a0e337b78 100644
--- a/disk-utils/partx.c
+++ b/disk-utils/partx.c
@@ -82,7 +82,7 @@ struct colinfo {
};
/* columns descriptions */
-struct colinfo infos[] = {
+static struct colinfo infos[] = {
[COL_PARTNO] = { "NR", 0.25, SCOLS_FL_RIGHT, N_("partition number") },
[COL_START] = { "START", 0.30, SCOLS_FL_RIGHT, N_("start of the partition in sectors") },
[COL_END] = { "END", 0.30, SCOLS_FL_RIGHT, N_("end of the partition in sectors") },
@@ -99,7 +99,7 @@ struct colinfo infos[] = {
/* array with IDs of enabled columns */
static int columns[NCOLS];
-size_t ncolumns;
+static size_t ncolumns;
static int verbose;
static int partx_flags;
diff --git a/disk-utils/raw.c b/disk-utils/raw.c
index d5c2a681f..395e36703 100644
--- a/disk-utils/raw.c
+++ b/disk-utils/raw.c
@@ -32,11 +32,11 @@
#define RAW_NR_MINORS 8192
-int do_query;
-int do_query_all;
+static int do_query;
+static int do_query_all;
-int master_fd;
-int raw_minor;
+static int master_fd;
+static int raw_minor;
void open_raw_ctl(void);
static int query(int minor_raw, const char *raw_name, int quiet);
diff --git a/disk-utils/sfdisk.c b/disk-utils/sfdisk.c
index b304acb53..f4f9b6b1a 100644
--- a/disk-utils/sfdisk.c
+++ b/disk-utils/sfdisk.c
@@ -55,7 +55,7 @@
/*
* sfdisk debug stuff (see fdisk.h and include/debug.h)
*/
-UL_DEBUG_DEFINE_MASK(sfdisk);
+static UL_DEBUG_DEFINE_MASK(sfdisk);
UL_DEBUG_DEFINE_MASKNAMES(sfdisk) = UL_DEBUG_EMPTY_MASKNAMES;
#define SFDISKPROG_DEBUG_INIT (1 << 1)