From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64079C433E0 for ; Fri, 26 Jun 2020 23:11:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4739A2073E for ; Fri, 26 Jun 2020 23:11:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726256AbgFZXL6 (ORCPT ); Fri, 26 Jun 2020 19:11:58 -0400 Received: from smtprelay0238.hostedemail.com ([216.40.44.238]:50542 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725883AbgFZXL6 (ORCPT ); Fri, 26 Jun 2020 19:11:58 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay04.hostedemail.com (Postfix) with ESMTP id 2C117180A7FCB; Fri, 26 Jun 2020 23:11:57 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: coach32_3c1533f26e59 X-Filterd-Recvd-Size: 3891 Received: from XPS-9350.home (unknown [47.151.133.149]) (Authenticated sender: joe@perches.com) by omf05.hostedemail.com (Postfix) with ESMTPA; Fri, 26 Jun 2020 23:11:54 +0000 (UTC) Message-ID: <484b69ec3d9269ec830453d7c3c3b2c60b15ab40.camel@perches.com> Subject: Re: [net-next v3 06/15] iecm: Implement mailbox functionality From: Joe Perches To: "Brady, Alan" , "Kirsher, Jeffrey T" , "davem@davemloft.net" Cc: "Michael, Alice" , "netdev@vger.kernel.org" , "nhorman@redhat.com" , "sassmann@redhat.com" , "Burra, Phani R" , "Hay, Joshua A" , "Chittim, Madhu" , "Linga, Pavan Kumar" , "Skidmore, Donald C" , "Brandeburg, Jesse" , "Samudrala, Sridhar" Date: Fri, 26 Jun 2020 16:11:53 -0700 In-Reply-To: References: <20200626020737.775377-1-jeffrey.t.kirsher@intel.com> <20200626020737.775377-7-jeffrey.t.kirsher@intel.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.36.2-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Fri, 2020-06-26 at 17:44 +0000, Brady, Alan wrote: > > -----Original Message----- > > From: Joe Perches > > Sent: Thursday, June 25, 2020 7:58 PM > > To: Kirsher, Jeffrey T ; davem@davemloft.net > > Cc: Michael, Alice ; netdev@vger.kernel.org; > > nhorman@redhat.com; sassmann@redhat.com; Brady, Alan > > ; Burra, Phani R ; Hay, > > Joshua A ; Chittim, Madhu > > ; Linga, Pavan Kumar > > ; Skidmore, Donald C > > ; Brandeburg, Jesse > > ; Samudrala, Sridhar > > > > 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 > > > > > > 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.