On Fri, Sep 18, 2020 at 12:37:58AM +0000, Chen, Mike Ximing wrote:
> 
> 
> > -----Original Message-----
> > From: McDaniel, Timothy <timothy.mcdan...@intel.com>
> > Sent: Thursday, September 17, 2020 5:26 PM
> > To: Chen, Mike Ximing <mike.ximing.c...@intel.com>
> > Cc: dev@dpdk.org; Carrillo, Erik G <erik.g.carri...@intel.com>; Eads, Gage
> > <gage.e...@intel.com>; Van Haaren, Harry <harry.van.haa...@intel.com>;
> > jer...@marvell.com
> > Subject: RE: [dpdk-dev] [PATCH 07/22] event/dlb2: add xstats
> > 
> > 
> > 
> > > -----Original Message-----
> > > From: Chen, Mike Ximing <mike.ximing.c...@intel.com>
> > > Sent: Thursday, September 17, 2020 3:58 PM
> > > To: McDaniel, Timothy <timothy.mcdan...@intel.com>
> > > Cc: dev@dpdk.org; Carrillo, Erik G <erik.g.carri...@intel.com>; Eads,
> > > Gage <gage.e...@intel.com>; Van Haaren, Harry
> > > <harry.van.haa...@intel.com>; jer...@marvell.com
> > > Subject: RE: [dpdk-dev] [PATCH 07/22] event/dlb2: add xstats
> > >
> > > <snip>
> > > > +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

Reply via email to