From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C3621A04C8; Fri, 18 Sep 2020 10:39:48 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 87C211D91D; Fri, 18 Sep 2020 10:39:47 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 93A0B1D919 for ; Fri, 18 Sep 2020 10:39:46 +0200 (CEST) IronPort-SDR: ClZjHRGRqaoZIJ1b0Fst2GTjL7d8PNyHXeP5Sh/dik4zFDULCVu8M/klElmKhtrGZBNxBx7SgH ICte9YxqiRyQ== X-IronPort-AV: E=McAfee;i="6000,8403,9747"; a="244724675" X-IronPort-AV: E=Sophos;i="5.77,274,1596524400"; d="scan'208";a="244724675" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Sep 2020 01:39:45 -0700 IronPort-SDR: Ev6SgWuA+iGi4+09n2u+a/qePyrMW2jTvznAOKcLi6YeQiUpTozPZExsOuEyX5IdifFgGK2xQY Grq0kq71xkxg== X-IronPort-AV: E=Sophos;i="5.77,274,1596524400"; d="scan'208";a="508784334" Received: from bricha3-mobl.ger.corp.intel.com ([10.249.147.177]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 18 Sep 2020 01:39:42 -0700 Date: Fri, 18 Sep 2020 09:39:38 +0100 From: Bruce Richardson To: "Chen, Mike Ximing" Cc: "McDaniel, Timothy" , "dev@dpdk.org" , "Carrillo, Erik G" , "Eads, Gage" , "Van Haaren, Harry" , "jerinj@marvell.com" Message-ID: <20200918083938.GC1583@bricha3-MOBL.ger.corp.intel.com> References: <1599855987-25976-1-git-send-email-timothy.mcdaniel@intel.com> <1599855987-25976-8-git-send-email-timothy.mcdaniel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [dpdk-dev] [PATCH 07/22] event/dlb2: add xstats X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, Sep 18, 2020 at 12:37:58AM +0000, Chen, Mike Ximing wrote: > > > > -----Original Message----- > > From: McDaniel, Timothy > > Sent: Thursday, September 17, 2020 5:26 PM > > To: Chen, Mike Ximing > > Cc: dev@dpdk.org; Carrillo, Erik G ; Eads, Gage > > ; Van Haaren, Harry ; > > jerinj@marvell.com > > Subject: RE: [dpdk-dev] [PATCH 07/22] event/dlb2: add xstats > > > > > > > > > -----Original Message----- > > > From: Chen, Mike Ximing > > > Sent: Thursday, September 17, 2020 3:58 PM > > > To: McDaniel, Timothy > > > Cc: dev@dpdk.org; Carrillo, Erik G ; Eads, > > > Gage ; Van Haaren, Harry > > > ; jerinj@marvell.com > > > Subject: RE: [dpdk-dev] [PATCH 07/22] event/dlb2: add xstats > > > > > > > > > > +dlb2_eventdev_dump(struct rte_eventdev *dev, FILE *f) { > > > > + struct dlb2_eventdev *dlb2; > > > > + struct dlb2_hw_dev *handle; > > > > + int i; > > > > + > > > > + if (!f) { > > > > + printf("Invalid file pointer\n"); > > > > + return; > > > > + } > > > > + > > > > + if (!dev) { > > > > + fprintf(f, "Invalid event device\n"); > > > > + return; > > > > + } > > > > + > > > > + dlb2 = dlb2_pmd_priv(dev); > > > > + > > > > + if (!dlb2) { > > > > + fprintf(f, "DLB2 Event device cannot be dumped!\n"); > > > > + return; > > > > + } > > > > + > > > > > > Not sure if this is enforced. The DPDK coding style discourages using > > > ! on pointers ( see section 1. 8.1 at > > > https://doc.dpdk.org/guides/contributing/coding_style.html). > > > > > > > I see !ptr used in many other dpdk components, and it is not flagged by > > checkpatch either. > > > Yes, I do see !ptr in dpdk functions. I guess the rule is not enforced. Not strictly enforced, no, but for new code we should always endeavour to follow the standards. If a new revision of this patch will be done, please have all pointer comparisons checking for NULL explicitly in that version. Thanks, /Bruce