From nobody Fri Dec 19 10:55:55 2025 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 8CCD21CA82 for ; Tue, 19 Dec 2023 15:35:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="SQb2s3ai" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D889C433CB; Tue, 19 Dec 2023 15:35:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1703000115; bh=VQdJED1b/NVo+u44VQrG/0nsxcY5pA0NStWSLWGhQ/4=; h=From:To:Cc:Subject:Date:From; b=SQb2s3aiuJQFqu6A9r3uacHBLEChhjPJ1zyi7QABAWg3yqAzT5F0erz2jTtr4+LN+ olJJg1UCCTLzPupzeeZTdl5pTdpcGyY/lYdyJGXVTw9cNydN26OIgbsiHYmsMshuoY HzxfSq5kx4FAbzik2fJfbV/e/OB678nDugo58USA= From: Greg Kroah-Hartman To: rafael@kernel.org, linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Dave Ertman , Ira Weiny , William Breathitt Gray , David Hildenbrand , Oscar Salvador , Kevin Hilman , Ulf Hansson , Len Brown Subject: [PATCH] driver core: mark remaining local bus_type variables as const Date: Tue, 19 Dec 2023 16:35:09 +0100 Message-ID: <2023121908-paver-follow-cc21@gregkh> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3517; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=VQdJED1b/NVo+u44VQrG/0nsxcY5pA0NStWSLWGhQ/4=; b=owGbwMvMwCRo6H6F97bub03G02pJDKmNO3R4fydWHduft3mD5ZQ5nloeM7nnrOwo0RaKmWigs HLKQs2lHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCRdlGGBR2cJ9f/eav+Z2q1 5e1bd9/e19dy2cKw4FjufMsJFdNfXreeNlND683h/asL1QA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Now that the driver core can properly handle constant struct bus_type, change the local driver core bus_type variables to be a constant structure as well, placing them into read-only memory which can not be modified at runtime. Cc: Dave Ertman Cc: Ira Weiny Cc: "Rafael J. Wysocki" Cc: William Breathitt Gray Cc: David Hildenbrand Cc: Oscar Salvador Cc: Kevin Hilman Cc: Ulf Hansson Cc: Len Brown Signed-off-by: Greg Kroah-Hartman Acked-by: Dave Ertman Acked-by: William Breathitt Gray --- drivers/base/auxiliary.c | 2 +- drivers/base/isa.c | 2 +- drivers/base/memory.c | 2 +- drivers/base/node.c | 2 +- drivers/base/power/domain.c | 2 +- drivers/base/soc.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/base/auxiliary.c b/drivers/base/auxiliary.c index 4d4c2c8d26c4..d3a2c40c2f12 100644 --- a/drivers/base/auxiliary.c +++ b/drivers/base/auxiliary.c @@ -244,7 +244,7 @@ static void auxiliary_bus_shutdown(struct device *dev) auxdrv->shutdown(auxdev); } =20 -static struct bus_type auxiliary_bus_type =3D { +static const struct bus_type auxiliary_bus_type =3D { .name =3D "auxiliary", .probe =3D auxiliary_bus_probe, .remove =3D auxiliary_bus_remove, diff --git a/drivers/base/isa.c b/drivers/base/isa.c index 675ad3139224..e23d0b49a793 100644 --- a/drivers/base/isa.c +++ b/drivers/base/isa.c @@ -82,7 +82,7 @@ static int isa_bus_resume(struct device *dev) return 0; } =20 -static struct bus_type isa_bus_type =3D { +static const struct bus_type isa_bus_type =3D { .name =3D "isa", .match =3D isa_bus_match, .probe =3D isa_bus_probe, diff --git a/drivers/base/memory.c b/drivers/base/memory.c index f3b9a4d0fa3b..4ac3266da6b5 100644 --- a/drivers/base/memory.c +++ b/drivers/base/memory.c @@ -68,7 +68,7 @@ static inline unsigned long phys_to_block_id(unsigned lon= g phys) static int memory_subsys_online(struct device *dev); static int memory_subsys_offline(struct device *dev); =20 -static struct bus_type memory_subsys =3D { +static const struct bus_type memory_subsys =3D { .name =3D MEMORY_CLASS_NAME, .dev_name =3D MEMORY_CLASS_NAME, .online =3D memory_subsys_online, diff --git a/drivers/base/node.c b/drivers/base/node.c index 4d588f4658c8..433897eecbdc 100644 --- a/drivers/base/node.c +++ b/drivers/base/node.c @@ -21,7 +21,7 @@ #include #include =20 -static struct bus_type node_subsys =3D { +static const struct bus_type node_subsys =3D { .name =3D "node", .dev_name =3D "node", }; diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index da1777e39eaa..096871334cc7 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -2670,7 +2670,7 @@ static void genpd_release_dev(struct device *dev) kfree(dev); } =20 -static struct bus_type genpd_bus_type =3D { +static const struct bus_type genpd_bus_type =3D { .name =3D "genpd", }; =20 diff --git a/drivers/base/soc.c b/drivers/base/soc.c index c741d0845852..282c38aece0d 100644 --- a/drivers/base/soc.c +++ b/drivers/base/soc.c @@ -28,7 +28,7 @@ struct soc_device { int soc_dev_num; }; =20 -static struct bus_type soc_bus_type =3D { +static const struct bus_type soc_bus_type =3D { .name =3D "soc", }; static bool soc_bus_registered; --=20 2.43.0