Fix declarations of non-global variables

This patch inserts the `static` keyword to non-global variables,
which where found by the analysis tool smatch.

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tino Reichardt <milky-zfs@mcmilk.de>
Closes #13970
This commit is contained in:
Tino Reichardt
2022-10-18 20:05:32 +02:00
committed by GitHub
parent ab49df487b
commit 27218a32fc
17 changed files with 58 additions and 57 deletions
+1 -1
View File
@@ -37,7 +37,7 @@
#endif
#define MAX_HRTIMEOUT_SLACK_US 1000
unsigned int spl_schedule_hrtimeout_slack_us = 0;
static unsigned int spl_schedule_hrtimeout_slack_us = 0;
static int
param_set_hrtimeout_slack(const char *buf, zfs_kernel_param_t *kp)
+1 -1
View File
@@ -32,7 +32,7 @@
* analysis and other such goodies.
* But we would still default to the current default of not to do that.
*/
unsigned int spl_panic_halt;
static unsigned int spl_panic_halt;
/* CSTYLED */
module_param(spl_panic_halt, uint, 0644);
MODULE_PARM_DESC(spl_panic_halt, "Cause kernel panic on assertion failures");
+1 -1
View File
@@ -90,7 +90,7 @@ EXPORT_SYMBOL(p0);
* and use them when in_interrupt() from linux/preempt_mask.h evaluates to
* true.
*/
void __percpu *spl_pseudo_entropy;
static void __percpu *spl_pseudo_entropy;
/*
* spl_rand_next()/spl_rand_jump() are copied from the following CC-0 licensed
+1 -1
View File
@@ -151,7 +151,7 @@ MODULE_PARM_DESC(spl_kmem_cache_kmem_threads,
struct list_head spl_kmem_cache_list; /* List of caches */
struct rw_semaphore spl_kmem_cache_sem; /* Cache list lock */
taskq_t *spl_kmem_cache_taskq; /* Task queue for aging / reclaim */
static taskq_t *spl_kmem_cache_taskq; /* Task queue for aging / reclaim */
static void spl_cache_shrink(spl_kmem_cache_t *skc, void *obj);
+1 -1
View File
@@ -132,7 +132,7 @@ static abd_stats_t abd_stats = {
{ "scatter_sg_table_retry", KSTAT_DATA_UINT64 },
};
struct {
static struct {
wmsum_t abdstat_struct_size;
wmsum_t abdstat_linear_cnt;
wmsum_t abdstat_linear_data_size;
+1 -1
View File
@@ -35,7 +35,7 @@ typedef struct zfs_dbgmsg {
static procfs_list_t zfs_dbgmsgs;
static uint_t zfs_dbgmsg_size = 0;
uint_t zfs_dbgmsg_maxsize = 4<<20; /* 4MB */
static uint_t zfs_dbgmsg_maxsize = 4<<20; /* 4MB */
/*
* Internal ZFS debug messages are enabled by default.
+1 -1
View File
@@ -114,7 +114,7 @@ struct zvol_state_os {
boolean_t use_blk_mq;
};
taskq_t *zvol_taskq;
static taskq_t *zvol_taskq;
static struct ida zvol_ida;
typedef struct zv_request_stack {