Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

RDMA/core: Fix incorrect print format specifier

There are some '%u' for 'int' and '%d' for 'unsigend int', they should be
fixed.

Link: https://lore.kernel.org/r/1623325232-30900-1-git-send-email-liweihang@huawei.com
Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com>
Signed-off-by: Weihang Li <liweihang@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>

authored by

Wenpeng Liang and committed by
Jason Gunthorpe
3cea7b4a 57dba89a

+45 -45
+5 -5
drivers/infiniband/core/cache.c
··· 240 240 u32 port_num = entry->attr.port_num; 241 241 struct ib_gid_table *table = rdma_gid_table(device, port_num); 242 242 243 - dev_dbg(&device->dev, "%s port=%u index=%d gid %pI6\n", __func__, 243 + dev_dbg(&device->dev, "%s port=%u index=%u gid %pI6\n", __func__, 244 244 port_num, entry->attr.index, entry->attr.gid.raw); 245 245 246 246 write_lock_irq(&table->rwlock); ··· 323 323 { 324 324 entry->state = GID_TABLE_ENTRY_VALID; 325 325 326 - dev_dbg(&entry->attr.device->dev, "%s port=%d index=%d gid %pI6\n", 326 + dev_dbg(&entry->attr.device->dev, "%s port=%u index=%u gid %pI6\n", 327 327 __func__, entry->attr.port_num, entry->attr.index, 328 328 entry->attr.gid.raw); 329 329 ··· 354 354 int ret; 355 355 356 356 if (!attr->ndev) { 357 - dev_err(&attr->device->dev, "%s NULL netdev port=%d index=%d\n", 357 + dev_err(&attr->device->dev, "%s NULL netdev port=%u index=%u\n", 358 358 __func__, attr->port_num, attr->index); 359 359 return -EINVAL; 360 360 } ··· 362 362 ret = attr->device->ops.add_gid(attr, &entry->context); 363 363 if (ret) { 364 364 dev_err(&attr->device->dev, 365 - "%s GID add failed port=%d index=%d\n", 365 + "%s GID add failed port=%u index=%u\n", 366 366 __func__, attr->port_num, attr->index); 367 367 return ret; 368 368 } ··· 805 805 continue; 806 806 if (kref_read(&table->data_vec[i]->kref) > 1) { 807 807 dev_err(&device->dev, 808 - "GID entry ref leak for index %d ref=%d\n", i, 808 + "GID entry ref leak for index %d ref=%u\n", i, 809 809 kref_read(&table->data_vec[i]->kref)); 810 810 leak = true; 811 811 }
+1 -1
drivers/infiniband/core/cm.c
··· 1745 1745 1746 1746 ret = ib_get_cached_pkey(ib_dev, port_num, pkey_index, &pkey); 1747 1747 if (ret) { 1748 - dev_warn_ratelimited(&ib_dev->dev, "ib_cm: Couldn't retrieve pkey for incoming request (port %d, pkey index %d). %d\n", 1748 + dev_warn_ratelimited(&ib_dev->dev, "ib_cm: Couldn't retrieve pkey for incoming request (port %u, pkey index %u). %d\n", 1749 1749 port_num, pkey_index, ret); 1750 1750 return 0; 1751 1751 }
+11 -11
drivers/infiniband/core/iwpm_msg.c
··· 123 123 ret = iwpm_wait_complete_req(nlmsg_request); 124 124 return ret; 125 125 pid_query_error: 126 - pr_info("%s: %s (client = %d)\n", __func__, err_str, nl_client); 126 + pr_info("%s: %s (client = %u)\n", __func__, err_str, nl_client); 127 127 dev_kfree_skb(skb); 128 128 if (nlmsg_request) 129 129 iwpm_free_nlmsg_request(&nlmsg_request->kref); ··· 211 211 ret = iwpm_wait_complete_req(nlmsg_request); 212 212 return ret; 213 213 add_mapping_error: 214 - pr_info("%s: %s (client = %d)\n", __func__, err_str, nl_client); 214 + pr_info("%s: %s (client = %u)\n", __func__, err_str, nl_client); 215 215 add_mapping_error_nowarn: 216 216 dev_kfree_skb(skb); 217 217 if (nlmsg_request) ··· 304 304 ret = iwpm_wait_complete_req(nlmsg_request); 305 305 return ret; 306 306 query_mapping_error: 307 - pr_info("%s: %s (client = %d)\n", __func__, err_str, nl_client); 307 + pr_info("%s: %s (client = %u)\n", __func__, err_str, nl_client); 308 308 query_mapping_error_nowarn: 309 309 dev_kfree_skb(skb); 310 310 if (nlmsg_request) ··· 372 372 "remove_mapping: Local sockaddr:"); 373 373 return 0; 374 374 remove_mapping_error: 375 - pr_info("%s: %s (client = %d)\n", __func__, err_str, nl_client); 375 + pr_info("%s: %s (client = %u)\n", __func__, err_str, nl_client); 376 376 if (skb) 377 377 dev_kfree_skb_any(skb); 378 378 return ret; ··· 431 431 strcmp(iwpm_ulib_name, iwpm_name) || 432 432 iwpm_version < IWPM_UABI_VERSION_MIN) { 433 433 434 - pr_info("%s: Incorrect info (dev = %s name = %s version = %d)\n", 434 + pr_info("%s: Incorrect info (dev = %s name = %s version = %u)\n", 435 435 __func__, dev_name, iwpm_name, iwpm_version); 436 436 nlmsg_request->err_code = IWPM_USER_LIB_INFO_ERR; 437 437 goto register_pid_response_exit; ··· 439 439 iwpm_user_pid = cb->nlh->nlmsg_pid; 440 440 iwpm_ulib_version = iwpm_version; 441 441 if (iwpm_ulib_version < IWPM_UABI_VERSION) 442 - pr_warn_once("%s: Down level iwpmd/pid %u. Continuing...", 442 + pr_warn_once("%s: Down level iwpmd/pid %d. Continuing...", 443 443 __func__, iwpm_user_pid); 444 444 atomic_set(&echo_nlmsg_seq, cb->nlh->nlmsg_seq); 445 445 pr_debug("%s: iWarp Port Mapper (pid = %d) is available!\n", ··· 650 650 651 651 nl_client = RDMA_NL_GET_CLIENT(cb->nlh->nlmsg_type); 652 652 if (!iwpm_valid_client(nl_client)) { 653 - pr_info("%s: Invalid port mapper client = %d\n", 653 + pr_info("%s: Invalid port mapper client = %u\n", 654 654 __func__, nl_client); 655 655 return ret; 656 656 } ··· 731 731 iwpm_version = nla_get_u16(nltb[IWPM_NLA_MAPINFO_ULIB_VER]); 732 732 if (strcmp(iwpm_ulib_name, iwpm_name) || 733 733 iwpm_version < IWPM_UABI_VERSION_MIN) { 734 - pr_info("%s: Invalid port mapper name = %s version = %d\n", 734 + pr_info("%s: Invalid port mapper name = %s version = %u\n", 735 735 __func__, iwpm_name, iwpm_version); 736 736 return ret; 737 737 } 738 738 nl_client = RDMA_NL_GET_CLIENT(cb->nlh->nlmsg_type); 739 739 if (!iwpm_valid_client(nl_client)) { 740 - pr_info("%s: Invalid port mapper client = %d\n", 740 + pr_info("%s: Invalid port mapper client = %u\n", 741 741 __func__, nl_client); 742 742 return ret; 743 743 } ··· 746 746 iwpm_user_pid = cb->nlh->nlmsg_pid; 747 747 748 748 if (iwpm_ulib_version < IWPM_UABI_VERSION) 749 - pr_warn_once("%s: Down level iwpmd/pid %u. Continuing...", 749 + pr_warn_once("%s: Down level iwpmd/pid %d. Continuing...", 750 750 __func__, iwpm_user_pid); 751 751 752 752 if (!iwpm_mapinfo_available()) ··· 864 864 abi_version = nla_get_u16(nltb[IWPM_NLA_HELLO_ABI_VERSION]); 865 865 nl_client = RDMA_NL_GET_CLIENT(cb->nlh->nlmsg_type); 866 866 if (!iwpm_valid_client(nl_client)) { 867 - pr_info("%s: Invalid port mapper client = %d\n", 867 + pr_info("%s: Invalid port mapper client = %u\n", 868 868 __func__, nl_client); 869 869 return ret; 870 870 }
+2 -2
drivers/infiniband/core/iwpm_util.c
··· 307 307 int ret = -EINVAL; 308 308 309 309 if (!iwpm_valid_client(nl_client)) { 310 - pr_info("%s: Invalid client = %d\n", __func__, nl_client); 310 + pr_info("%s: Invalid client = %u\n", __func__, nl_client); 311 311 return ret; 312 312 } 313 313 spin_lock_irqsave(&iwpm_reminfo_lock, flags); ··· 655 655 err_str = "Unable to send a nlmsg"; 656 656 goto mapinfo_num_error; 657 657 } 658 - pr_debug("%s: Sent mapping number = %d\n", __func__, mapping_num); 658 + pr_debug("%s: Sent mapping number = %u\n", __func__, mapping_num); 659 659 return 0; 660 660 mapinfo_num_error: 661 661 pr_info("%s: %s\n", __func__, err_str);
+5 -5
drivers/infiniband/core/mad.c
··· 351 351 /* Validate device and port */ 352 352 port_priv = ib_get_mad_port(device, port_num); 353 353 if (!port_priv) { 354 - dev_dbg_ratelimited(&device->dev, "%s: Invalid port %d\n", 354 + dev_dbg_ratelimited(&device->dev, "%s: Invalid port %u\n", 355 355 __func__, port_num); 356 356 ret = ERR_PTR(-ENODEV); 357 357 goto error1; ··· 1626 1626 /* Make sure MAD base version is understood */ 1627 1627 if (mad_hdr->base_version != IB_MGMT_BASE_VERSION && 1628 1628 (!opa || mad_hdr->base_version != OPA_MGMT_BASE_VERSION)) { 1629 - pr_err("MAD received with unsupported base version %d %s\n", 1629 + pr_err("MAD received with unsupported base version %u %s\n", 1630 1630 mad_hdr->base_version, opa ? "(opa)" : ""); 1631 1631 goto out; 1632 1632 } ··· 2867 2867 2868 2868 /* It's worse than that! He's dead, Jim! */ 2869 2869 dev_err(&qp_info->port_priv->device->dev, 2870 - "Fatal error (%d) on MAD QP (%d)\n", 2870 + "Fatal error (%d) on MAD QP (%u)\n", 2871 2871 event->event, qp_info->qp->qp_num); 2872 2872 } 2873 2873 ··· 3125 3125 3126 3126 if (ib_agent_port_close(device, i)) 3127 3127 dev_err(&device->dev, 3128 - "Couldn't close port %d for agents\n", i); 3128 + "Couldn't close port %u for agents\n", i); 3129 3129 if (ib_mad_port_close(device, i)) 3130 - dev_err(&device->dev, "Couldn't close port %d\n", i); 3130 + dev_err(&device->dev, "Couldn't close port %u\n", i); 3131 3131 } 3132 3132 } 3133 3133
+1 -1
drivers/infiniband/core/netlink.c
··· 98 98 */ 99 99 up_read(&rdma_nl_types[type].sem); 100 100 101 - request_module("rdma-netlink-subsys-%d", type); 101 + request_module("rdma-netlink-subsys-%u", type); 102 102 103 103 down_read(&rdma_nl_types[type].sem); 104 104 cb_table = READ_ONCE(rdma_nl_types[type].cb_table);
+4 -4
drivers/infiniband/core/rw.c
··· 389 389 int count = 0, ret; 390 390 391 391 if (sg_cnt > pages_per_mr || prot_sg_cnt > pages_per_mr) { 392 - pr_err("SG count too large: sg_cnt=%d, prot_sg_cnt=%d, pages_per_mr=%d\n", 392 + pr_err("SG count too large: sg_cnt=%u, prot_sg_cnt=%u, pages_per_mr=%u\n", 393 393 sg_cnt, prot_sg_cnt, pages_per_mr); 394 394 return -EINVAL; 395 395 } ··· 429 429 ret = ib_map_mr_sg_pi(ctx->reg->mr, sg, sg_cnt, NULL, prot_sg, 430 430 prot_sg_cnt, NULL, SZ_4K); 431 431 if (unlikely(ret)) { 432 - pr_err("failed to map PI sg (%d)\n", sg_cnt + prot_sg_cnt); 432 + pr_err("failed to map PI sg (%u)\n", sg_cnt + prot_sg_cnt); 433 433 goto out_destroy_sig_mr; 434 434 } 435 435 ··· 714 714 IB_MR_TYPE_MEM_REG, 715 715 max_num_sg, 0); 716 716 if (ret) { 717 - pr_err("%s: failed to allocated %d MRs\n", 717 + pr_err("%s: failed to allocated %u MRs\n", 718 718 __func__, nr_mrs); 719 719 return ret; 720 720 } ··· 724 724 ret = ib_mr_pool_init(qp, &qp->sig_mrs, nr_sig_mrs, 725 725 IB_MR_TYPE_INTEGRITY, max_num_sg, max_num_sg); 726 726 if (ret) { 727 - pr_err("%s: failed to allocated %d SIG MRs\n", 727 + pr_err("%s: failed to allocated %u SIG MRs\n", 728 728 __func__, nr_sig_mrs); 729 729 goto out_free_rdma_mrs; 730 730 }
+1 -1
drivers/infiniband/core/security.c
··· 586 586 WARN_ONCE((qp_attr_mask & IB_QP_PORT && 587 587 rdma_protocol_ib(real_qp->device, qp_attr->port_num) && 588 588 !real_qp->qp_sec), 589 - "%s: QP security is not initialized for IB QP: %d\n", 589 + "%s: QP security is not initialized for IB QP: %u\n", 590 590 __func__, real_qp->qp_num); 591 591 592 592 /* The port/pkey settings are maintained only for the real QP. Open
+5 -5
drivers/infiniband/core/sysfs.c
··· 259 259 if (ret) 260 260 return ret; 261 261 262 - return sysfs_emit(buf, "%d\n", attr.lmc); 262 + return sysfs_emit(buf, "%u\n", attr.lmc); 263 263 } 264 264 265 265 static ssize_t sm_lid_show(struct ib_device *ibdev, u32 port_num, ··· 285 285 if (ret) 286 286 return ret; 287 287 288 - return sysfs_emit(buf, "%d\n", attr.sm_sl); 288 + return sysfs_emit(buf, "%u\n", attr.sm_sl); 289 289 } 290 290 291 291 static ssize_t cap_mask_show(struct ib_device *ibdev, u32 port_num, ··· 387 387 if (ret) 388 388 return ret; 389 389 390 - return sysfs_emit(buf, "%d: %s\n", attr.phys_state, 390 + return sysfs_emit(buf, "%u: %s\n", attr.phys_state, 391 391 phys_state_to_str(attr.phys_state)); 392 392 } 393 393 ··· 612 612 613 613 switch (width) { 614 614 case 4: 615 - len = sysfs_emit(buf, "%u\n", 615 + len = sysfs_emit(buf, "%d\n", 616 616 (*data >> (4 - (offset % 8))) & 0xf); 617 617 break; 618 618 case 8: ··· 1298 1298 { 1299 1299 struct ib_device *dev = rdma_device_to_ibdev(device); 1300 1300 1301 - return sysfs_emit(buf, "%d: %s\n", dev->node_type, 1301 + return sysfs_emit(buf, "%u: %s\n", dev->node_type, 1302 1302 node_type_string(dev->node_type)); 1303 1303 } 1304 1304 static DEVICE_ATTR_RO(node_type);
+4 -4
drivers/infiniband/core/ud_header.c
··· 479 479 buf += IB_LRH_BYTES; 480 480 481 481 if (header->lrh.link_version != 0) { 482 - pr_warn("Invalid LRH.link_version %d\n", 482 + pr_warn("Invalid LRH.link_version %u\n", 483 483 header->lrh.link_version); 484 484 return -EINVAL; 485 485 } ··· 496 496 buf += IB_GRH_BYTES; 497 497 498 498 if (header->grh.ip_version != 6) { 499 - pr_warn("Invalid GRH.ip_version %d\n", 499 + pr_warn("Invalid GRH.ip_version %u\n", 500 500 header->grh.ip_version); 501 501 return -EINVAL; 502 502 } ··· 508 508 break; 509 509 510 510 default: 511 - pr_warn("Invalid LRH.link_next_header %d\n", 511 + pr_warn("Invalid LRH.link_next_header %u\n", 512 512 header->lrh.link_next_header); 513 513 return -EINVAL; 514 514 } ··· 530 530 } 531 531 532 532 if (header->bth.transport_header_version != 0) { 533 - pr_warn("Invalid BTH.transport_header_version %d\n", 533 + pr_warn("Invalid BTH.transport_header_version %u\n", 534 534 header->bth.transport_header_version); 535 535 return -EINVAL; 536 536 }
+1 -1
drivers/infiniband/core/umem_odp.c
··· 445 445 if (hmm_order + PAGE_SHIFT < page_shift) { 446 446 ret = -EINVAL; 447 447 ibdev_dbg(umem_odp->umem.ibdev, 448 - "%s: un-expected hmm_order %d, page_shift %d\n", 448 + "%s: un-expected hmm_order %u, page_shift %u\n", 449 449 __func__, hmm_order, page_shift); 450 450 break; 451 451 }
+2 -2
drivers/infiniband/core/user_mad.c
··· 700 700 701 701 if (ureq.qpn != 0 && ureq.qpn != 1) { 702 702 dev_notice(&file->port->dev, 703 - "%s: invalid QPN %d specified\n", __func__, 703 + "%s: invalid QPN %u specified\n", __func__, 704 704 ureq.qpn); 705 705 ret = -EINVAL; 706 706 goto out; ··· 800 800 } 801 801 802 802 if (ureq.qpn != 0 && ureq.qpn != 1) { 803 - dev_notice(&file->port->dev, "%s: invalid QPN %d specified\n", 803 + dev_notice(&file->port->dev, "%s: invalid QPN %u specified\n", 804 804 __func__, ureq.qpn); 805 805 ret = -EINVAL; 806 806 goto out;
+1 -1
drivers/infiniband/core/uverbs_cmd.c
··· 3314 3314 ib_spec += ((union ib_flow_spec *) ib_spec)->size; 3315 3315 } 3316 3316 if (cmd.flow_attr.size || (i != flow_attr->num_of_specs)) { 3317 - pr_warn("create flow failed, flow %d: %d bytes left from uverb cmd\n", 3317 + pr_warn("create flow failed, flow %d: %u bytes left from uverb cmd\n", 3318 3318 i, cmd.flow_attr.size); 3319 3319 err = -EINVAL; 3320 3320 goto err_free;
+1 -1
drivers/infiniband/core/uverbs_uapi.c
··· 517 517 count++; 518 518 if (uapi_key_is_attr(key)) 519 519 count++; 520 - WARN(count != 1, "Bad count %d key=%x", count, key); 520 + WARN(count != 1, "Bad count %u key=%x", count, key); 521 521 } 522 522 523 523 static void uapi_finalize_disable(struct uverbs_api *uapi)
+1 -1
drivers/infiniband/core/verbs.c
··· 1834 1834 netdev_speed = lksettings.base.speed; 1835 1835 } else { 1836 1836 netdev_speed = SPEED_1000; 1837 - pr_warn("%s speed is unknown, defaulting to %d\n", netdev->name, 1837 + pr_warn("%s speed is unknown, defaulting to %u\n", netdev->name, 1838 1838 netdev_speed); 1839 1839 } 1840 1840