From nobody Fri Dec 26 11:28:46 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 0A271250E9 for ; Fri, 5 Jan 2024 10:26:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="qkKuJGrV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D854C433C8; Fri, 5 Jan 2024 10:26:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1704450414; bh=In4idDpSGy2rHfbF3CvZPnLiRDq4Xmq3P7L4d+F3SbY=; h=From:To:Cc:Subject:Date:From; b=qkKuJGrV4z7gBf+9dGxHPFRAnYA8qo8Vtg3prb4nyJOCxDP7Yd+r4qsmFscZsCIdp K/29k+AQEDP7+XHHKoxxjTWTQvK7wF6d6H7dEfbO3r92QVYYmiO2/bk8mylTxR01IN oEFlUh3RY1EBKrrq3mwC40ykZ7BwlF43erYsghnI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , "Rafael J. Wysocki" Subject: [PATCH] driver core: cpu: make cpu_subsys const Date: Fri, 5 Jan 2024 11:26:48 +0100 Message-ID: <2024010548-crane-snooze-a871@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=1286; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=In4idDpSGy2rHfbF3CvZPnLiRDq4Xmq3P7L4d+F3SbY=; b=owGbwMvMwCRo6H6F97bub03G02pJDKnTb2Zc+vmgslCotcptksdygdOd1h6M3z7yJP1cIp1vX 3yoSVCsI5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACbSd4FhfnnmQudLG+dtq49I Tg0r3zlL5sb2ZobZLFzWHpVvOWbtfuRSW70zs9Dq6EJ7AA== 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, move the cpu_subsys variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime. Cc: "Rafael J. Wysocki" Signed-off-by: Greg Kroah-Hartman --- drivers/base/cpu.c | 2 +- include/linux/cpu.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index 82b6a76125f5..c3c15adb7da9 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c @@ -366,7 +366,7 @@ static int cpu_uevent(const struct device *dev, struct = kobj_uevent_env *env) } #endif =20 -struct bus_type cpu_subsys =3D { +const struct bus_type cpu_subsys =3D { .name =3D "cpu", .dev_name =3D "cpu", .match =3D cpu_subsys_match, diff --git a/include/linux/cpu.h b/include/linux/cpu.h index dcb89c987164..0b993a140946 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h @@ -128,7 +128,7 @@ static inline void cpu_maps_update_done(void) static inline int add_cpu(unsigned int cpu) { return 0;} =20 #endif /* CONFIG_SMP */ -extern struct bus_type cpu_subsys; +extern const struct bus_type cpu_subsys; =20 extern int lockdep_is_cpus_held(void); =20 --=20 2.43.0