DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: helin.zhang@intel.com
Cc: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 1/5] ixgbe: remove unnecessary casts
Date: Fri, 15 May 2015 10:08:23 -0700	[thread overview]
Message-ID: <1431709707-5281-2-git-send-email-stephen@networkplumber.org> (raw)
In-Reply-To: <1431709707-5281-1-git-send-email-stephen@networkplumber.org>

Don't do unnecessary casts when logging messages. Better to use
the correct printf format code.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/librte_pmd_ixgbe/ixgbe_ethdev.c | 25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
index 5f9a1cf..a585151 100644
--- a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
+++ b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
@@ -568,8 +568,8 @@ ixgbe_dev_queue_stats_mapping_set(struct rte_eth_dev *eth_dev,
 		(hw->mac.type != ixgbe_mac_X550EM_x))
 		return -ENOSYS;
 
-	PMD_INIT_LOG(INFO, "Setting port %d, %s queue_id %d to stat index %d",
-		     (int)(eth_dev->data->port_id), is_rx ? "RX" : "TX",
+	PMD_INIT_LOG(INFO, "Setting port %u, %s queue_id %d to stat index %d",
+		     eth_dev->data->port_id, is_rx ? "RX" : "TX",
 		     queue_id, stat_idx);
 
 	n = (uint8_t)(queue_id / NB_QMAP_FIELDS_PER_QSM_REG);
@@ -594,8 +594,8 @@ ixgbe_dev_queue_stats_mapping_set(struct rte_eth_dev *eth_dev,
 	else
 		stat_mappings->rqsmr[n] |= qsmr_mask;
 
-	PMD_INIT_LOG(INFO, "Set port %d, %s queue_id %d to stat index %d",
-		     (int)(eth_dev->data->port_id), is_rx ? "RX" : "TX",
+	PMD_INIT_LOG(INFO, "Set port %u, %s queue_id %d to stat index %d",
+		     eth_dev->data->port_id, is_rx ? "RX" : "TX",
 		     queue_id, stat_idx);
 	PMD_INIT_LOG(INFO, "%s[%d] = 0x%08x", is_rx ? "RQSMR" : "TQSM", n,
 		     is_rx ? stat_mappings->rqsmr[n] : stat_mappings->tqsm[n]);
@@ -889,11 +889,11 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev)
 
 	if (ixgbe_is_sfp(hw) && hw->phy.sfp_type != ixgbe_sfp_type_not_present)
 		PMD_INIT_LOG(DEBUG, "MAC: %d, PHY: %d, SFP+: %d",
-			     (int) hw->mac.type, (int) hw->phy.type,
-			     (int) hw->phy.sfp_type);
+			     hw->mac.type, hw->phy.type,
+			     hw->phy.sfp_type);
 	else
 		PMD_INIT_LOG(DEBUG, "MAC: %d, PHY: %d",
-			     (int) hw->mac.type, (int) hw->phy.type);
+			     hw->mac.type, hw->phy.type);
 
 	PMD_INIT_LOG(DEBUG, "port %d vendorID=0x%x deviceID=0x%x",
 			eth_dev->data->port_id, pci_dev->id.vendor_id,
@@ -2307,14 +2307,13 @@ ixgbe_dev_link_status_print(struct rte_eth_dev *dev)
 	memset(&link, 0, sizeof(link));
 	rte_ixgbe_dev_atomic_read_link_status(dev, &link);
 	if (link.link_status) {
-		PMD_INIT_LOG(INFO, "Port %d: Link Up - speed %u Mbps - %s",
-					(int)(dev->data->port_id),
-					(unsigned)link.link_speed,
-			link.link_duplex == ETH_LINK_FULL_DUPLEX ?
+		PMD_INIT_LOG(INFO, "Port %u: Link Up - speed %u Mbps - %s",
+			     dev->data->port_id, link.link_speed,
+			     link.link_duplex == ETH_LINK_FULL_DUPLEX ?
 					"full-duplex" : "half-duplex");
 	} else {
-		PMD_INIT_LOG(INFO, " Port %d: Link Down",
-				(int)(dev->data->port_id));
+		PMD_INIT_LOG(INFO, "Port %u: Link Down",
+				dev->data->port_id);
 	}
 	PMD_INIT_LOG(INFO, "PCI Address: %04d:%02d:%02d:%d",
 				dev->pci_dev->addr.domain,
-- 
2.1.4

  reply	other threads:[~2015-05-15 17:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-15 17:08 [dpdk-dev] [PATCH v2 0/5] ixgbe: logging patches Stephen Hemminger
2015-05-15 17:08 ` Stephen Hemminger [this message]
2015-05-18  9:24   ` [dpdk-dev] [PATCH 1/5] ixgbe: remove unnecessary casts Bruce Richardson
2015-05-15 17:08 ` [dpdk-dev] [PATCH 2/5] ixgbe: don't print PCI address on link change Stephen Hemminger
2015-05-18  9:32   ` Bruce Richardson
2015-05-15 17:08 ` [dpdk-dev] [PATCH 3/5] ixgbe: raise priority of significant events Stephen Hemminger
2015-05-18  9:27   ` Bruce Richardson
2015-05-15 17:08 ` [dpdk-dev] [PATCH 4/5] ixgbe: use RTE_LOG not rte_log Stephen Hemminger
2015-05-18  9:28   ` Bruce Richardson
2015-05-15 17:08 ` [dpdk-dev] [PATCH 5/5] ixgbe: silence noisy log messages Stephen Hemminger
2015-05-18  9:32   ` Bruce Richardson
2015-05-18 16:39     ` Stephen Hemminger
2015-05-19  7:46       ` David Marchand
2015-05-19 14:40         ` Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1431709707-5281-2-git-send-email-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=helin.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).