Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp1152519rdb; Fri, 9 Feb 2024 11:53:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IFud4suDg8xggVBRxUbEOWKUfEIRdawRVHMYRROypX6eRErsu9bMs32fO2oj+dQXE2l3Bt/ X-Received: by 2002:aa7:c353:0:b0:561:1366:c8c0 with SMTP id j19-20020aa7c353000000b005611366c8c0mr1967042edr.24.1707508406089; Fri, 09 Feb 2024 11:53:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707508406; cv=pass; d=google.com; s=arc-20160816; b=PuskkLAWeKGniG/yxqmb9QvNccQ8U5/y0cuoPwHejc1qwfvZOP+Qg9mYbUTfCi9Z30 LXropzj8AvZ3Zo23WiOrJT/AFgM2cnLYtY/Tmw457lxearfNzueuZNNat0k+xdhRuV7w Oat0jCjcUE2cLREQAS2Lzwjz8T+mi0h0CHoEhBEPPXjbRUZNjUduZAKqUbM+fVQjYmsZ GrK9J/e91sPQDeqLCNpjDb0Ej5ss2cwbA1/6h4omAhBt1Ug9QeQ30txOti3uGljCZ1iz yIGDfm5dVKdU+rVdIT/eIu83YfoJOVaA3Fw9B1tYJo2Lz4k5iB91nI/gsT8ecRDMUxuf Q6PA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=5SjRXdM9aoNY3N5ciig8JPP236yAYfS1BTv5kATtAWo=; fh=wE1RVR9SptinaetDXMSp9Mi0rEgv24Ttz5DJw35VSfc=; b=EzIQ9XRwp9DGFawJPf05jkFPOPdauPbDl9TVsAFm49+3g0J4cV31QhbYBfp/A+z4b0 6E/sU/VfQn95YsZEv2hNSfGrFG2I3GuTfgOBf8vrPhKxRR030pjn9J/1EVNxrcxgN7DV xc8fxTGdUPOhR6ybo07uPA+HF/97O7gFH6pxE0DIrbgjilkkEi8zkJrEC6+0z0u18wrn Lh0wNYSBe0laKSA+kgDWkGUdjgHj2/fIBvSrxUM/CHSzAGt2mMfrYJUOXkqs031oaJZd PHtUpgo246urLXavn190s1C3RZkUHeZAUPYYXXmxXSKEiIFsT3MCeBihJB7ilulssOiI FNCQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HrmrLIo4; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-59907-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59907-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCU8p2l6CQj5tgXRXB4mdOslIsxynygcQgw3GD5r/UFmR0GqiHEwq5QAovQUNxBTPXV0bzMIR2ym8rikRMEG7WGrl/+QYdNLd6X0amWZ/g== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id c88-20020a509fe1000000b005612701a91dsi60034edf.91.2024.02.09.11.53.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 11:53:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59907-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HrmrLIo4; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-59907-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59907-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id C92211F25BC6 for ; Fri, 9 Feb 2024 19:53:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E0D248528E; Fri, 9 Feb 2024 19:53:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="HrmrLIo4" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) (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 3770280BFA; Fri, 9 Feb 2024 19:53:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.14 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707508396; cv=none; b=iDi0mFOQyEMcnfeWtycta45xYRTl9PRHWq/+Q+yAqhuJ9sj7zcGULywCbHEp9O/J+NU6bK/v/Z5GUnC2HQc7FU6EHfiytQYIzsOhpf6bXAbsyenUhzBlwwhV3m2Pz2iLbTQGLOcC7LKj+c+aaiIrclG8QURHvsaqdpPuBoz3V+4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707508396; c=relaxed/simple; bh=R78s8t6vdwvLdXjmTPvMxGR2jaSEL8AbB+GGaJc7J7M=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=b7Ugi4SBcfbBB07/zU2Wv5G+QhcVtEKcnHtbXtUB9/C8EzvBFhVVkExkz653MGiTJNtgzSgFy9ELv17rDGlfaeTA8tdDWaZvMhcrlyvER0z4iEjgAIb2nPWsRdu8wXVPcPA6Gno/ICUCFkxS0CXEO4uLcmon15aMQ9Paki9zYpE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=HrmrLIo4; arc=none smtp.client-ip=192.198.163.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707508394; x=1739044394; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=R78s8t6vdwvLdXjmTPvMxGR2jaSEL8AbB+GGaJc7J7M=; b=HrmrLIo4B/a2Og62rbci4gXRBuECIVCOrIahZyKK0SmnRM9X8BYGsjOp mpwZKuwninCJRHL+sUspdBjwumrvmyfP6catK44GWCDTXdDNZu9Bg9ydc nPVzzXzyFZEpzWry2skS17fkKsmU661HF7Zn+EGFH0tiMi2YZpMkTBCqY ovBBxlFmjScILvHReudO1TpoR/aT6BJ3vUjIG9HFgRJQyM1PgM+NtVK2M D2cCBbR1LhG/Lbl51PthbbhSH6/pbq3nKav/r0CO3lO3Y/xndTe6Ubk4/ KIlYhvPOefq/LPj/yzwKOV53cQEIxkoaIvuul7C5B5ShJNi16d4E1n4Wa g==; X-IronPort-AV: E=McAfee;i="6600,9927,10979"; a="1643230" X-IronPort-AV: E=Sophos;i="6.05,257,1701158400"; d="scan'208";a="1643230" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2024 11:53:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,257,1701158400"; d="scan'208";a="33103908" Received: from ticela-or-295.amr.corp.intel.com (HELO [10.209.25.188]) ([10.209.25.188]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2024 11:53:13 -0800 Message-ID: Date: Fri, 9 Feb 2024 11:53:12 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] PCI: make pcie_port_bus_type const To: "Ricardo B. Marliere" , Bjorn Helgaas Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman References: <20240208-bus_cleanup-pci2-v1-1-5e578210b6f2@marliere.net> Content-Language: en-US From: Kuppuswamy Sathyanarayanan In-Reply-To: <20240208-bus_cleanup-pci2-v1-1-5e578210b6f2@marliere.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 2/8/24 11:41 AM, Ricardo B. Marliere wrote: > Now that the driver core can properly handle constant struct bus_type, > move the pcie_port_bus_type variable to be a constant structure as well, > placing it into read-only memory which can not be modified at runtime. > > Cc: Greg Kroah-Hartman > Suggested-by: Greg Kroah-Hartman > Signed-off-by: Ricardo B. Marliere > --- Looks fine to me. Reviewed-by: Kuppuswamy Sathyanarayanan > drivers/pci/pci-driver.c | 2 +- > drivers/pci/pcie/portdrv.h | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c > index ec838f2e892e..a29098e24683 100644 > --- a/drivers/pci/pci-driver.c > +++ b/drivers/pci/pci-driver.c > @@ -1705,7 +1705,7 @@ static int pcie_port_bus_match(struct device *dev, struct device_driver *drv) > return 1; > } > > -struct bus_type pcie_port_bus_type = { > +const struct bus_type pcie_port_bus_type = { > .name = "pci_express", > .match = pcie_port_bus_match, > }; > diff --git a/drivers/pci/pcie/portdrv.h b/drivers/pci/pcie/portdrv.h > index 1f3803bde7ee..12c89ea0313b 100644 > --- a/drivers/pci/pcie/portdrv.h > +++ b/drivers/pci/pcie/portdrv.h > @@ -96,7 +96,7 @@ struct pcie_port_service_driver { > int pcie_port_service_register(struct pcie_port_service_driver *new); > void pcie_port_service_unregister(struct pcie_port_service_driver *new); > > -extern struct bus_type pcie_port_bus_type; > +extern const struct bus_type pcie_port_bus_type; > > struct pci_dev; > > > --- > base-commit: cc24b2d080dca2ce1c89a8a71c00bdf21155f357 > change-id: 20240208-bus_cleanup-pci2-61fe9c495d08 > > Best regards, -- Sathyanarayanan Kuppuswamy Linux Kernel Developer