[PATCH ibdiags 09/16] ibdiags: Add missing static to variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jason Gunthorpe <jgg@xxxxxxxxxxxx>

Found by sparse. Also drop redundant = 0's for global values.

Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxxxx>
---
 libibnetdisc/src/chassis.c    | 50 +++++++++++++++++------------------
 libibnetdisc/test/testleaks.c |  2 +-
 src/dump_fts.c                |  6 ++---
 src/ibaddr.c                  |  2 +-
 src/ibcacheedit.c             | 32 +++++++++++-----------
 src/ibccconfig.c              |  4 +--
 src/ibccquery.c               |  4 +--
 src/ibping.c                  |  2 +-
 src/ibportstate.c             | 30 ++++++++++-----------
 src/ibqueryerrors.c           | 30 ++++++++++-----------
 src/ibroute.c                 |  4 +--
 src/ibsendtrap.c              |  4 +--
 src/ibsysstat.c               |  2 +-
 src/ibtracert.c               |  6 ++---
 src/mcm_rereg_test.c          |  2 +-
 src/perfquery.c               |  6 ++---
 src/saquery.c                 | 12 ++++-----
 src/sminfo.c                  |  6 ++---
 src/smpquery.c                |  2 +-
 src/vendstat.c                |  2 +-
 20 files changed, 103 insertions(+), 105 deletions(-)

diff --git a/libibnetdisc/src/chassis.c b/libibnetdisc/src/chassis.c
index 5e0d0550c539fc..63eacf434a663d 100644
--- a/libibnetdisc/src/chassis.c
+++ b/libibnetdisc/src/chassis.c
@@ -355,120 +355,120 @@ static int is_line(ibnd_node_t * n)
 }
 
 /* these structs help find Line (Anafa) slot number while using spine portnum */
