Skip to content

Commit

Permalink
ibdiags: Add __be* annotations to types
Browse files Browse the repository at this point in the history
From sparse.

Reviewed-by: Nicolas Morey-Chaisemartin <NMoreyChaisemartin@suse.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
  • Loading branch information
jgunthorpe authored and weiny2 committed Apr 15, 2019
1 parent 42d2282 commit 66a7e92
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 49 deletions.
4 changes: 2 additions & 2 deletions src/dump_fts.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down
16 changes: 8 additions & 8 deletions src/ibqueryerrors.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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];

Expand All @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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 };
Expand Down Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions src/ibroute.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/ibtracert.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/mcm_rereg_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down Expand Up @@ -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;

Expand Down
14 changes: 7 additions & 7 deletions src/perfquery.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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 };
Expand Down
4 changes: 2 additions & 2 deletions src/saquery.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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));
Expand Down
14 changes: 7 additions & 7 deletions src/smpdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
8 changes: 4 additions & 4 deletions src/smpquery.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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;

Expand All @@ -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]));
Expand Down
26 changes: 13 additions & 13 deletions src/vendstat.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,32 +61,32 @@
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 {
uint8_t resv1;
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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 66a7e92

Please sign in to comment.