From 7bc39dac4a088617175b559323ff4b6d74bd5d48 Mon Sep 17 00:00:00 2001 From: Kalesh AP Date: Tue, 21 Apr 2020 14:33:44 -0700 Subject: [PATCH] net/bnxt: use macro for PCI log format Use PCI_PRI_FMT instead of "%04x:%02x:%02x:%02x" print format. Signed-off-by: Kalesh AP Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_hwrm.c | 6 +++--- drivers/net/bnxt/bnxt_ring.c | 2 +- drivers/net/bnxt/bnxt_vnic.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index 09a73286b3..4c0fac6be1 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -1104,7 +1104,7 @@ int bnxt_hwrm_ver_get(struct bnxt *bp, uint32_t timeout) dev_caps_cfg = rte_le_to_cpu_32(resp->dev_caps_cfg); if (bp->max_resp_len != max_resp_len) { - sprintf(type, "bnxt_hwrm_%04x:%02x:%02x:%02x", + sprintf(type, "bnxt_hwrm_" PCI_PRI_FMT, bp->pdev->addr.domain, bp->pdev->addr.bus, bp->pdev->addr.devid, bp->pdev->addr.function); @@ -1139,7 +1139,7 @@ int bnxt_hwrm_ver_get(struct bnxt *bp, uint32_t timeout) (dev_caps_cfg & HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_REQUIRED)) || bp->hwrm_max_ext_req_len > HWRM_MAX_REQ_LEN) { - sprintf(type, "bnxt_hwrm_short_%04x:%02x:%02x:%02x", + sprintf(type, "bnxt_hwrm_short_" PCI_PRI_FMT, bp->pdev->addr.domain, bp->pdev->addr.bus, bp->pdev->addr.devid, bp->pdev->addr.function); @@ -2574,7 +2574,7 @@ int bnxt_alloc_hwrm_resources(struct bnxt *bp) struct rte_pci_device *pdev = bp->pdev; char type[RTE_MEMZONE_NAMESIZE]; - sprintf(type, "bnxt_hwrm_%04x:%02x:%02x:%02x", pdev->addr.domain, + sprintf(type, "bnxt_hwrm_" PCI_PRI_FMT, pdev->addr.domain, pdev->addr.bus, pdev->addr.devid, pdev->addr.function); bp->max_resp_len = HWRM_MAX_RESP_LEN; bp->hwrm_cmd_resp_addr = rte_malloc(type, bp->max_resp_len, 0); diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c index 1999cd7861..24a947f278 100644 --- a/drivers/net/bnxt/bnxt_ring.c +++ b/drivers/net/bnxt/bnxt_ring.c @@ -196,7 +196,7 @@ int bnxt_alloc_rings(struct bnxt *bp, uint16_t qidx, total_alloc_len += tpa_info_len; snprintf(mz_name, RTE_MEMZONE_NAMESIZE, - "bnxt_%04x:%02x:%02x:%02x-%04x_%s", pdev->addr.domain, + "bnxt_" PCI_PRI_FMT "-%04x_%s", pdev->addr.domain, pdev->addr.bus, pdev->addr.devid, pdev->addr.function, qidx, suffix); mz_name[RTE_MEMZONE_NAMESIZE - 1] = 0; diff --git a/drivers/net/bnxt/bnxt_vnic.c b/drivers/net/bnxt/bnxt_vnic.c index bc054a8e0e..326c0d1b6d 100644 --- a/drivers/net/bnxt/bnxt_vnic.c +++ b/drivers/net/bnxt/bnxt_vnic.c @@ -136,7 +136,7 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp) max_vnics = bp->max_vnics; snprintf(mz_name, RTE_MEMZONE_NAMESIZE, - "bnxt_%04x:%02x:%02x:%02x_vnicattr", pdev->addr.domain, + "bnxt_" PCI_PRI_FMT "_vnicattr", pdev->addr.domain, pdev->addr.bus, pdev->addr.devid, pdev->addr.function); mz_name[RTE_MEMZONE_NAMESIZE - 1] = 0; mz = rte_memzone_lookup(mz_name); -- 2.39.5