From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v2] pci: pad vendor and device ID to 4 digits Date: Wed, 05 Jul 2017 15:16:44 +0200 Message-ID: <2177838.ELAm1vN6DR@xps> References: <20170623172941.14423-1-daniel.verkamp@intel.com> <20170623182032.28734-1-daniel.verkamp@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, Stephen Hemminger To: Daniel Verkamp Return-path: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id B6E6B2C4A for ; Wed, 5 Jul 2017 15:16:45 +0200 (CEST) In-Reply-To: <20170623182032.28734-1-daniel.verkamp@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 23/06/2017 20:20, Daniel Verkamp: > Some PCI vendor and device IDs have leading zeros. > > Signed-off-by: Daniel Verkamp > --- > --- a/lib/librte_eal/common/include/rte_pci.h > +++ b/lib/librte_eal/common/include/rte_pci.h > @@ -68,6 +68,9 @@ const char *pci_get_sysfs_path(void); > /** Short formatting string, without domain, for PCI device: Ex: 00:01.0 */ > #define PCI_SHORT_PRI_FMT "%.2" PRIx8 ":%.2" PRIx8 ".%" PRIx8 > > +/** Formatting string for PCI vendor and device ID: Ex: 1234:5678 */ > +#define PCI_ID_PRI_FMT "%.4" PRIx16 ":%.4" PRIx16 Why not printing the whole PCI infos with domain and function? Note: public macros should be prefixed with RTE_