Received: by 2002:a05:7412:8598:b0:f9:33c2:5753 with SMTP id n24csp581408rdh; Tue, 19 Dec 2023 07:35:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IFMVEVHaa8ZnEtYmPTaGZ18qGDtdkZEFijq2XSB5yKMFGhsyEa1FEetqZsBeBFmu299Ok40 X-Received: by 2002:a05:620a:4252:b0:77f:2f5:6e5b with SMTP id w18-20020a05620a425200b0077f02f56e5bmr1756470qko.75.1703000123417; Tue, 19 Dec 2023 07:35:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703000123; cv=none; d=google.com; s=arc-20160816; b=VCHup64JCG52xVcPmc6map5oUhgF4gSl4Yp5KojSUEvhVZQGIB+3bJw0W2YFM+dkTI xNZqWoa7K2Vjp2R1dj/tohlg9Q3bWExhnBQRmIhopY6Re/LfoKFvvytiApvcG4I9YTG3 N0LxI4BA30Epwi1UfGNhqA8gyVqq9mvpshrj2+2V2DYtU/0amcPd/EhnuNheKEpuvJB9 7zXPo4KFpxVop+okpUp8pakmC5vJ6u/mAgfoWqdqWl3KXIUZv9irGoi29nBcFsrdS/aw uOf7acxQkjXudtNTxIZ5HEfxAtO+g8pJiNmgDd2O5w6ZklX7netsQ3T9ExfeyOv63I7Y xEdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:lines:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=4o43so9Db+cRJGyfuT/aRRB3+WzEisyY5Gw5tgLBfAc=; fh=UE//BsTiC+H/FyS9VVElOeJSXA0wOd/1nqVzwL0aBpw=; b=HF9o3MvFCjDwsOywJIL3BebH4bt5CqvLyTUxP+GEaas1nZqCufUHI9uWGzdHwYN7w0 bAsMvYgluwIZVTdtMBCFbRi1UYmB+xGuDb2w53G6Ce1SZTMyj1hZmAHW+Ksmtqwe68Sa 8ytQYDPhKPtXbIsmx+cVtWHQMxKlU4YU1OWD+McPb1x9P9fjyrJ/SRhGbskxUiX+0/II nvXJUyVfseUJGxVOoWj1Vl0AOpqSo/AylbAylarnAzn/Xd5Wva4Jxg1XmwmoLxi2xCIO npBzvvhz57YpGaZNU/WwTBuyUh/FD2xYPTt9qFmgaYIuJ+waMeipLjmuvDmyFU4iR8+c 0qPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SQb2s3ai; spf=pass (google.com: domain of linux-kernel+bounces-5490-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5490-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id bj41-20020a05620a192900b0077d9abbe307si26636743qkb.236.2023.12.19.07.35.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 07:35:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5490-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SQb2s3ai; spf=pass (google.com: domain of linux-kernel+bounces-5490-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5490-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 208681C23F22 for ; Tue, 19 Dec 2023 15:35:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 61BEF1CA8D; Tue, 19 Dec 2023 15:35:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="SQb2s3ai" X-Original-To: linux-kernel@vger.kernel.org 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) 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 Lines: 104 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: 8bit 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 --- 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); } -static struct bus_type auxiliary_bus_type = { +static const struct bus_type auxiliary_bus_type = { .name = "auxiliary", .probe = auxiliary_bus_probe, .remove = 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; } -static struct bus_type isa_bus_type = { +static const struct bus_type isa_bus_type = { .name = "isa", .match = isa_bus_match, .probe = 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 long phys) static int memory_subsys_online(struct device *dev); static int memory_subsys_offline(struct device *dev); -static struct bus_type memory_subsys = { +static const struct bus_type memory_subsys = { .name = MEMORY_CLASS_NAME, .dev_name = MEMORY_CLASS_NAME, .online = 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 -static struct bus_type node_subsys = { +static const struct bus_type node_subsys = { .name = "node", .dev_name = "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); } -static struct bus_type genpd_bus_type = { +static const struct bus_type genpd_bus_type = { .name = "genpd", }; 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; }; -static struct bus_type soc_bus_type = { +static const struct bus_type soc_bus_type = { .name = "soc", }; static bool soc_bus_registered; -- 2.43.0