[PATCH ibdiags 16/16] ibdiags: Add __be* annotations to types

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

 



From: Jason Gunthorpe <jgg@xxxxxxxxxxxx>

>From sparse.

Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxxxx>
---
 src/dump_fts.c       |  4 ++--
 src/ibqueryerrors.c  | 16 ++++++++--------
 src/ibroute.c        |  4 ++--
 src/ibtracert.c      |  2 +-
 src/mcm_rereg_test.c |  6 +++---
 src/perfquery.c      | 14 +++++++-------
 src/saquery.c        |  4 ++--
 src/smpdump.c        | 14 +++++++-------
 src/smpquery.c       |  8 ++++----
 src/vendstat.c       | 26 +++++++++++++-------------
 10 files changed, 49 insertions(+), 49 deletions(-)

diff --git a/src/dump_fts.c b/src/dump_fts.c
index 88f186f7d8921e..8a5b3e20da6b45 100644
--- a/src/dump_fts.c
+++ b/src/dump_fts.c
@@ -65,7 +65,7 @@ static nn_map_t *node_name_map = NULL;
 #define IB_MLIDS_IN_BLOCK	(IB_SMP_DATA_SIZE/2)
 
 static int dump_mlid(char *str, int strlen, unsigned mlid, unsigned nports,
-		     uint16_t mft[16][IB_MLIDS_IN_BLOCK])
+		     __be16 mft[16][IB_MLIDS_IN_BLOCK])
 {
 	uint16_t mask;
 	unsigned i, chunk, bit, nonzero = 0;
@@ -107,7 +107,7 @@ static int dump_mlid(char *str, int strlen, unsigned mlid, unsigned nports,
 	return i * 2;
 }
 
-static uint16_t mft[16][IB_MLIDS_IN_BLOCK];
+static __be16 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/ibqueryerrors.c b/src/ibqueryerrors.c
index bbae886b9f69d8..715ebc969672e2 100644
--- a/src/ibqueryerrors.c
+++ b/src/ibqueryerrors.c
@@ -427,7 +427,7 @@ static int check_threshold(uint8_t *pc, uint8_t *pce, uint32_t cap_mask2,
 
 static int print_results(ib_portid_t * portid, char *node_name,
 			 ibnd_node_t * node, uint8_t * pc, int portnum,
-			 int *header_printed, uint8_t *pce, uint16_t cap_mask,
+			 int *header_printed, uint8_t *pce, __be16 cap_mask,
 			 uint32_t cap_mask2)
 {
 	char buf[2048];
@@ -537,11 +537,11 @@ static int print_results(ib_portid_t * portid, char *node_name,
 }
 
 static int query_cap_mask(ib_portid_t * portid, char *node_name, int portnum,
-			  uint16_t * cap_mask, uint32_t * cap_mask2)
+			  __be16 * cap_mask, uint32_t * cap_mask2)
 {
 	uint8_t pc[1024] = { 0 };
-	uint16_t rc_cap_mask;
-	uint32_t rc_cap_mask2;
+	__be16 rc_cap_mask;
+	__be32 rc_cap_mask2;
 
 	portid->sl = lid2sl_table[portid->lid];
 
@@ -564,7 +564,7 @@ static int query_cap_mask(ib_portid_t * portid, char *node_name, int portnum,
 	return 0;
 }
 
-static int print_data_cnts(ib_portid_t * portid, uint16_t cap_mask,
+static int print_data_cnts(ib_portid_t * portid, __be16 cap_mask,
 			   char *node_name, ibnd_node_t * node, int portnum,
 			   int *header_printed)
 {
@@ -635,7 +635,7 @@ static int print_data_cnts(ib_portid_t * portid, uint16_t cap_mask,
 	return (0);
 }
 
-static int print_errors(ib_portid_t * portid, uint16_t cap_mask, uint32_t cap_mask2,
+static int print_errors(ib_portid_t * portid, __be16 cap_mask, uint32_t cap_mask2,
 			char *node_name, ibnd_node_t * node, int portnum,
 			int *header_printed)
 {
@@ -716,7 +716,7 @@ static uint8_t *reset_pc_ext(void *rcvbuf, ib_portid_t *dest, int port,
 	return mad_rpc(srcport, &rpc, dest, rcvbuf, rcvbuf);
 }
 
-static void clear_port(ib_portid_t * portid, uint16_t cap_mask, uint32_t cap_mask2,
+static void clear_port(ib_portid_t * portid, __be16 cap_mask, uint32_t cap_mask2,
 		       char *node_name, int port)
 {
 	uint8_t pc[1024] = { 0 };
@@ -781,7 +781,7 @@ static void print_node(ibnd_node_t *node, void *user_data)
 	int type = 0;
 	int all_port_sup = 0;
 	ib_portid_t portid = { 0 };
-	uint16_t cap_mask = 0;
+	__be16 cap_mask = 0;
 	uint32_t cap_mask2 = 0;
 	char *node_name = NULL;
 
diff --git a/src/ibroute.c b/src/ibroute.c
index 798abd80923a24..8108362e3a45cd 100644
--- a/src/ibroute.c
+++ b/src/ibroute.c
@@ -90,7 +90,7 @@ static const char *check_switch(ib_portid_t *portid, unsigned int *nports,
 #define IB_MLIDS_IN_BLOCK	(IB_SMP_DATA_SIZE/2)
 
 static int dump_mlid(char *str, int strlen, unsigned mlid, unsigned nports,
-		     uint16_t mft[16][IB_MLIDS_IN_BLOCK])
+		     __be16 mft[16][IB_MLIDS_IN_BLOCK])
 {
 	uint16_t mask;
 	unsigned i, chunk, bit, nonzero = 0;
@@ -132,7 +132,7 @@ static int dump_mlid(char *str, int strlen, unsigned mlid, unsigned nports,
 	return i * 2;
 }
 
-static uint16_t mft[16][IB_MLIDS_IN_BLOCK];
+static __be16 mft[16][IB_MLIDS_IN_BLOCK];
 
 static const char *dump_multicast_tables(ib_portid_t *portid, unsigned startlid,
 					 unsigned endlid)
diff --git a/src/ibtracert.c b/src/ibtracert.c
index a21ee8e7724865..7bdb1e0034e8ea 100644
--- a/src/ibtracert.c
+++ b/src/ibtracert.c
@@ -491,7 +491,7 @@ static int switch_mclookup(Node * node, ib_portid_t * portid, int mlid,
 	Switch sw;
 	char mdb[64];
 	void *si = sw.switchinfo;
-	uint16_t *msets = (uint16_t *) mdb;
+	__be16 *msets = (__be16 *) mdb;
 	int maxsets, block, i, set;
 
 	memset(map, 0, 256);
diff --git a/src/mcm_rereg_test.c b/src/mcm_rereg_test.c
index b9e85f8d2d04cb..056682407eb359 100644
--- a/src/mcm_rereg_test.c
+++ b/src/mcm_rereg_test.c
@@ -145,7 +145,7 @@ static int rereg_port_gid(int port, int agent, ib_portid_t * dport,
 
 struct guid_trid {
 	ibmad_gid_t gid;
-	uint64_t guid;
+	__be64 guid;
 	uint64_t trid;
 };
 
@@ -319,8 +319,8 @@ static int rereg_and_test_port(const char *guid_file, int port, int agent,
 	char line[256];
 	FILE *f;
 	ibmad_gid_t port_gid;
-	uint64_t prefix = htobe64(0xfe80000000000000ull);
-	uint64_t guid = htobe64(0x0002c90200223825ull);
+	__be64 prefix = htobe64(0xfe80000000000000ull);
+	__be64 guid = htobe64(0x0002c90200223825ull);
 	struct guid_trid *list;
 	int i = 0;
 
diff --git a/src/perfquery.c b/src/perfquery.c
index 7f7ca951b01094..f6ca1b2fb36c2f 100644
--- a/src/perfquery.c
+++ b/src/perfquery.c
@@ -207,7 +207,7 @@ static void aggregate_perfcounters(void)
 }
 
 static void output_aggregate_perfcounters(ib_portid_t * portid,
-					  uint16_t cap_mask)
+					  __be16 cap_mask)
 {
 	char buf[1024];
 	uint32_t val = ALL_PORTS;
@@ -246,7 +246,7 @@ static void output_aggregate_perfcounters(ib_portid_t * portid,
 	       portid2str(portid), ALL_PORTS, ntohs(cap_mask), buf);
 }
 
-static void aggregate_perfcounters_ext(uint16_t cap_mask, uint32_t cap_mask2)
+static void aggregate_perfcounters_ext(__be16 cap_mask, uint32_t cap_mask2)
 {
 	uint32_t val;
 	uint64_t val64;
@@ -310,7 +310,7 @@ static void aggregate_perfcounters_ext(uint16_t cap_mask, uint32_t cap_mask2)
 }
 
 static void output_aggregate_perfcounters_ext(ib_portid_t * portid,
-					      uint16_t cap_mask, uint32_t cap_mask2)
+					      __be16 cap_mask, uint32_t cap_mask2)
 {
 	char buf[1536];
 	uint32_t val = ALL_PORTS;
@@ -379,7 +379,7 @@ static void output_aggregate_perfcounters_ext(ib_portid_t * portid,
 	       portid2str(portid), ALL_PORTS, ntohs(cap_mask), cap_mask2, buf);
 }
 
-static void dump_perfcounters(int extended, int timeout, uint16_t cap_mask,
+static void dump_perfcounters(int extended, int timeout, __be16 cap_mask,
 			      uint32_t cap_mask2, ib_portid_t * portid,
 			      int port, int aggregate)
 {
@@ -555,7 +555,7 @@ static uint8_t *ext_speeds_reset_via(void *rcvbuf, ib_portid_t * dest,
 }
 
 static uint8_t is_rsfec_mode_active(ib_portid_t * portid, int port,
-				  uint16_t cap_mask)
+				  __be16 cap_mask)
 {
 	uint8_t data[IB_SMP_DATA_SIZE] = { 0 };
 	uint32_t fec_mode_active = 0;
@@ -584,7 +584,7 @@ static uint8_t is_rsfec_mode_active(ib_portid_t * portid, int port,
 }
 
 static void extended_speeds_query(ib_portid_t * portid, int port,
-				  uint64_t ext_mask, uint16_t cap_mask)
+				  uint64_t ext_mask, __be16 cap_mask)
 {
 	int mask = ext_mask;
 
@@ -801,7 +801,7 @@ int main(int argc, char **argv)
 	int mask = 0xffff;
 	uint64_t ext_mask = 0xffffffffffffffffULL;
 	uint32_t cap_mask2;
-	uint16_t cap_mask;
+	__be16 cap_mask;
 	int all_ports_loop = 0;
 	int node_type, num_ports = 0;
 	uint8_t data[IB_SMP_DATA_SIZE] = { 0 };
diff --git a/src/saquery.c b/src/saquery.c
index ae6c2c872e8d90..273e03c98bfef1 100644
--- a/src/saquery.c
+++ b/src/saquery.c
@@ -557,7 +557,7 @@ static void dump_inform_info_record(void *data, struct query_params *p)
 	char gid_str[INET6_ADDRSTRLEN];
 	char gid_str2[INET6_ADDRSTRLEN];
 	ib_inform_info_record_t *p_iir = data;
-	uint32_t qpn;
+	__be32 qpn;
 	uint8_t resp_time_val;
 
 	ib_inform_info_get_qpn_resp_time(p_iir->inform_info.g_or_v.
@@ -1046,7 +1046,7 @@ static int query_path_records(const struct query_cmd *q, struct sa_handle * h,
 	ib_path_rec_t pr;
 	__be64 comp_mask = 0;
 	uint32_t flow = 0;
-	uint16_t qos_class = 0;
+	__be16 qos_class = 0;
 	uint8_t reversible = 0;
 
 	memset(&pr, 0, sizeof(pr));
diff --git a/src/smpdump.c b/src/smpdump.c
index 039eca03418016..ece87bf2bb49e6 100644
--- a/src/smpdump.c
+++ b/src/smpdump.c
@@ -63,16 +63,16 @@ struct drsmp {
 	uint8_t mgmt_class;
 	uint8_t class_version;
 	uint8_t method;
-	uint16_t status;
+	__be16 status;
 	uint8_t hop_ptr;
 	uint8_t hop_cnt;
-	uint64_t tid;
-	uint16_t attr_id;
+	__be64 tid;
+	__be16 attr_id;
 	uint16_t resv;
-	uint32_t attr_mod;
-	uint64_t mkey;
-	uint16_t dr_slid;
-	uint16_t dr_dlid;
+	__be32 attr_mod;
+	__be64 mkey;
+	__be16 dr_slid;
+	__be16 dr_dlid;
 	uint8_t reserved[28];
 	uint8_t data[64];
 	uint8_t initial_path[64];
diff --git a/src/smpquery.c b/src/smpquery.c
index 3a3c1ca3fb5a65..6d54e65fd49181 100644
--- a/src/smpquery.c
+++ b/src/smpquery.c
@@ -200,7 +200,7 @@ static const char *pkey_table(ib_portid_t *dest, char **argv, int argc)
 {
 	uint8_t data[IB_SMP_DATA_SIZE] = { 0 };
 	int i, j, k;
-	uint16_t *p;
+	__be16 *p;
 	unsigned mod;
 	int n, t, phy_ports;
 	int portnum = 0;
@@ -234,7 +234,7 @@ static const char *pkey_table(ib_portid_t *dest, char **argv, int argc)
 			k = ((n + 7 - i * 32) / 8) * 8;
 		else
 			k = 32;
-		p = (uint16_t *) data;
+		p = (__be16 *) data;
 		for (j = 0; j < k; j += 8, p += 8) {
 			printf
 			    ("%4u: 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x\n",
@@ -381,7 +381,7 @@ static const char *guid_info(ib_portid_t *dest, char **argv, int argc)
 {
 	uint8_t data[IB_SMP_DATA_SIZE] = { 0 };
 	int i, j, k;
-	uint64_t *p;
+	__be64 *p;
 	unsigned mod;
 	int n;
 
@@ -399,7 +399,7 @@ static const char *guid_info(ib_portid_t *dest, char **argv, int argc)
 			k = ((n + 1 - i * 8) / 2) * 2;
 		else
 			k = 8;
-		p = (uint64_t *) data;
+		p = (__be64 *) data;
 		for (j = 0; j < k; j += 2, p += 2) {
 			printf("%4u: 0x%016" PRIx64 " 0x%016" PRIx64 "\n",
 			       (i * 8) + j, be64toh(p[0]), be64toh(p[1]));
diff --git a/src/vendstat.c b/src/vendstat.c
index 316220451055cd..3191e49c927298 100644
--- a/src/vendstat.c
+++ b/src/vendstat.c
@@ -61,10 +61,10 @@
 static struct ibmad_port *srcport;
 
 typedef struct {
-	uint16_t hw_revision;
-	uint16_t device_id;
+	__be16 hw_revision;
+	__be16 device_id;
 	uint8_t reserved[24];
-	uint32_t uptime;
+	__be32 uptime;
 } is3_hw_info_t;
 
 typedef struct {
@@ -72,21 +72,21 @@ typedef struct {
 	uint8_t major;
 	uint8_t minor;
 	uint8_t sub_minor;
-	uint32_t build_id;
+	__be32 build_id;
 	uint8_t month;
 	uint8_t day;
-	uint16_t year;
-	uint16_t resv2;
-	uint16_t hour;
+	__be16 year;
+	__be16 resv2;
+	__be16 hour;
 	uint8_t psid[16];
-	uint32_t ini_file_version;
+	__be32 ini_file_version;
 } is3_fw_info_t;
 
 typedef struct {
-	uint32_t ext_major;
-	uint32_t ext_minor;
-	uint32_t ext_sub_minor;
-	uint32_t reserved[4];
+	__be32 ext_major;
+	__be32 ext_minor;
+	__be32 ext_sub_minor;
+	__be32 reserved[4];
 } is4_fw_ext_info_t;
 
 typedef struct {
@@ -127,7 +127,7 @@ typedef struct {
 	uint8_t reserved1[8];
 	uint8_t reserved[3];
 	uint8_t num_of_counter_groups;
-	uint32_t group_masks[COUNTER_GROUPS_NUM];
+	__be32 group_masks[COUNTER_GROUPS_NUM];
 } is4_counter_group_info_t;
 
 typedef struct {
-- 
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