Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp813707pxj; Thu, 20 May 2021 23:06:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRwvkGONbn00zYWxK9UJYhQom9B+5PHUAwqQKNhyTrE70JXKd7G9UDxvSzHdysvxukTmNG X-Received: by 2002:aa7:d607:: with SMTP id c7mr9069274edr.255.1621577179961; Thu, 20 May 2021 23:06:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621577179; cv=none; d=google.com; s=arc-20160816; b=Z8aa2ENumgB5gmdhNpURDCRLRaRjG+wwXnyGPPlOZhL7R4N9XmnzlATIRl1K5nQnkf NlWleUBJwpXVUpeN6by+XTc68H8Twb5wtcefKtvZ1br/2cZjz73wqGVAMvd94usBCfDv D6lzViowsZJbrTYDfNWKAgsYzxbFiGe5yqRe8ULEOK7ijjSMbPQSh6wUD8f6DEZzkROR TXoS6jciVENSB9SDcR5tiV2YxDisH3fysWyMiJNhkAn1VBhrAZTeyIpD4y3cxQmUZivc qB2iApky5s3bBx/X1vaKo3yEw8QUNqAv4XrxihUX5a8v517s5TnjJqyRkizvZhs4msxl Rflg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=kc33j5rybEcJBbwaVSn/MKbn2ie8ghQMdP8M0Psq8wk=; b=IYUyIWsVtwweVws1OBqNQdPN2QSKPvQ+2W4FD+edmYP402BXBINkboeda45Jz7ZMx7 3y1BxuZgMr8jREmz6hUpjY6tUKsHSE2y5rWZZ2y02L2V3VjxDKYWsfnK2eo/IAx+VWWH Ngtl5d0rMB1ovIhVcJBstO4D7JlHWEwXmo0d+dvy2UeFV/Kvl0izpuc408JVHu5nz+a6 YVQ9xHk9wfNUufKrkPwEmia5kfUQGMVoXlE3Zsq59HfaJlLluvBqij6FnpyBansKIdj5 8oAFFm7/JWl8naavYmNiA/GZjGWUGLicZ+Ufpg89/xtYHqCO44vYZLeqlkU5mr1JBRul hxBg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rl19si4539197ejb.50.2021.05.20.23.05.56; Thu, 20 May 2021 23:06:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232377AbhETP2G (ORCPT + 99 others); Thu, 20 May 2021 11:28:06 -0400 Received: from mail-lj1-f178.google.com ([209.85.208.178]:47083 "EHLO mail-lj1-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232073AbhETP14 (ORCPT ); Thu, 20 May 2021 11:27:56 -0400 Received: by mail-lj1-f178.google.com with SMTP id e11so20203490ljn.13; Thu, 20 May 2021 08:26:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=kc33j5rybEcJBbwaVSn/MKbn2ie8ghQMdP8M0Psq8wk=; b=PAXXKAxQZL8MgVTPG3wd/ik7ROof50zC6pBok7aZEp1Xk5lBvyyVEUQluC4Icyh91A z33RFFRJ3uw+27i1Uh4GN24wmdkHIsWsiWf0eN0oozGqYKWACbQys+x6e30b17O9YN/1 h57CL0NjzxR9S7Fry0DKmF7egeDnH8jms96oSWlWMToXNeHSQpZcBZiUyuxuxcYtEKHS TDxTC3oec7ucfSrT0me6mZdXmHtJWj+KfMqJ3VdVdBR0z63kBWjQbDzbJGr2necHTJXG vDpGYwDdWVJiANSyQvngEwnuwb8tCc0HdOj7sJ83r8naEBrxBTMVS95UA6ZHVCpuybq/ 4viA== X-Gm-Message-State: AOAM532OauOBIT8vTLH/QzQIzf76AIKeDG+uQ2DzM6OzfzIG882KnftN dWq8phAY4BhC9P7VFYrCnui1CVpFEhMPuCJy X-Received: by 2002:a2e:9d09:: with SMTP id t9mr841682lji.213.1621524393713; Thu, 20 May 2021 08:26:33 -0700 (PDT) Received: from rocinante.localdomain ([95.155.85.46]) by smtp.gmail.com with ESMTPSA id j1sm328967lfg.166.2021.05.20.08.26.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 May 2021 08:26:33 -0700 (PDT) Date: Thu, 20 May 2021 17:26:32 +0200 From: Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= To: Amey Narkhede Cc: Bjorn Helgaas , alex.williamson@redhat.com, raphael.norwitz@nutanix.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH RESEND v2 3/7] PCI: Add new array for keeping track of ordering of reset methods Message-ID: <20210520152632.GC641812@rocinante.localdomain> References: <20210519235426.99728-1-ameynarkhede03@gmail.com> <20210519235426.99728-4-ameynarkhede03@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210519235426.99728-4-ameynarkhede03@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Amey, [...] > +/* > + * The ordering for functions in pci_reset_fn_methods > + * is required for reset_methods byte array defined > + * in struct pci_dev > + */ A small nitpick: missing period at the end of the sentence in the comment above, and in other comments too. Might add for completeness and consistency. [...] > +typedef int (*pci_reset_fn_t)(struct pci_dev *, int); > + > +struct pci_reset_fn_method { > + pci_reset_fn_t reset_fn; > + char *name; > +}; Question about the custom type definition above: would it be really needed? It there is only potentially a limited use for it, then perhaps it would not be useful to have one? Linus also has some preference on usage of custom types, as per: https://yarchive.net/comp/linux/typedefs.html But, in the end, this really boils down to a matter of style and/or preference. [...] > +#define PCI_RESET_FN_METHODS 5 Not sure if worth changing name of this constant, but what about the following: #define PCI_RESET_FN_METHODS_NUM 5 Or even perhaps: #define PCI_RESET_METHODS_NUM 5 So it's a little bit more self-explanatory. This would be in the similar notion, as per: https://elixir.bootlin.com/linux/v5.13-rc2/source/include/linux/pci.h#L115 [...] > + u8 reset_methods[PCI_RESET_FN_METHODS]; /* Array for storing ordering of reset methods */ This comment reads somewhat awkward - we know that an array would be used, most likely, for storing things, thus what about the following: /* Reset methods ordered by priority */ Just a suggestion, though. Krzysztof