From: Jason Gunthorpe <jgg@xxxxxxxxxxxx> These cases all have parameters that are passed in from their globals, just remove the parameter. Avoids a warning from -Wshadow Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxxxx> --- src/ibportstate.c | 13 ++++++------- src/ibqueryerrors.c | 4 ++-- src/perfquery.c | 5 ++--- src/vendstat.c | 21 ++++++++++----------- 4 files changed, 20 insertions(+), 23 deletions(-) diff --git a/src/ibportstate.c b/src/ibportstate.c index 6b78fa755a71bc..29ffac274b7210 100644 --- a/src/ibportstate.c +++ b/src/ibportstate.c @@ -304,7 +304,7 @@ static int get_link_speed_ext(int lsee, int lses) return lsee; } -static void validate_width(int width, int peerwidth, int lwa) +static void validate_width(int peerwidth, int lwa) { if ((width & peerwidth & 0x8)) { if (lwa != 8) @@ -334,7 +334,7 @@ static void validate_width(int width, int peerwidth, int lwa) } } -static void validate_speed(int speed, int peerspeed, int lsa) +static void validate_speed(int peerspeed, int lsa) { if ((speed & peerspeed & 0x4)) { if (lsa != 4) @@ -354,7 +354,7 @@ static void validate_speed(int speed, int peerspeed, int lsa) } } -static void validate_extended_speed(int espeed, int peerespeed, int lsea) +static void validate_extended_speed(int peerespeed, int lsea) { if ((espeed & peerespeed & 0x4)) { if (lsea != 4) @@ -744,19 +744,18 @@ int main(int argc, char **argv) /* Examine Link Width */ width = get_link_width(lwe, lws); peerwidth = get_link_width(peerlwe, peerlws); - validate_width(width, peerwidth, lwa); + validate_width(peerwidth, lwa); /* Examine Link Speeds */ speed = get_link_speed(lse, lss); peerspeed = get_link_speed(peerlse, peerlss); - validate_speed(speed, peerspeed, lsa); + validate_speed(peerspeed, lsa); if (espeed_cap && peer_espeed_cap) { espeed = get_link_speed_ext(lsee, lses); peerespeed = get_link_speed_ext(peerlsee, peerlses); - validate_extended_speed(espeed, peerespeed, - lsea); + validate_extended_speed(peerespeed, lsea); } else { if (fdr10e & FDR10 && peerfdr10e & FDR10) { if (!(fdr10a & FDR10)) diff --git a/src/ibqueryerrors.c b/src/ibqueryerrors.c index 397127e686db63..358eb48e493e7a 100644 --- a/src/ibqueryerrors.c +++ b/src/ibqueryerrors.c @@ -127,7 +127,7 @@ static void set_thres(char *name, uint64_t val) } } -static void set_thresholds(const char *threshold_file) +static void set_thresholds(void) { char buf[1024]; uint64_t val = 0; @@ -1104,7 +1104,7 @@ int main(int argc, char **argv) } } - set_thresholds(threshold_file); + set_thresholds(); /* reopen the global ibmad_port */ ibmad_port = mad_rpc_open_port(ibd_ca, ibd_ca_port, diff --git a/src/perfquery.c b/src/perfquery.c index ee3e10b4c9a991..2450fba2699316 100644 --- a/src/perfquery.c +++ b/src/perfquery.c @@ -514,8 +514,7 @@ static void rcv_err_query(ib_portid_t * portid, int port, int mask) } static uint8_t *ext_speeds_reset_via(void *rcvbuf, ib_portid_t * dest, - int port, uint64_t mask, unsigned timeout, - const struct ibmad_port * srcport) + int port, uint64_t mask, unsigned timeout) { ib_rpc_t rpc = { 0 }; int lid = dest->lid; @@ -598,7 +597,7 @@ static void extended_speeds_query(ib_portid_t * portid, int port, } if ((reset_only || reset) && - !ext_speeds_reset_via(pc, portid, port, ext_mask, ibd_timeout, srcport)) + !ext_speeds_reset_via(pc, portid, port, ext_mask, ibd_timeout)) IBEXIT("cannot reset PortExtendedSpeedsCounters"); } diff --git a/src/vendstat.c b/src/vendstat.c index b0ebc3a9a047e9..e9916da1a9f456 100644 --- a/src/vendstat.c +++ b/src/vendstat.c @@ -175,9 +175,8 @@ static int is_ext_fw_info_supported(uint16_t device_id) { return 0; } -static int do_vendor(ib_portid_t *portid, struct ibmad_port *srcport, - uint8_t class, uint8_t method, uint16_t attr_id, - uint32_t attr_mod, void *data) +static int do_vendor(ib_portid_t *portid, uint8_t class, uint8_t method, + uint16_t attr_id, uint32_t attr_mod, void *data) { ib_vendor_call_t call; @@ -208,7 +207,7 @@ static int do_config_space_records(ib_portid_t *portid, unsigned set, cs->record[i].mask = htonl(cs->record[i].mask); } - if (do_vendor(portid, srcport, IB_MLX_VENDOR_CLASS, + if (do_vendor(portid, IB_MLX_VENDOR_CLASS, set ? IB_MAD_METHOD_SET : IB_MAD_METHOD_GET, IB_MLX_IS3_CONFIG_SPACE_ACCESS, 2 << 22 | records << 16, cs)) { @@ -231,7 +230,7 @@ static int counter_groups_info(ib_portid_t * portid, int port) /* Counter Group Info */ memset(&buf, 0, sizeof(buf)); - if (do_vendor(portid, srcport, IB_MLX_VENDOR_CLASS, IB_MAD_METHOD_GET, + if (do_vendor(portid, IB_MLX_VENDOR_CLASS, IB_MAD_METHOD_GET, IB_MLX_IS4_COUNTER_GROUP_INFO, port, buf)) { fprintf(stderr,"counter group info query failure\n"); return -1; @@ -271,7 +270,7 @@ static int config_counter_groups(ib_portid_t * portid, int port) cg_config->group_selects[0].group_select = (uint8_t) cg0; cg_config->group_selects[1].group_select = (uint8_t) cg1; - if (do_vendor(portid, srcport, IB_MLX_VENDOR_CLASS, IB_MAD_METHOD_SET, + if (do_vendor(portid, IB_MLX_VENDOR_CLASS, IB_MAD_METHOD_SET, IB_MLX_IS4_CONFIG_COUNTER_GROUP, port, buf)) { fprintf(stderr, "config counter group set failure\n"); return -1; @@ -279,7 +278,7 @@ static int config_counter_groups(ib_portid_t * portid, int port) /* get config counter groups */ memset(&buf, 0, sizeof(buf)); - if (do_vendor(portid, srcport, IB_MLX_VENDOR_CLASS, IB_MAD_METHOD_GET, + if (do_vendor(portid, IB_MLX_VENDOR_CLASS, IB_MAD_METHOD_GET, IB_MLX_IS4_CONFIG_COUNTER_GROUP, port, buf)) { fprintf(stderr, "config counter group query failure\n"); return -1; @@ -436,14 +435,14 @@ int main(int argc, char **argv) /* vendor ClassPortInfo is required attribute if class supported */ memset(&buf, 0, sizeof(buf)); - if (do_vendor(&portid, srcport, IB_MLX_VENDOR_CLASS, IB_MAD_METHOD_GET, + if (do_vendor(&portid, IB_MLX_VENDOR_CLASS, IB_MAD_METHOD_GET, CLASS_PORT_INFO, 0, buf)) { mad_rpc_close_port(srcport); IBEXIT("classportinfo query"); } memset(&buf, 0, sizeof(buf)); gi_is3 = (is3_general_info_t *) &buf; - if (do_vendor(&portid, srcport, IB_MLX_VENDOR_CLASS, IB_MAD_METHOD_GET, + if (do_vendor(&portid, IB_MLX_VENDOR_CLASS, IB_MAD_METHOD_GET, IB_MLX_IS3_GENERAL_INFO, 0, gi_is3)) { mad_rpc_close_port(srcport); IBEXIT("generalinfo query"); @@ -499,7 +498,7 @@ int main(int argc, char **argv) for (i = 0; i < 16; i++) cs->record[i].address = htonl(IB_MLX_IS3_PORT_XMIT_WAIT + ((i + 1) << 12)); - if (do_vendor(&portid, srcport, IB_MLX_VENDOR_CLASS, + if (do_vendor(&portid, IB_MLX_VENDOR_CLASS, IB_MAD_METHOD_GET, IB_MLX_IS3_CONFIG_SPACE_ACCESS, 2 << 22 | 16 << 16, cs)) { mad_rpc_close_port(srcport); @@ -516,7 +515,7 @@ int main(int argc, char **argv) for (i = 0; i < 8; i++) cs->record[i].address = htonl(IB_MLX_IS3_PORT_XMIT_WAIT + ((i + 17) << 12)); - if (do_vendor(&portid, srcport, IB_MLX_VENDOR_CLASS, + if (do_vendor(&portid, IB_MLX_VENDOR_CLASS, IB_MAD_METHOD_GET, IB_MLX_IS3_CONFIG_SPACE_ACCESS, 2 << 22 | 8 << 16, cs)) { mad_rpc_close_port(srcport); -- 2.21.0