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=-6.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 9B018C432BE for ; Wed, 28 Jul 2021 17:55:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 816566104F for ; Wed, 28 Jul 2021 17:55:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231232AbhG1Rza (ORCPT ); Wed, 28 Jul 2021 13:55:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:39374 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231222AbhG1Rz2 (ORCPT ); Wed, 28 Jul 2021 13:55:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C335D61050; Wed, 28 Jul 2021 17:55:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627494926; bh=eR8Mb5mftbz5DEwh6BIcjxWxE2NDjLa/HY+rtPuS9Vc=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=NBwah9bZgNw8mAa/hy200SaKVPPUf1pG5zNHfsFuI7DCrIdyePnsfyF2sXrGWm4O5 BHzg3H5l5A8IKUCzt15r6OYMiPLUSPnfQkAoyp6Bz+VFoas/XkFnd1eigmYIlgTbRs cT78xYg68AOSUrm2j6jmU1NMkud+PR/zFJOznMttNDBx8kGW654eekl0zrf6Dis7CB aHmylcxM+f/sch4yg1QMBKL9Esh1DEAX22aMJ8/bn4Z9ED9mBAmjlbRZmjcLvROTH/ wpO++JjkQMyJg7ZM+SIavBU+futcLJfhqud03dX1cswHe9Nz9jmZmjILFXIWUUhbvK xW7FIZWiotJDw== Date: Wed, 28 Jul 2021 12:55:24 -0500 From: Bjorn Helgaas To: Amey Narkhede Cc: alex.williamson@redhat.com, Raphael Norwitz , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, kw@linux.com, Shanker Donthineni , Sinan Kaya , Len Brown , "Rafael J . Wysocki" Subject: Re: [PATCH v10 8/8] PCI: Change the type of probe argument in reset functions Message-ID: <20210728175524.GA834270@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210728173514.77yiv2vjvjpf6ao5@archlinux> Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Wed, Jul 28, 2021 at 11:05:14PM +0530, Amey Narkhede wrote: > On 21/07/27 05:22PM, Bjorn Helgaas wrote: > > On Fri, Jul 09, 2021 at 06:08:13PM +0530, Amey Narkhede wrote: > > > Introduce a new enum pci_reset_mode_t to make the context of probe argument > > > in reset functions clear and the code easier to read. Change the type of > > > probe argument in functions which implement reset methods from int to > > > pci_reset_mode_t to make the intent clear. > > > > Not sure adding an enum and a PCI_RESET_MODE_MAX seems worth it to me. > > It's really a boolean parameter, and I'd be happy to change it to a > > bool. But I don't think it's worth checking against > > PCI_RESET_MODE_MAX unless we need more than two options. > > > Is it okay to use PCI_RESET_PROBE and PCI_RESET_DO_RESET as bool. > That would be less confusing than directly using true/false. You mean like this? #define PCI_RESET_DO_RESET false #define PCI_RESET_PROBE true I don't think there's a huge amount of value, but I guess that's OK as long as it's confined to drivers/pci/, i.e., not exposed via include/linux/pci.h.