-char line_slot_2_sfb4[37] = {
+static const char line_slot_2_sfb4[37] = {
 	0,
 	1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3,
 	4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 };
-char anafa_line_slot_2_sfb4[37] = {
+static const char anafa_line_slot_2_sfb4[37] = {
 	0,
 	1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2,
 	1, 1, 1, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 };
 
-char line_slot_2_sfb12[37] = {
+static const char line_slot_2_sfb12[37] = {
 	0,
 	1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9,
 	10, 10, 11, 11, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 };
-char anafa_line_slot_2_sfb12[37] = {
+static const char anafa_line_slot_2_sfb12[37] = {
 	0,
 	1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2,
 	1, 2, 1, 2, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 };
 
 /* LB slot = table[spine port] */
-char line_slot_2_sfb18[37] = {
+static const char line_slot_2_sfb18[37] = {
 	0,
 	1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9,
 	10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18};
 /* LB asic num = table[spine port] */
-char anafa_line_slot_2_sfb18[37] = {
+static const char anafa_line_slot_2_sfb18[37] = {
 	0,
 	1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
 	1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
 };
 
 /* LB slot = table[spine port] */
-char line_slot_2_sfb18x2[37] = {
+static const char line_slot_2_sfb18x2[37] = {
 	0,
 	1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
 	0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0,  0,  0,  0,  0,  0,  0};
 /* LB asic num = table[spine port] */
-char anafa_line_slot_2_sfb18x2[37] = {
+static const char anafa_line_slot_2_sfb18x2[37] = {
 	0,
 	1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 };
 
 /* LB slot = table[spine port] */
-char line_slot_2_sfb4200[37] = {
+static const char line_slot_2_sfb4200[37] = {
 	0,
 	1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5,
 	5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9};
 /* LB asic num = table[spine port] */
-char anafa_line_slot_2_sfb4200[37] = {
+static const char anafa_line_slot_2_sfb4200[37] = {
 	0,
 	1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
 	1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
 };
 
 /* IPR FCR modules connectivity while using sFB4 port as reference */
-char ipr_slot_2_sfb4_port[37] = {
+static const char ipr_slot_2_sfb4_port[37] = {
 	0,
 	3, 2, 1, 3, 2, 1, 3, 2, 1, 3, 2, 1, 3, 2, 1, 3, 2, 1,
 	3, 2, 1, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 };
 
 /* these structs help find Spine (Anafa) slot number while using spine portnum */
-char spine12_slot_2_slb[37] = {
+static const char spine12_slot_2_slb[37] = {
 	0,
 	1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 0, 0, 0, 0, 0, 0,
 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 };
-char anafa_spine12_slot_2_slb[37] = {
+static const char anafa_spine12_slot_2_slb[37] = {
 	0,
 	1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 0, 0, 0, 0, 0, 0,
 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 };
 
-char spine4_slot_2_slb[37] = {
+static const char spine4_slot_2_slb[37] = {
 	0,
 	1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 0, 0, 0, 0, 0, 0,
 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 };
-char anafa_spine4_slot_2_slb[37] = {
+static const char anafa_spine4_slot_2_slb[37] = {
 	0,
 	1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 };
 
 /* FB slot = table[line port] */
-char spine18_slot_2_slb[37] = {
+static const char spine18_slot_2_slb[37] = {
 	0,
 	1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9,
 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 };
 /* FB asic = table[line port] */
-char anafa_spine18_slot_2_slb[37] = {
+static const char anafa_spine18_slot_2_slb[37] = {
 	0,
 	1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 };
-char anafa_spine18x2_slot_2_slb[37] = {
+static const char anafa_spine18x2_slot_2_slb[37] = {
 	0,
 	2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1,
 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 };
 
 /* FB slot = table[line port] */
-char sfb4200_slot_2_slb[37] = {
+static const char sfb4200_slot_2_slb[37] = {
 	0,
 	1, 1, 1, 1, 0, 0, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4,
 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 };
 /* FB asic = table[line port] */
-char anafa_sfb4200_slot_2_slb[37] = {
+static const char anafa_sfb4200_slot_2_slb[37] = {
 	0,
 	1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
@@ -1111,34 +1111,34 @@ A2 int port | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
 
 */
 
-int int2ext_map_slb24[2][25] = {
+static int int2ext_map_slb24[2][25] = {
 	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 5, 4, 18, 17, 16, 1, 2, 3,
 	 13, 14, 15},
 	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 11, 10, 24, 23, 22, 7, 8, 9,
 	 19, 20, 21}
 };
 
-int int2ext_map_slb8[2][25] = {
+static int int2ext_map_slb8[2][25] = {
 	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 6, 6, 6, 1, 1, 1, 5, 5,
 	 5},
 	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 8, 8, 8, 3, 3, 3, 7, 7,
 	 7}
 };
 
-int int2ext_map_slb2024[2][25] = {
+static int int2ext_map_slb2024[2][25] = {
 	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 14, 15, 16, 17, 18, 19, 20,
 	 21, 22, 23, 24},
 	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
 	 11, 12}
 };
 
-int int2ext_map_slb4018[37] = {
+static int int2ext_map_slb4018[37] = {
 	0,
 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 	1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18
 };
 
-int int2ext_map_sfb4700x2[2][37] = {
+static int int2ext_map_sfb4700x2[2][37] = {
 	{0,
 	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 	 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12},
diff --git a/libibnetdisc/test/testleaks.c b/libibnetdisc/test/testleaks.c
index 84c2b76558c328..35157e0ba6d420 100644
--- a/libibnetdisc/test/testleaks.c
+++ b/libibnetdisc/test/testleaks.c
@@ -51,7 +51,7 @@
 #include <infiniband/complib/cl_nodenamemap.h>
 #include <infiniband/ibnetdisc.h>
 
-const char *argv0 = "iblinkinfotest";
+static const char *argv0 = "iblinkinfotest";
 static FILE *f;
 
 static void usage(void)
diff --git a/src/dump_fts.c b/src/dump_fts.c
index b22282b4935bfe..199403ab392f64 100644
--- a/src/dump_fts.c
+++ b/src/dump_fts.c
@@ -53,9 +53,9 @@
 
 #include "ibdiag_common.h"
 
-struct ibmad_port *srcport;
+static struct ibmad_port *srcport;
 
-unsigned startlid = 0, endlid = 0;
+static unsigned startlid, endlid;
 
 static int brief, dump_all, multicast;
 
@@ -107,7 +107,7 @@ static int dump_mlid(char *str, int strlen, unsigned mlid, unsigned nports,
 	return i * 2;
 }
 
-uint16_t mft[16][IB_MLIDS_IN_BLOCK] = { { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0}, { 0 }, { 0 } };
+static uint16_t mft[16][IB_MLIDS_IN_BLOCK];
 
 static void dump_multicast_tables(ibnd_node_t *node, unsigned startl,
 				  unsigned endl, struct ibmad_port *mad_port)
diff --git a/src/ibaddr.c b/src/ibaddr.c
index c13f3bfc5c7976..509f0feab6981d 100644
--- a/src/ibaddr.c
+++ b/src/ibaddr.c
@@ -46,7 +46,7 @@
 
 #include "ibdiag_common.h"
 
-struct ibmad_port *srcport;
+static struct ibmad_port *srcport;
 
 static int ib_resolve_addr(ib_portid_t * portid, int portnum, int show_lid,
 			   int show_gid)
diff --git a/src/ibcacheedit.c b/src/ibcacheedit.c
index e8dc244e051f77..6e04efc7575d68 100644
--- a/src/ibcacheedit.c
+++ b/src/ibcacheedit.c
@@ -46,22 +46,22 @@
 
 #include "ibdiag_common.h"
 
-uint64_t switchguid_before = 0;
-uint64_t switchguid_after = 0;
-int switchguid_flag = 0;
-
-uint64_t caguid_before = 0;
-uint64_t caguid_after = 0;
-int caguid_flag = 0;
-
-uint64_t sysimgguid_before = 0;
-uint64_t sysimgguid_after = 0;
-int sysimgguid_flag = 0;
-
-uint64_t portguid_nodeguid = 0;
-uint64_t portguid_before = 0;
-uint64_t portguid_after = 0;
-int portguid_flag = 0;
+static uint64_t switchguid_before;
+static uint64_t switchguid_after;
+static int switchguid_flag;
+
+static uint64_t caguid_before;
+static uint64_t caguid_after;
+static int caguid_flag;
+
+static uint64_t sysimgguid_before;
+static uint64_t sysimgguid_after;
+static int sysimgguid_flag;
+
+static uint64_t portguid_nodeguid;
+static uint64_t portguid_before;
+static uint64_t portguid_after;
+static int portguid_flag;
 
 struct guids {
 	uint64_t searchguid;
diff --git a/src/ibccconfig.c b/src/ibccconfig.c
index 54a501ee6cc910..a256ceaa6f3949 100644
--- a/src/ibccconfig.c
+++ b/src/ibccconfig.c
@@ -53,7 +53,7 @@
 
 #include "ibdiag_common.h"
 
-struct ibmad_port *srcport;
+static struct ibmad_port *srcport;
 
 static op_fn_t congestion_key_info;
 static op_fn_t switch_congestion_setting;
@@ -77,7 +77,7 @@ static const match_rec_t match_tbl[] = {
 	{0}
 };
 
-uint64_t cckey = 0;
+static uint64_t cckey;
 
 /*******************************************/
 static const char *parselonglongint(char *arg, uint64_t *val)
diff --git a/src/ibccquery.c b/src/ibccquery.c
index 0882983c2ddeac..a80cd01bdea5f5 100644
--- a/src/ibccquery.c
+++ b/src/ibccquery.c
@@ -50,7 +50,7 @@
 
 #include "ibdiag_common.h"
 
-struct ibmad_port *srcport;
+static struct ibmad_port *srcport;
 
 static op_fn_t class_port_info;
 static op_fn_t congestion_info;
@@ -75,7 +75,7 @@ static const match_rec_t match_tbl[] = {
 	{0}
 };
 
-uint64_t cckey = 0;
+static uint64_t cckey = 0;
 
 /*******************************************/
 static const char *class_port_info(ib_portid_t *dest, char **argv, int argc)
diff --git a/src/ibping.c b/src/ibping.c
index 591619a0b6709b..2ba17313c00842 100644
--- a/src/ibping.c
+++ b/src/ibping.c
@@ -47,7 +47,7 @@
 
 #include "ibdiag_common.h"
 
-struct ibmad_port *srcport;
+static struct ibmad_port *srcport;
 
 static uint64_t time_stamp(void)
 {
diff --git a/src/ibportstate.c b/src/ibportstate.c
index 39118d6d3992f7..23f1ed5b7df07f 100644
--- a/src/ibportstate.c
+++ b/src/ibportstate.c
@@ -72,21 +72,21 @@ enum port_ops {
 	OFF
 };
 
-struct ibmad_port *srcport;
-uint64_t speed = 0; /* no state change */
-uint64_t espeed = 0; /* no state change */
-uint64_t fdr10 = 0; /* no state change */
-uint64_t width = 0; /* no state change */
-uint64_t lid;
-uint64_t smlid;
-uint64_t lmc;
-uint64_t mtu;
-uint64_t vls = 0; /* no state change */
-uint64_t mkey;
-uint64_t mkeylease;
-uint64_t mkeyprot;
-
-struct {
+static struct ibmad_port *srcport;
+static uint64_t speed; /* no state change */
+static uint64_t espeed; /* no state change */
+static uint64_t fdr10; /* no state change */
+static uint64_t width; /* no state change */
+static uint64_t lid;
+static uint64_t smlid;
+static uint64_t lmc;
+static uint64_t mtu;
+static uint64_t vls; /* no state change */
+static uint64_t mkey;
+static uint64_t mkeylease;
+static uint64_t mkeyprot;
+
+static struct {
 	const char *name;
 	uint64_t *val;
 	int set;
diff --git a/src/ibqueryerrors.c b/src/ibqueryerrors.c
index f86daaab9a8374..a9f738dbb30c62 100644
--- a/src/ibqueryerrors.c
+++ b/src/ibqueryerrors.c
@@ -56,24 +56,24 @@
 #include "ibdiag_common.h"
 #include "ibdiag_sa.h"
 
-struct ibmad_port *ibmad_port;
+static struct ibmad_port *ibmad_port;
 static char *node_name_map_file = NULL;
 static nn_map_t *node_name_map = NULL;
 static char *load_cache_file = NULL;
 static uint16_t lid2sl_table[sizeof(uint8_t) * 1024 * 48] = { 0 };
 static int obtain_sl = 1;
 
-int data_counters = 0;
-int data_counters_only = 0;
-int port_config = 0;
-uint64_t port_guid = 0;
-char *port_guid_str = NULL;
+static int data_counters;
+static int data_counters_only;
+static int port_config;
+static uint64_t port_guid;
+static char *port_guid_str;
 #define SUP_MAX 64
-int sup_total = 0;
-enum MAD_FIELDS suppressed_fields[SUP_MAX];
-char *dr_path = NULL;
-uint8_t node_type_to_print = 0;
-unsigned clear_errors = 0, clear_counts = 0, details = 0;
+static int sup_total;
+static enum MAD_FIELDS suppressed_fields[SUP_MAX];
+static char *dr_path;
+static uint8_t node_type_to_print;
+static unsigned clear_errors, clear_counts, details;
 
 #define PRINT_SWITCH 0x1
 #define PRINT_CA     0x2
@@ -82,20 +82,20 @@ unsigned clear_errors = 0, clear_counts = 0, details = 0;
 
 #define DEFAULT_HALF_WORLD_PR_TIMEOUT (3000)
 
-struct {
+static struct {
 	int nodes_checked;
 	int bad_nodes;
 	int ports_checked;
 	int bad_ports;
 	int pma_query_failures;
-} summary = { 0 };
+} summary;
 
 #define DEF_THRES_FILE IBDIAG_CONFIG_PATH"/error_thresholds"
 static const char *threshold_file = DEF_THRES_FILE;
 
 /* define a "packet" with threshold values in it */
-uint8_t thresholds[1204] = { 0 };
-char *threshold_str = NULL;
+static uint8_t thresholds[1204];
+static char *threshold_str;
 
 static unsigned valid_gid(ib_gid_t * gid)
 {
diff --git a/src/ibroute.c b/src/ibroute.c
index 15d726035bff19..e433faffc7a1eb 100644
--- a/src/ibroute.c
+++ b/src/ibroute.c
@@ -49,7 +49,7 @@
 
 #include "ibdiag_common.h"
 
-struct ibmad_port *srcport;
+static struct ibmad_port *srcport;
 
 static int brief, dump_all, multicast;
 
@@ -132,7 +132,7 @@ static int dump_mlid(char *str, int strlen, unsigned mlid, unsigned nports,
 	return i * 2;
 }
 
-uint16_t mft[16][IB_MLIDS_IN_BLOCK] = { { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0}, { 0 }, { 0 } };
+static uint16_t mft[16][IB_MLIDS_IN_BLOCK];
 
 static const char *dump_multicast_tables(ib_portid_t *portid, unsigned startlid,
 					 unsigned endlid)
diff --git a/src/ibsendtrap.c b/src/ibsendtrap.c
index dd1a92722824e0..14db04a0e9130a 100644
--- a/src/ibsendtrap.c
+++ b/src/ibsendtrap.c
@@ -49,9 +49,9 @@
 
 #include "ibdiag_common.h"
 
-struct ibmad_port *srcport;
+static struct ibmad_port *srcport;
 /* for local link integrity */
-int error_port = 1;
+static int error_port = 1;
 
 static uint16_t get_node_type(ib_portid_t * port)
 {
diff --git a/src/ibsysstat.c b/src/ibsysstat.c
index 9c2da8e7fd4884..501a629c0a154f 100644
--- a/src/ibsysstat.c
+++ b/src/ibsysstat.c
@@ -47,7 +47,7 @@
 
 #define MAX_CPUS 8
 
-struct ibmad_port *srcport;
+static struct ibmad_port *srcport;
 
 enum ib_sysstat_attr_t {
 	IB_PING_ATTR = 0x10,
diff --git a/src/ibtracert.c b/src/ibtracert.c
index 91461217bf705f..d8d45408cd716c 100644
--- a/src/ibtracert.c
+++ b/src/ibtracert.c
@@ -51,7 +51,7 @@
 
 #include "ibdiag_common.h"
 
-struct ibmad_port *srcport;
+static struct ibmad_port *srcport;
 
 #define MAXHOPS	63
 
@@ -113,8 +113,8 @@ struct Node {
 	char nodeinfo[64];
 };
 
-Node *nodesdist[MAXHOPS];
-uint64_t target_portguid;
+static Node *nodesdist[MAXHOPS];
+static uint64_t target_portguid;
 
 /*
  * is_port_inactive
diff --git a/src/mcm_rereg_test.c b/src/mcm_rereg_test.c
index 95aded688aabde..b9e85f8d2d04cb 100644
--- a/src/mcm_rereg_test.c
+++ b/src/mcm_rereg_test.c
@@ -64,7 +64,7 @@ static ibmad_gid_t mgid_ipoib = {
 	0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff
 };
 
-struct ibmad_port *srcport;
+static struct ibmad_port *srcport;
 
 static uint64_t build_mcm_rec(uint8_t *data, ibmad_gid_t mgid,
 			      ibmad_gid_t port_gid)
diff --git a/src/perfquery.c b/src/perfquery.c
index b0baa3bec7d3bf..7ce6a3f4d311d9 100644
--- a/src/perfquery.c
+++ b/src/perfquery.c
@@ -49,7 +49,7 @@
 
 #include "ibdiag_common.h"
 
-struct ibmad_port *srcport;
+static struct ibmad_port *srcport;
 
 struct perf_count {
 	uint32_t portselect;
@@ -105,8 +105,8 @@ struct perf_count_ext {
 
 static uint8_t pc[1024];
 
-struct perf_count perf_count = {0};
-struct perf_count_ext perf_count_ext = {0};
+static struct perf_count perf_count = {};
+static struct perf_count_ext perf_count_ext = {};
 
 #define ALL_PORTS 0xFF
 #define MAX_PORTS 255
diff --git a/src/saquery.c b/src/saquery.c
index b882b2bdaf08ba..8eae9ddd20083f 100644
--- a/src/saquery.c
+++ b/src/saquery.c
@@ -101,7 +101,7 @@ static nn_map_t *node_name_map = NULL;
 #define MAX_PORTS (8)
 #define DEFAULT_SA_TIMEOUT_MS (1000)
 
-enum {
+static enum {
 	ALL,
 	LID_ONLY,
 	UNIQUE_LID_ONLY,
@@ -111,11 +111,11 @@ enum {
 	NAME_OF_GUID,
 } node_print_desc = ALL;
 
-char *requested_name = NULL;
-uint16_t requested_lid = 0;
-int requested_lid_flag = 0;
-uint64_t requested_guid = 0;
-int requested_guid_flag = 0;
+static char *requested_name;
+static uint16_t requested_lid;
+static int requested_lid_flag;
+static uint64_t requested_guid;
+static int requested_guid_flag;
 
 static unsigned valid_gid(ibmad_gid_t * gid)
 {
diff --git a/src/sminfo.c b/src/sminfo.c
index 7e6a18a41e12fc..24c4950085879f 100644
--- a/src/sminfo.c
+++ b/src/sminfo.c
@@ -48,9 +48,7 @@
 
 static uint8_t sminfo[1024] = { 0 };
 
-struct ibmad_port *srcport;
-
-int strdata, xdata = 1, bindata;
+static struct ibmad_port *srcport;
 
 enum {
 	SMINFO_NOTACT,
@@ -61,7 +59,7 @@ enum {
 	SMINFO_STATE_LAST,
 };
 
-const char *const statestr[] = {
+static const char *const statestr[] = {
 	"SMINFO_NOTACT",
 	"SMINFO_DISCOVER",
 	"SMINFO_STANDBY",
diff --git a/src/smpquery.c b/src/smpquery.c
index 5254d131de2b29..ded1b391566955 100644
--- a/src/smpquery.c
+++ b/src/smpquery.c
@@ -51,7 +51,7 @@
 
 #include "ibdiag_common.h"
 
-struct ibmad_port *srcport;
+static struct ibmad_port *srcport;
 
 static op_fn_t node_desc, node_info, port_info, switch_info, pkey_table,
     sl2vl_table, vlarb_table, guid_info, mlnx_ext_port_info, port_info_extended;
diff --git a/src/vendstat.c b/src/vendstat.c
index f7c17578be837c..0030c7caf20928 100644
--- a/src/vendstat.c
+++ b/src/vendstat.c
@@ -58,7 +58,7 @@
 #define IB_MLX_IS3_PORT_XMIT_WAIT	0x10013C
 
 
-struct ibmad_port *srcport;
+static struct ibmad_port *srcport;
 
 typedef struct {
 	uint16_t hw_revision;
-- 
2.21.0




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux