From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f173.google.com (mail-pd0-f173.google.com [209.85.192.173]) by dpdk.org (Postfix) with ESMTP id E4AAA2716 for ; Fri, 15 May 2015 19:08:27 +0200 (CEST) Received: by pdfh10 with SMTP id h10so18139681pdf.3 for ; Fri, 15 May 2015 10:08:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=FYMYXsixBukvhstZ/gbJQFiVQGitDc2Uvz5MPrhfVlQ=; b=jX8dJgX4kx+p1Oyb1tSsuBmdh7iRInXmmnUobR/Vyg/5wko32PPeyUTyaUlz3C8atF V+7OrCL+slVROY3Vhe+5MICDjThiNe6ig4XGQ4j55I3fV9PmmeCejBm8OWlN/znyFRsB 89qADDNCaRJ+k8WPo41f3UYarbQv92r1gbFvu8JGzlaRNTxJpmlAVSNYjONfsqICrsIh EPrxIXWwnJDcB8HtXTXmH+xzn3enxgsGqx+LZqqPEyH3V4R1pPp6w8LMs8mSNb0iKEDb v1stgMD2l0cOru0MZkL3sfQ+F2Waqg2+TLxS0+sIh3JykHJOZK2dzFH4Zt8LU8KJOjlu yE0g== X-Gm-Message-State: ALoCoQkImbAL6PulCAChzNQfCztolWDb3+HSPmBuwHFfNVJDeWoVsixsf+Yvg8bMBkiPVI3pSSla X-Received: by 10.66.145.162 with SMTP id sv2mr20088639pab.124.1431709707378; Fri, 15 May 2015 10:08:27 -0700 (PDT) Received: from urahara.home.lan (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by mx.google.com with ESMTPSA id sc1sm2415592pac.36.2015.05.15.10.08.25 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 15 May 2015 10:08:26 -0700 (PDT) From: Stephen Hemminger To: helin.zhang@intel.com Date: Fri, 15 May 2015 10:08:23 -0700 Message-Id: <1431709707-5281-2-git-send-email-stephen@networkplumber.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1431709707-5281-1-git-send-email-stephen@networkplumber.org> References: <1431709707-5281-1-git-send-email-stephen@networkplumber.org> Cc: dev@dpdk.org Subject: [dpdk-dev] [PATCH 1/5] ixgbe: remove unnecessary casts X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2015 17:08:28 -0000 Don't do unnecessary casts when logging messages. Better to use the correct printf format code. Signed-off-by: Stephen Hemminger --- 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