On Fri, 2020-06-26 at 17:44 +0000, Brady, Alan wrote:
> > -----Original Message-----
> > From: Joe Perches <j...@perches.com>
> > Sent: Thursday, June 25, 2020 7:58 PM
> > To: Kirsher, Jeffrey T <jeffrey.t.kirs...@intel.com>; da...@davemloft.net
> > Cc: Michael, Alice <alice.mich...@intel.com>; netdev@vger.kernel.org;
> > nhor...@redhat.com; sassm...@redhat.com; Brady, Alan
> > <alan.br...@intel.com>; Burra, Phani R <phani.r.bu...@intel.com>; Hay,
> > Joshua A <joshua.a....@intel.com>; Chittim, Madhu
> > <madhu.chit...@intel.com>; Linga, Pavan Kumar
> > <pavan.kumar.li...@intel.com>; Skidmore, Donald C
> > <donald.c.skidm...@intel.com>; Brandeburg, Jesse
> > <jesse.brandeb...@intel.com>; Samudrala, Sridhar
> > <sridhar.samudr...@intel.com>
> > Subject: Re: [net-next v3 06/15] iecm: Implement mailbox functionality
> > 
> > On Thu, 2020-06-25 at 19:07 -0700, Jeff Kirsher wrote:
> > > From: Alice Michael <alice.mich...@intel.com>
> > > 
> > > Implement mailbox setup, take down, and commands.
> > []
> > > diff --git a/drivers/net/ethernet/intel/iecm/iecm_controlq.c
> > > b/drivers/net/ethernet/intel/iecm/iecm_controlq.c
> > []
> > > @@ -73,7 +142,74 @@ enum iecm_status iecm_ctlq_add(struct iecm_hw
> > *hw,
> > >                          struct iecm_ctlq_create_info *qinfo,
> > >                          struct iecm_ctlq_info **cq)
> > 
> > Multiple functions using **cp and *cp can be error prone.
> > 
> 
> We can see how this can be confusing.  Would it be acceptable/sufficient to 
> change function parameter name to **cq_arr or **cq_list?

Your code, your choice.
        
> > >  {
> > > - /* stub */
> > > + enum iecm_status status = 0;
> > > + bool is_rxq = false;
> > > +
> > > + if (!qinfo->len || !qinfo->buf_size ||
> > > +     qinfo->len > IECM_CTLQ_MAX_RING_SIZE ||
> > > +     qinfo->buf_size > IECM_CTLQ_MAX_BUF_LEN)
> > > +         return IECM_ERR_CFG;
> > > +
> > > + *cq = kcalloc(1, sizeof(struct iecm_ctlq_info), GFP_KERNEL);
> > > + if (!(*cq))
> > > +         return IECM_ERR_NO_MEMORY;

You might use a temporary here after the alloc

        struct iecm_ctlq_info *cq;

        [...]

        *cq_arr = kcalloc(1, sizeof(struct iecm_ctlq_info), GFP_KERNEL);
        if (!*cq_arr)
                return IECM_ERR_NO_MEMORY;

        cq = *cq_arr;

so all uses of cq are consistent.


Reply via email to