Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp554752lqh; Thu, 28 Mar 2024 09:19:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX4sPKRKtq/W9P1U7nuiw3bnSIo5QGNryfvurC3/S4t7pI0VtKTdXOCgr6hxsl4U0EBvV+4Ia6P+zmyIJqqntZGO17V0LO1OhVPEKaspg== X-Google-Smtp-Source: AGHT+IFMH139p//+ChCHu9p0cg8/c+ThPWASOXT6gEw6eSihx0hTSnJNJ8qf0LOaKeFzRPkIgaq+ X-Received: by 2002:a17:90a:c90b:b0:2a0:50ce:aa95 with SMTP id v11-20020a17090ac90b00b002a050ceaa95mr3383804pjt.21.1711642761034; Thu, 28 Mar 2024 09:19:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711642761; cv=pass; d=google.com; s=arc-20160816; b=GbOXhlKbCbp4I7gP0YLwOXsQVkINWqMGa7Uuf3n6qiluL6a9BcOYnT/hmqjzi9oa44 uqIivLfg4OzE4MrWVwJ9091g5BroovK9mbyMHaHTY2E1RaoHxBithcwSueY8E3999Szz t9NdJKD4HiLhJ6Uw37phd0mcPxLSApMxwJG/KVNzL2PEcu1mP5APFBAFt683pgWG7tEv tEz79v4Z39c+YSBhU4Zyq50cozyQxTQIHRK++U9AbP/ZUFierLlrefMuh7L39TOt3yOZ WCa8c3lXVdKChv/10AP1FQlc3lvYQrvuyIfXrobY+sKoDAD/ZlGSkt0BuRoAqZ+a3JMS LnOA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:subject:cc:to:from :date:dkim-signature; bh=TzhK2bRz3T5RU/YYc5dQxThJBpmO4Wwkx/2XhI+CX6E=; fh=yK2n++JhTotdueNfyYK6kdD1nlm8NmpRYjfLwu5eqPQ=; b=nerkH2KQ/JCBWIfg9WL25YDtzyKUA3uEKFctYomvFXjdyHtCjBvT+L6q1ZhNCBy7Ch nOL1Wuiz/WrOihPCA7riiqAdr1JcjyQDI0LK/Kl/UBtBtbhOy0SPjnL2fAlZB6Ty76C6 hGQXymUU/+2miXnWEebH5xHyt6JND1bxcwN3I4w7YN1MXke2EZRKqH0Ayid/u1L1T3cU P4gVabdlmxfYhNPvYOjiorBRPHndpyPMZ7oOREWpCKhPGrRmSiWYBxtVxXuwqAfug01i SeyHGS3oNLtVBWM5ZniiKNoi7UN7bIccc469e8f6FLzDsmdB5Y4GYx2mml04E0gTwVdj xAmg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qAFGfBxE; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-123231-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123231-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id y6-20020a17090aa40600b0029acb9d5bffsi1752709pjp.189.2024.03.28.09.19.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 09:19:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-123231-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qAFGfBxE; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-123231-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123231-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id A35BC28CFD1 for ; Thu, 28 Mar 2024 16:19:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4CC24131E59; Thu, 28 Mar 2024 16:18:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qAFGfBxE" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 59EBA131BC8; Thu, 28 Mar 2024 16:18:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711642714; cv=none; b=oJjIokW7d1TY6SzSqm3X9YeWIQVR6WoHKZ2mzNulbunzccyPVrxMYWXJbiVvFe2TYiccH+Q9iLeAVOVxoh+WW9gdgT7eW/714sSkp3hcsyGXR22UmgYjZ1UpeoTsJJw4T2z4wajJkCGz4MmlVNUBcqwU4kh11ihGqh6uOpwM0FU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711642714; c=relaxed/simple; bh=kZE5AQy7q/LkMQXaYZMu1agyq0gLCEHxcP10dCKXXmA=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=N7Ye0wFAE2CvrQKZI9l1sJpQmS0sX8jfAKmvxJKWdlqdkV2Z9l/Sd8g72Tj7su/tSdt0rIo5bUrw0UWUX977sUHTgflRTYripwcY0vrbWWZx5hzBUCA3mJzwZorU/AfYLT9ThabzD+rNPB66fDd38EHf4Ql+Kh2XMnUAp7mRA3o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qAFGfBxE; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3B84C433C7; Thu, 28 Mar 2024 16:18:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711642713; bh=kZE5AQy7q/LkMQXaYZMu1agyq0gLCEHxcP10dCKXXmA=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=qAFGfBxELR+ImPcOXEz66ekn6o0evwu/KFpr16+y5/qZlMU4On5lREdB3uM9ZNxoI kuFSm2UUX//Zc0nwmIewtAYqwtxKjJVQlDhRPixHkcRL6X/y5eKyw3bOTJIznpbxni gS+mONTxLOb8H65jU9sxsolIVrIuSqLGeV2wgGjxwGeXoF0nFBiwGznsUUzcde5abI ZJ5ejZ7dxAlhJ/FkQnp3POg3ZExwLp5vTNnQZvfWWNMzLKfE5NP4+Ab4nLCcDNl0Vn NpH8n/VGZVvZ+E47Zy5qAlJ2sqVOfXwYA3Z+voB3MA6+mhf6kfbbvTcKzbYHmvsy4i /tcB1/Xk26r7w== Date: Thu, 28 Mar 2024 11:18:31 -0500 From: Bjorn Helgaas To: Kuppuswamy Sathyanarayanan Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Helgaas Subject: Re: [PATCH] PCI: Update pci_find_capability() stub return values Message-ID: <20240328161831.GA1568357@bhelgaas> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Wed, Mar 27, 2024 at 02:49:34PM -0700, Kuppuswamy Sathyanarayanan wrote: > On 3/27/24 11:02 AM, Bjorn Helgaas wrote: > > From: Bjorn Helgaas > > > > f646c2a0a668 ("PCI: Return u8 from pci_find_capability() and similar") and > > ee8b1c478a9f ("PCI: Return u16 from pci_find_ext_capability() and similar") > > updated the return type of the extern declarations, but neglected to update > > the type of the stubs used CONFIG_PCI is not enabled. > > > > Update them to match the extern declarations. > > > > Signed-off-by: Bjorn Helgaas > > --- > > This change looks fine to me. > > Reviewed-by: Kuppuswamy Sathyanarayanan Thanks for reviewing it! > But the callers of these functions still seems to use int > declaration to store the output. Any reason for not changing them? > Like the usages in drivers/pci/pci.c? This patch is just to make the extern declarations match the stubs. No particular reason not to change users other than I didn't want to change the users before the declarations (to avoid warnings about assigning an int to a u8 or u16), and there's not a lot of value in changing local variables, where an int is just on the stack and works fine. Changing stored values in a struct would have more benefit. I took a quick look and found these possibilities: struct controller.cap_offset (drivers/pci/hotplug/shpchp.h SHPC cap) struct pci_sriov.pos (drivers/pci/pci.h SR-IOV ext cap) struct altera_pcie_data.cap_offset (drivers/pci/controller/pcie-altera.c PCIe cap) struct tg3.msi_cap (broadcom/tg3.h MSI cap) struct tg3.pcix_cap (broadcom/tg3.h PCI-X cap) struct bnx2.pm_cap (broadcom/bnx2.h PM cap) struct bnx2.pcix_cap (broadcom/bnx2.h PCI-X cap) struct bnx2x_sriov.cap (broadcom/bnx2x/bnx2x_sriov.h SR-IOV ext cap) struct amd8111e_priv.pm_cap (amd/amd8111e.c, removed [1]) struct pci_params.pm_cap (qlogic/qed/qed.h, removed [2]) struct qed_hw_sriov_info.cap (qlogic/qed/qed_sriov.h SR-IOV ext cap) struct eeh_dev.pcix_cap (powerpc/include/asm/eeh.h PCI-X cap) struct eeh_dev.pcie_cap (powerpc/include/asm/eeh.h PCIe cap) struct eeh_dev.aer_cap (powerpc/include/asm/eeh.h AER ext cap) struct eeh_dev.af_cap (powerpc/include/asm/eeh.h AF cap) struct icm.vnd_cap (drivers/thunderbolt/icm.c VNDR ext cap) [1] https://lore.kernel.org/all/20240325220633.1453180-1-helgaas@kernel.org/ [2] https://lore.kernel.org/all/20240325224931.1462051-1-helgaas@kernel.org/ Bjorn