diff options
author | Sami Kerola | 2017-02-12 01:19:33 +0100 |
---|---|---|
committer | Karel Zak | 2017-02-20 12:58:49 +0100 |
commit | 2ba641e5f3879593e36fa84872289872a4060d03 (patch) | |
tree | 4381e82a91b01343555d803c8afe772e1d15826d /sys-utils | |
parent | misc: do not use plain 0 as NULL [smatch scan] (diff) | |
download | kernel-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 'sys-utils')
-rw-r--r-- | sys-utils/hwclock-cmos.c | 26 | ||||
-rw-r--r-- | sys-utils/hwclock.c | 2 | ||||
-rw-r--r-- | sys-utils/ipcs.c | 2 | ||||
-rw-r--r-- | sys-utils/lscpu.c | 12 | ||||
-rw-r--r-- | sys-utils/lsns.c | 4 | ||||
-rw-r--r-- | sys-utils/prlimit.c | 2 | ||||
-rw-r--r-- | sys-utils/renice.c | 2 | ||||
-rw-r--r-- | sys-utils/swapon.c | 2 |
8 files changed, 26 insertions, 26 deletions
diff --git a/sys-utils/hwclock-cmos.c b/sys-utils/hwclock-cmos.c index 013fe094d..4915471bd 100644 --- a/sys-utils/hwclock-cmos.c +++ b/sys-utils/hwclock-cmos.c @@ -66,12 +66,12 @@ # undef __i386__ # undef __x86_64__ # warning "disable cmos access - no sys/io.h or asm/io.h" -void outb(int a __attribute__((__unused__)), - int b __attribute__((__unused__))) +static void outb(int a __attribute__((__unused__)), + int b __attribute__((__unused__))) { } -int inb(int c __attribute__((__unused__))) +static int inb(int c __attribute__((__unused__))) { return 0; } @@ -117,7 +117,7 @@ static int inb(int c __attribute__((__unused__))) * like SRM.) It is reported that ALPHA_PRE_V1_2_SRM_CONSOLE uses 1958. */ #define TM_EPOCH 1900 -int cmos_epoch = 1900; +static int cmos_epoch = 1900; /* * Martin Ostermann writes: @@ -133,18 +133,18 @@ int cmos_epoch = 1900; * Jensen when USE_DEV_PORT was defined, but not with the normal inb/outb * functions. */ -int use_dev_port = 0; /* 1 for Jensen */ -int dev_port_fd; -unsigned short clock_ctl_addr = 0x70; /* 0x170 for Jensen */ -unsigned short clock_data_addr = 0x71; /* 0x171 for Jensen */ +static int use_dev_port = 0; /* 1 for Jensen */ +static int dev_port_fd; +static unsigned short clock_ctl_addr = 0x70; /* 0x170 for Jensen */ +static unsigned short clock_data_addr = 0x71; /* 0x171 for Jensen */ -int century_byte = 0; /* 0: don't access a century byte - * 50 (0x32): usual PC value - * 55 (0x37): PS/2 - */ +static int century_byte = 0; /* 0: don't access a century byte + * 50 (0x32): usual PC value + * 55 (0x37): PS/2 + */ #ifdef __alpha__ -int funkyTOY = 0; /* 1 for PC164/LX164/SX164 type alpha */ +static int funkyTOY = 0; /* 1 for PC164/LX164/SX164 type alpha */ #endif #ifdef __alpha diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c index 9fae9df23..21d1304e1 100644 --- a/sys-utils/hwclock.c +++ b/sys-utils/hwclock.c @@ -90,7 +90,7 @@ static int hwaudit_fd = -1; #endif /* The struct that holds our hardware access routines */ -struct clock_ops *ur; +static struct clock_ops *ur; /* Maximal clock adjustment in seconds per day. (adjtime() glibc call has 2145 seconds limit on i386, so it is good enough for us as well, diff --git a/sys-utils/ipcs.c b/sys-utils/ipcs.c index 6fab5b810..4f3d23d90 100644 --- a/sys-utils/ipcs.c +++ b/sys-utils/ipcs.c @@ -596,7 +596,7 @@ static void print_shm(int shmid, int unit) ipc_shm_free_info(shmdata); } -void print_msg(int msgid, int unit) +static void print_msg(int msgid, int unit) { struct msg_data *msgdata; diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c index 92ffba44a..683fd66f7 100644 --- a/sys-utils/lscpu.c +++ b/sys-utils/lscpu.c @@ -104,14 +104,14 @@ enum { VIRT_FULL, VIRT_CONT }; -const char *virt_types[] = { +static const char *virt_types[] = { [VIRT_NONE] = N_("none"), [VIRT_PARA] = N_("para"), [VIRT_FULL] = N_("full"), [VIRT_CONT] = N_("container"), }; -const char *hv_vendors[] = { +static const char *hv_vendors[] = { [HYPER_NONE] = NULL, [HYPER_XEN] = "Xen", [HYPER_KVM] = "KVM", @@ -130,7 +130,7 @@ const char *hv_vendors[] = { [HYPER_WSL] = "Windows Subsystem for Linux" }; -const int hv_vendor_pci[] = { +static const int hv_vendor_pci[] = { [HYPER_NONE] = 0x0000, [HYPER_XEN] = 0x5853, [HYPER_KVM] = 0x0000, @@ -139,7 +139,7 @@ const int hv_vendor_pci[] = { [HYPER_VBOX] = 0x80ee, }; -const int hv_graphics_pci[] = { +static const int hv_graphics_pci[] = { [HYPER_NONE] = 0x0000, [HYPER_XEN] = 0x0001, [HYPER_KVM] = 0x0000, @@ -169,7 +169,7 @@ enum { DISP_VERTICAL = 1 }; -const char *disp_modes[] = { +static const char *disp_modes[] = { [DISP_HORIZONTAL] = N_("horizontal"), [DISP_VERTICAL] = N_("vertical") }; @@ -188,7 +188,7 @@ struct polarization_modes { char *readable; }; -struct polarization_modes polar_modes[] = { +static struct polarization_modes polar_modes[] = { [POLAR_UNKNOWN] = {"U", "-"}, [POLAR_VLOW] = {"VL", "vert-low"}, [POLAR_VMEDIUM] = {"VM", "vert-medium"}, diff --git a/sys-utils/lsns.c b/sys-utils/lsns.c index 0c4ff449d..ecb0d8969 100644 --- a/sys-utils/lsns.c +++ b/sys-utils/lsns.c @@ -44,7 +44,7 @@ #include "debug.h" -UL_DEBUG_DEFINE_MASK(lsns); +static UL_DEBUG_DEFINE_MASK(lsns); UL_DEBUG_DEFINE_MASKNAMES(lsns) = UL_DEBUG_EMPTY_MASKNAMES; #define LSNS_DEBUG_INIT (1 << 1) @@ -55,7 +55,7 @@ UL_DEBUG_DEFINE_MASKNAMES(lsns) = UL_DEBUG_EMPTY_MASKNAMES; #define DBG(m, x) __UL_DBG(lsns, LSNS_DEBUG_, m, x) #define ON_DBG(m, x) __UL_DBG_CALL(lsns, LSNS_DEBUG_, m, x) -struct idcache *uid_cache = NULL; +static struct idcache *uid_cache = NULL; /* column IDs */ enum { diff --git a/sys-utils/prlimit.c b/sys-utils/prlimit.c index b4ad739ed..c96d38589 100644 --- a/sys-utils/prlimit.c +++ b/sys-utils/prlimit.c @@ -119,7 +119,7 @@ struct colinfo { }; /* columns descriptions */ -struct colinfo infos[] = { +static struct colinfo infos[] = { [COL_RES] = { "RESOURCE", 0.25, SCOLS_FL_TRUNC, N_("resource name") }, [COL_HELP] = { "DESCRIPTION", 0.1, SCOLS_FL_TRUNC, N_("resource description")}, [COL_SOFT] = { "SOFT", 0.1, SCOLS_FL_RIGHT, N_("soft limit")}, diff --git a/sys-utils/renice.c b/sys-utils/renice.c index 656a111da..bc6e3c849 100644 --- a/sys-utils/renice.c +++ b/sys-utils/renice.c @@ -48,7 +48,7 @@ #include "c.h" #include "closestream.h" -const char *idtype[] = { +static const char *idtype[] = { [PRIO_PROCESS] = N_("process ID"), [PRIO_PGRP] = N_("process group ID"), [PRIO_USER] = N_("user ID"), diff --git a/sys-utils/swapon.c b/sys-utils/swapon.c index d0ad6bb6f..f6005e67d 100644 --- a/sys-utils/swapon.c +++ b/sys-utils/swapon.c @@ -89,7 +89,7 @@ enum { COL_UUID, COL_LABEL }; -struct colinfo infos[] = { +static struct colinfo infos[] = { [COL_PATH] = { "NAME", 0.20, 0, N_("device file or partition path") }, [COL_TYPE] = { "TYPE", 0.20, SCOLS_FL_TRUNC, N_("type of the device")}, [COL_SIZE] = { "SIZE", 0.20, SCOLS_FL_RIGHT, N_("size of the swap area")}, |