Message ID | 20240204-bus_cleanup-platform-drivers-x86-v1-1-1f0839b385c6@marliere.net |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-51714-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp382768dyb; Sun, 4 Feb 2024 06:40:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IGGGavij0V5xeqxIWOZxfPpq7bc+manvlKEhzweLINpfvM01BVQQAUqH5Gz+qoBc5A/EGva X-Received: by 2002:a17:90a:a096:b0:296:2054:ef48 with SMTP id r22-20020a17090aa09600b002962054ef48mr5816614pjp.25.1707057627041; Sun, 04 Feb 2024 06:40:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707057627; cv=pass; d=google.com; s=arc-20160816; b=fcuj+Gb2sDh0YzkbPebCDyTsL5/AjnsVVX5ApLrO0uuJETXURbmAzIoakYzREp0ROh o6tIbcP3vyxhIWbxkjPdpQee0IXmPP9rKUwIadIWhYPQHI16oIml9n3O2zgCFFXlXVPI KYTQxjKebwlN2i52zXWLwaehsM0DMn1cJ6wY/tEqdVQAfKdDEkGWBpy00YK6wMqwJRXT qTZ0AJ+k22XHWVXqVJ2CmZxAbxW7uK7kFdoygk3XxKucqt5fEF6rmmB3FUeBfTL8AGMo beXFkmBjn2FxhY2kKolpSoT3M2fv2n/KbImjgVE62jgqdwetbTrHuqnH2Ovmfq6vvqUQ gznQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:dkim-signature:from; bh=VuGDIWyePMJPlEmvb6FvKHxToWSzmOOCGNIDM9oq29s=; fh=HUUgqHcaM9Cc7igFwtfynMmUBDT7tOghs57PbayG8AE=; b=hqY/wlj87iyMfi43iN9Lbrru6VjSXJB1YHmDv0Tl5fz35vAqBnn+9/4vs9kHiF7Xfs HAaGwVXZIX7igfgpLxOIC3YR6YS6td2ZD97eQO5SpYm/goHqaXnTWX6mLVUfDSvGwRbp WPkqWlk8lNh5ieDOkmourk55ydWkKstCKcvAi9/GqMeK5We1NUWggokH/5tEbLBR7vtp w1g0Mbsn+qsKc9Qn3p4DthXxHKotDES003TEkG2eT6LvIJYunnVtibXzwBSnbgq7b9Qc qwh0GAc/h4cJOgIV7UTnQU+L5IugyhAS+/Seu0tQn8z2vRuGj22z+rupPVoAxewl99fY ZVKw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=temperror (no key for signature) header.i=@marliere.net header.s=2023 header.b=qFu3M4s3; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-51714-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51714-ouuuleilei=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCVdBuBdqmDxqTFSRvsH8L57OlDiUMxAwOuTqTkVYZuHfQROkTIHdiKWIPRWOIoJOM1FCxAupoNae2HD/WbigwqVnK02vA== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id lk17-20020a17090b33d100b00296645ac0e4si2635420pjb.67.2024.02.04.06.40.26 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 06:40:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51714-ouuuleilei=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=temperror (no key for signature) header.i=@marliere.net header.s=2023 header.b=qFu3M4s3; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-51714-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51714-ouuuleilei=gmail.com@vger.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 CC730282AEB for <ouuuleilei@gmail.com>; Sun, 4 Feb 2024 14:40:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 68FBB225CB; Sun, 4 Feb 2024 14:39:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="key not found in DNS" (0-bit key) header.d=marliere.net header.i=@marliere.net header.b="qFu3M4s3" Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E22102230C; Sun, 4 Feb 2024 14:39:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707057593; cv=none; b=ukpMYaui5MPpS+zsquCKTDBxnTp9Lvd+V9nqicS0QO8ZfXXXDyjcSyP83qyuH9Kk6HeHQ5pE/am6LX2xALnjQnTnzyakgksGvIbBK7iT5f2k6wN9YPSSdphpgZ/tHKYhcUchzpfh7oYCAsCXjHbA/rpMgpJ1vqhZYqY9Hn24rqo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707057593; c=relaxed/simple; bh=y7Np6tLWWpdCtIwpp/IJ4o4JZh5nikX5TUM9wJMdrd0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=I6p/TZRgW/t5xmu9K0LHAZD78KfxOQ+dVIrPSKM9xNgKO8hirqMiGt8mRhgjxAyQqZwA/temOTnlFvcbwcpM30hrabyHImSc0MIqrVKti7lyO4ukBKfVCs7p8kLcZMUM/D5b/oHOz0h7iracEpt24N2PfJtVXz/QhXTOQMV4cqM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=marliere.net; spf=pass smtp.mailfrom=gmail.com; dkim=fail (0-bit key) header.d=marliere.net header.i=@marliere.net header.b=qFu3M4s3 reason="key not found in DNS"; arc=none smtp.client-ip=209.85.214.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=marliere.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1d72f71f222so28662375ad.1; Sun, 04 Feb 2024 06:39:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707057591; x=1707662391; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:dkim-signature:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=VuGDIWyePMJPlEmvb6FvKHxToWSzmOOCGNIDM9oq29s=; b=MKIdvNbmeeXmM/f+KLd0BIDxM0j0AxuIUG8hOraIk2sv1qMOELLzA78m51zbvuoawD 94yURhAhMye3ZAoS4RlXSJm6+5aQaM74eyYd0rOgjBKpsxVCqD2IghXOnf+2hM2MhYEC qy6GBuaipCGbrWe2kQlUSxcg53JNwfZCpDSrJyYLIavNJZm0JA63P7wds4VJznsKh7c+ X0CFylmZ+WT5fHv5ZV45IH4q5d16ttn6c8g9vZbHoTPeoF/ATkYvwEC0tPdrT3dSqs+f FovtLhVItp3Zw1lLXKnoatC685nfg+xxjhaNAJjjlrgH+ui8LXrPT8EDPUsa77oO66qz 9UWQ== X-Gm-Message-State: AOJu0Yz2292xaybT33sMx6WOYMT1U7Q2uVacb8I0xnQELpRoCq9Q43Ab 3Blmavkjv9BBXKvqJxG0iIidKx3Ep1PxDIBe09VmBU7H6zze52rM X-Received: by 2002:a17:902:e84c:b0:1d9:7124:a89a with SMTP id t12-20020a170902e84c00b001d97124a89amr7804611plg.58.1707057591144; Sun, 04 Feb 2024 06:39:51 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCWFaRJwAH1XwZS0PfMdlYUm3Tht5TlPq0oTP9SkuD8imQOdoeZlxBlyz+AkjdSAkrVxculM+OGPhk8NryA23bT+3LSBYRssc78itKLXZRDjk99+hvNyLYPl8qDC0NimOZmizIHH0z5/AwNoUSXp0m6SOVUTB11iqVxqoCgplayaOjbcwlknyES76d+Nf79WXBFHT3FFGltWlcbxb5o= Received: from mail.marliere.net ([24.199.118.162]) by smtp.gmail.com with ESMTPSA id y10-20020a170902b48a00b001d7365fe0c7sm4577546plr.164.2024.02.04.06.39.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 06:39:50 -0800 (PST) From: "Ricardo B. Marliere" <ricardo@marliere.net> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marliere.net; s=2023; t=1707057589; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VuGDIWyePMJPlEmvb6FvKHxToWSzmOOCGNIDM9oq29s=; b=qFu3M4s3NjOyG/OVSa5MPeQqjFNignkRuIMmBHMbge+l8bxYGHnonXGUiho3JiA0edI7SH jQHfa6grewCkQ1Vtem9Y2HAhD8aqwuOkaopQOzTM11zxsrsSsWog7/aBuzUzRxAuN5vxBH pcx4vaTsrmOV8o9zz8409hWIKPZ2s0Osqn5FrUwVfwdOGw+/nxCq/ytApra15uu4KsYXPz YV17aBBbtZvbdcPvQosbyNDmU5jxTVY+MaUZ7z+ZzdLP2SLZHEGJCDJfcXxZ3ttZWXHQyn mTGnVu+QJ3tEIH/Vsnst8M5H3KLfT11ZA7Q1PTzu+xJqcym9koLYDegalHBlQQ== Authentication-Results: ORIGINATING; auth=pass smtp.auth=ricardo@marliere.net smtp.mailfrom=ricardo@marliere.net Date: Sun, 04 Feb 2024 11:40:16 -0300 Subject: [PATCH 1/2] platform: x86: wmi: make wmi_bus_type const Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240204-bus_cleanup-platform-drivers-x86-v1-1-1f0839b385c6@marliere.net> References: <20240204-bus_cleanup-platform-drivers-x86-v1-0-1f0839b385c6@marliere.net> In-Reply-To: <20240204-bus_cleanup-platform-drivers-x86-v1-0-1f0839b385c6@marliere.net> To: Armin Wolf <W_Armin@gmx.de>, Hans de Goede <hdegoede@redhat.com>, =?utf-8?q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com> Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, "Ricardo B. Marliere" <ricardo@marliere.net> X-Developer-Signature: v=1; a=openpgp-sha256; l=1207; i=ricardo@marliere.net; h=from:subject:message-id; bh=y7Np6tLWWpdCtIwpp/IJ4o4JZh5nikX5TUM9wJMdrd0=; b=owEBbQKS/ZANAwAKAckLinxjhlimAcsmYgBlv6HQaxYZFNBmMncA7xzXrILFnq+CIS5//996J 4coroW5A/GJAjMEAAEKAB0WIQQDCo6eQk7jwGVXh+HJC4p8Y4ZYpgUCZb+h0AAKCRDJC4p8Y4ZY prDWD/9wfNaXVEL8ZY9gWrC4KrtGnss3tvYm2Is7pKlfPe9GvvBI/5F+JsoVXj/kf2K2kQyo+NN 9nP6HKRwrXPRiMRkkQ2uRHTKx4o8ddDNbraYOI00dY5uyYNoIRiupM4UoJd/1BR02UDawgl13VP FKvn10dm6IQdFf6vxz1AuLOPRx136gYGWGl9UojjAOUkp8XHg6bosJ36vYvTltRDaqtfsQclMVs UJZR4Vg3ACBaO8Hew3sUdMGHovMmMLIyKVe2PTxzrdNj5iZdvzj8iYPyHCPnyM4IuvKQo9Kqav2 7bq7grCsWuhD6rMz5tjFDitScOOnykkkQKkQw7+tHMl/4OUf5ZH/+HY0iAC2+2R2jC6dO3p2ob+ 71bQgis/p0+n6YZwCXS2tomfK6vdET06oFbxDuhNVoBJmOj0HqA9Pgk+WcZJwZI3aO1cHwl6KyE TCUIExenNbWAJLh3NB6TiWyw/NTBvcnKZ26WgVYgaLZiEFdm6JEBRxft5NaYChPciQ2dgbNI0P8 V4o+UfIQSjLrrKO3ErUxG/tBfCJJuWezPH/NgLLbWMWhxr1TowOcJLeaVpsMsvTJl7wZX6957lU o/Etm8xNHxZxVN65Kuup5cSUxu6yrmEUxgr9VElVNLmI/yvBThQ+S1v2uQN1S29HMkwQgE/jMbt 6gUUqEkE8b8Jhog== X-Developer-Key: i=ricardo@marliere.net; a=openpgp; fpr=030A8E9E424EE3C0655787E1C90B8A7C638658A6 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789979658162006679 X-GMAIL-MSGID: 1789979658162006679 |
Series |
[1/2] platform: x86: wmi: make wmi_bus_type const
|
|
Commit Message
Ricardo B. Marliere
Feb. 4, 2024, 2:40 p.m. UTC
Now that the driver core can properly handle constant struct bus_type,
move the wmi_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 <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
---
drivers/platform/x86/wmi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
Am 04.02.24 um 15:40 schrieb Ricardo B. Marliere: > Now that the driver core can properly handle constant struct bus_type, > move the wmi_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 <gregkh@linuxfoundation.org> > Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net> > --- > drivers/platform/x86/wmi.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c > index 7ef1e82dc61c..859dfff515d0 100644 > --- a/drivers/platform/x86/wmi.c > +++ b/drivers/platform/x86/wmi.c > @@ -219,7 +219,7 @@ static int wmidev_match_guid(struct device *dev, const void *data) > return 0; > } > > -static struct bus_type wmi_bus_type; > +static const struct bus_type wmi_bus_type; > > static struct wmi_device *wmi_find_device_by_guid(const char *guid_string) > { > @@ -899,7 +899,7 @@ static struct class wmi_bus_class = { > .name = "wmi_bus", > }; > > -static struct bus_type wmi_bus_type = { > +static const struct bus_type wmi_bus_type = { > .name = "wmi", > .dev_groups = wmi_groups, > .match = wmi_dev_match, > Reviewed-by: Armin Wolf <W_Armin@gmx.de>
diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c index 7ef1e82dc61c..859dfff515d0 100644 --- a/drivers/platform/x86/wmi.c +++ b/drivers/platform/x86/wmi.c @@ -219,7 +219,7 @@ static int wmidev_match_guid(struct device *dev, const void *data) return 0; } -static struct bus_type wmi_bus_type; +static const struct bus_type wmi_bus_type; static struct wmi_device *wmi_find_device_by_guid(const char *guid_string) { @@ -899,7 +899,7 @@ static struct class wmi_bus_class = { .name = "wmi_bus", }; -static struct bus_type wmi_bus_type = { +static const struct bus_type wmi_bus_type = { .name = "wmi", .dev_groups = wmi_groups, .match = wmi_dev_match,