lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <484b69ec3d9269ec830453d7c3c3b2c60b15ab40.camel@perches.com>
Date:   Fri, 26 Jun 2020 16:11:53 -0700
From:   Joe Perches <joe@...ches.com>
To:     "Brady, Alan" <alan.brady@...el.com>,
        "Kirsher, Jeffrey T" <jeffrey.t.kirsher@...el.com>,
        "davem@...emloft.net" <davem@...emloft.net>
Cc:     "Michael, Alice" <alice.michael@...el.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "nhorman@...hat.com" <nhorman@...hat.com>,
        "sassmann@...hat.com" <sassmann@...hat.com>,
        "Burra, Phani R" <phani.r.burra@...el.com>,
        "Hay, Joshua A" <joshua.a.hay@...el.com>,
        "Chittim, Madhu" <madhu.chittim@...el.com>,
        "Linga, Pavan Kumar" <pavan.kumar.linga@...el.com>,
        "Skidmore, Donald C" <donald.c.skidmore@...el.com>,
        "Brandeburg, Jesse" <jesse.brandeburg@...el.com>,
        "Samudrala, Sridhar" <sridhar.samudrala@...el.com>
Subject: Re: [net-next v3 06/15] iecm: Implement mailbox functionality

On Fri, 2020-06-26 at 17:44 +0000, Brady, Alan wrote:
> > -----Original Message-----
> > From: Joe Perches <joe@...ches.com>
> > Sent: Thursday, June 25, 2020 7:58 PM
> > To: Kirsher, Jeffrey T <jeffrey.t.kirsher@...el.com>; davem@...emloft.net
> > Cc: Michael, Alice <alice.michael@...el.com>; netdev@...r.kernel.org;
> > nhorman@...hat.com; sassmann@...hat.com; Brady, Alan
> > <alan.brady@...el.com>; Burra, Phani R <phani.r.burra@...el.com>; Hay,
> > Joshua A <joshua.a.hay@...el.com>; Chittim, Madhu
> > <madhu.chittim@...el.com>; Linga, Pavan Kumar
> > <pavan.kumar.linga@...el.com>; Skidmore, Donald C
> > <donald.c.skidmore@...el.com>; Brandeburg, Jesse
> > <jesse.brandeburg@...el.com>; Samudrala, Sridhar
> > <sridhar.samudrala@...el.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.michael@...el.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.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