Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1149124pxj; Fri, 21 May 2021 07:34:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy04qujiqa456NqszMx/Ke7J4npz2II2RoTcVt4v2wo7dqqZkAQ4Pdf0b21ayGnNDX0Lwv2 X-Received: by 2002:a17:907:1b20:: with SMTP id mp32mr10825749ejc.495.1621607696006; Fri, 21 May 2021 07:34:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621607695; cv=none; d=google.com; s=arc-20160816; b=rEUF2LxCnBCAqPznU1oyhRqjhW6ru/jGM7NkXn5z+Nx0R3vLNlTna5QCyZtVxYVQzg 3Zxh+ymVOZP5f/9cMaCaa6wialOrB95Htp79kYRsUtEWSrrJIMcBLrLklfLhuZnkqUuK +JeUPss3+uPOBm8WzPS1bsXZGL41fqOSK71pKZ3sS5e7KcxqHCVQhsgeGYKT9KN6PHcx 5cEbMjbKTnEFhRksFvtF5oz5+OBATmOOeCFmGViHIOODavFEsuFs+cGYtZ8/7zYby6c9 f2J83IqwcMvQRmxAKA4j5Vwy6ISFfDhEga3k04QziH9snXUR+pb0irqaDEb+/eqOIz5n 005A== 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=3YFOofnGkedJCrPa1Dyp3yag+zkaw/LioaIxjLT1KkA=; b=Tmqhrm1wekyjxmXvaZ+AbI0WZwb2cv5xIwHSe+kIYCCIdULMRCrF/MXkyCDgLvwMi1 YMa7rK5rnOCTOA0LTFWPWUuwgliQBtuTLFMqoSGvey+wmKYmtTlNkwY7mR2EHfxXVYES 6O7qDdnPAnij6QWHLa9waWHuLS5Zetv36QqgngUXavCa5DvPXVRMFiJtSmngrl/YPfOA z6GaA9j8QvKHJ7+ofccmGt4BJ5WZ4/mhaKxm4s4e35hAmvIYElxMTS7vB836VwtNRKrx 6S7IcFNBelfIR8yp2ZaeSHoH0ciy3m678uML55kG3SayaZw6FwNPV4ilbmwXQJ0nakw3 z+Vw== 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 y16si6345657edq.499.2021.05.21.07.34.31; Fri, 21 May 2021 07:34:55 -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 S232033AbhETO4Q (ORCPT + 99 others); Thu, 20 May 2021 10:56:16 -0400 Received: from mail-ej1-f45.google.com ([209.85.218.45]:42658 "EHLO mail-ej1-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230450AbhETO4P (ORCPT ); Thu, 20 May 2021 10:56:15 -0400 Received: by mail-ej1-f45.google.com with SMTP id lg14so25748781ejb.9; Thu, 20 May 2021 07:54:53 -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=3YFOofnGkedJCrPa1Dyp3yag+zkaw/LioaIxjLT1KkA=; b=EMutIRPQhBWuWmxj6dNnACRSWqWfgNsM4Q4nLRjpH5beuWT9N0ayupSFppfAKpY5HZ jD+fUZqvK/jyeo1MFx2KtYqv4CqKuUqGgZoJQFMZIpmZzE1l+1GYS6v0vQYxR1Uz1op+ tC1h02Y0H0PRWKAn7GtIg8KDKKMdMYgL08w6gcsklQIFtzxbWdQSghOWuzgiUfF+boGq nr0XSKq8MjWpWXha1cmqv/THqw0E2UAn1doPgFGpPc9TQyYBw4Nk+1yrdRKx2GXDJOHP 1NoVkcY7xPpUKOHA16eB4EBz+VELN1QxmB1awOV3QVFCi8+AtBjioTeblKGb7CJvC2c4 3EbA== X-Gm-Message-State: AOAM531mrVVM4S5XU8CtR/8E0upy2nRvRI6QvDIyiMRVM2hI70zmYiVi XFFIzELnezvwQa2as+JmrN8= X-Received: by 2002:a17:906:7e0f:: with SMTP id e15mr5021933ejr.398.1621522492790; Thu, 20 May 2021 07:54:52 -0700 (PDT) Received: from rocinante.localdomain ([95.155.85.46]) by smtp.gmail.com with ESMTPSA id yr15sm1563389ejb.16.2021.05.20.07.54.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 May 2021 07:54:51 -0700 (PDT) Date: Thu, 20 May 2021 16:54:50 +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 1/7] PCI: merge slot and bus reset implementations Message-ID: <20210520145450.GA641812@rocinante.localdomain> References: <20210519235426.99728-1-ameynarkhede03@gmail.com> <20210519235426.99728-2-ameynarkhede03@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210519235426.99728-2-ameynarkhede03@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Amey, Thank you for working on this! Few comments and suggestions below. [...] > Link: https://lkml.org/lkml/2021/3/23/911 Linking to lkml.org is fine, however it became a canon now to link to lore, so this would be: https://lore.kernel.org/lkml/20210323100625.0021a943@omen.home.shazbot.org/ I personally find it a bit easier to read on lore compared to lkml.org when it goes to a large and long running threads. [...] > +int pci_reset_bus_function(struct pci_dev *dev, int probe) > +{ > + int rc = pci_dev_reset_slot_function(dev, probe); > + > + if (rc != -ENOTTY) > + return rc; > + return pci_parent_bus_reset(dev, probe); > +} Depends on the style, but I would suggest using a boolean type for the probe argument here and in the other functions that enable or disable something. I makes the intent clear, and this is also a popular pattern you can see throughout the PCI tree. Also, I would suggest adding a newline to separate final return, so that it's easier to read the code, and to keep things consistent. [...] > - rc = pci_dev_reset_slot_function(dev, 0); > - if (rc != -ENOTTY) > - return rc; > - return pci_parent_bus_reset(dev, 0); > + return pci_reset_bus_function(dev, 0); See above about using boolean type here. [...] > - rc = pci_dev_reset_slot_function(dev, 1); > if (rc != -ENOTTY) > return rc; > > - return pci_parent_bus_reset(dev, 1); > + return pci_reset_bus_function(dev, 1); Same as above. Krzysztof