From patchwork Sun Feb 4 14:40:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ricardo B. Marliere" X-Patchwork-Id: 13544698 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 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: 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-Google-Smtp-Source: AGHT+IF47iBaYdPHXf0P3QhqPQ+a3ySNF35Wrz27r5kJ/DCdEUI7USWH+DPmUw0VtrCmF9eCWnjM9g== 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" 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: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , "Ricardo B. Marliere" 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 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 Suggested-by: Greg Kroah-Hartman Signed-off-by: Ricardo B. Marliere Reviewed-by: Armin Wolf --- 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, From patchwork Sun Feb 4 14:40:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ricardo B. Marliere" X-Patchwork-Id: 13544699 Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) (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 1E07E2261B; Sun, 4 Feb 2024 14:39:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707057596; cv=none; b=GoiexaLFRVVegujJJNlS8GVU5hnPWmhFV44u1xOs1RF+x7uPz/zJM2h+zi64UqLz2PZRlMrFb7BrW3MWDCC9w4JH5aWldBQv/C6VU9fJ7as7XcP/LIsX+o6SBTYJKjMpXGE9D3uOW4IBxdX9X7q96h9Wbr6ZSa1sgVO2zVuQFrw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707057596; c=relaxed/simple; bh=DCD6AMLvjzfV2dwxayyk2LAMb3B1QNeqUuCbdIScgfs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gA3qsGgVIHO4sDz0/auU8bKqlR4/r7iFknbyrsDVxLv4a/takJusc9b6SbPXkexfIrpxcK0YoJt/pbDHJ6fwz5coS53aPhmV4tp52uwiYH0P7EHRyIWCwPtbO+oFrwnkrskKn8I8vB1EibM3zeOkTvczkPN0GCoKsKRrYYqrWJU= 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=Z1myHvU3 reason="key not found in DNS"; arc=none smtp.client-ip=209.85.216.45 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 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="Z1myHvU3" Received: by mail-pj1-f45.google.com with SMTP id 98e67ed59e1d1-295f3bf41d5so1599887a91.0; Sun, 04 Feb 2024 06:39:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707057594; x=1707662394; 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=ezYYHGSX/pcUtiy9cJ9ZdjJ+J+xQpwes4VQvX7jx/zo=; b=RT0Sgu0aoNjulOc7Zycjz0j3UtUZc+foDlikSGkLfRxvsJEcTSIlKWmTuXhbIV87Gw b6SqDlEvxMS9np90zxUSatvwKkXkQTK+c1JAw/Gv2Euhg0MbkWyY4HlgFydxjos0LYze CNeGFdzsMPYNBA8o0O1Rrn0kySQSDi7ln9GV/r+ha7J9lmflb5DcGanopNNHHv/MPjPt VEpnv4BGP8qEkc0Eek9hOa+eSuiZBfwvoRcEx7VaQW9LPTivzUprPm6NNLT52u0e9/5D dgYc7fZGDnLNmyn49r6g6xve5fqFf9EStCq0Xgl3pb8+6Wi9t4iLdo/xaC+KWQkvuCSH ac0Q== X-Gm-Message-State: AOJu0YzEIAXjvdXRixhQ99MCdZ+gzKMDarXbRitxu6pXUTTxRmCawuvJ 9NbUZRytSt1mOIpTrdxjqK9JO0bZdfAMIVq5RCnthsK+dvG2JiI33tQyNRLPMd4i+A== X-Google-Smtp-Source: AGHT+IF/LvGJWFS07g8bPEr+AKxZH71SH4eIfgFeUu6FkNgwsUi64JoyUEuMoMNAu+cDJxo5eqn30w== X-Received: by 2002:a17:90b:4004:b0:296:2865:cc17 with SMTP id ie4-20020a17090b400400b002962865cc17mr4844717pjb.20.1707057594330; Sun, 04 Feb 2024 06:39:54 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCUiJQ+lFPYnIgtSHcOMHhIoRsTg1y8TX4eG3ha1gdpvWlZ8DoutWGCstkDBbT2AyJ9AjUebTbvOsp2OcX2p6SieVVUMfFlEOvyItA3uk/xAApO+w/89aHEkQtAzamj5MVhejKf7TaCTPCJ/mwghU41I9zdHASE6LndooIXlYl1q1AgOL8domq1ITFDmvZvpGgOWA8CHq4WdoiVtizc= Received: from mail.marliere.net ([24.199.118.162]) by smtp.gmail.com with ESMTPSA id c3-20020a17090a020300b002965e463ee9sm3536633pjc.34.2024.02.04.06.39.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 06:39:53 -0800 (PST) From: "Ricardo B. Marliere" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marliere.net; s=2023; t=1707057592; 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=ezYYHGSX/pcUtiy9cJ9ZdjJ+J+xQpwes4VQvX7jx/zo=; b=Z1myHvU3csMaqFB7GKFE3I0v5WQk4GK1zNW4Bb4qUrz5maEWPuvglehuNuL1BFocoxDO+L FEZwjdHTq3TTOxh7bm9gIZLiXjqw0SH3xAo+YTVaz8nenpn8fdgPyDrhT81uVnnwX68frP aFUDCQea4Qt72A+VaC7R12cxoyC6VVAo/R54m6j1jrbO6UqTEYSQQpr9yxJzmmp2t3MY5r yksHNK4pQnexU6BrQbehR8d6K65riD5jMn3LXKGztQKV9ZTCkb8c0kiWcNDV44rRCwAFgc Vh3BBvN0AYeCk3qFmFJHu1fe22jwxZxzIdfMvBpyACRF15Dwxl0HYnK5ZT4hkA== Authentication-Results: ORIGINATING; auth=pass smtp.auth=ricardo@marliere.net smtp.mailfrom=ricardo@marliere.net Date: Sun, 04 Feb 2024 11:40:17 -0300 Subject: [PATCH 2/2] platform: x86: ibm_rtl: make rtl_subsys const Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240204-bus_cleanup-platform-drivers-x86-v1-2-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 , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , "Ricardo B. Marliere" X-Developer-Signature: v=1; a=openpgp-sha256; l=923; i=ricardo@marliere.net; h=from:subject:message-id; bh=DCD6AMLvjzfV2dwxayyk2LAMb3B1QNeqUuCbdIScgfs=; b=owEBbQKS/ZANAwAKAckLinxjhlimAcsmYgBlv6HQ3+29jKxh1mamu111xgE2/ToCrm5moNnId 9Ra8XP3s7iJAjMEAAEKAB0WIQQDCo6eQk7jwGVXh+HJC4p8Y4ZYpgUCZb+h0AAKCRDJC4p8Y4ZY poAFD/4rJaNnFbM3l1qCLz9O/ci74mgChD/er5TjAFUHPNVYWPFXacqN50/ui04UubrqQTZtpFV aEOIxPcG7vwsbqgump7v3M1z0En9e8EXDqlbCyL9En81NP36ORYJz14qha9G1jwUqVmo6nU23kX v+PfuwQFrw8RrDQfVJo+/GvTfgKt1EFoZwNK2GaR/9YHTqSHLnclH4+wU4wKVciaLLLgHfrJ704 8qUcY0zqRhdtXDf5hcUtJvXj73+KOeoyNRPmyzo/7b+eryawwVOYRFD5PihezfNEBzkjPuelPue 7UkU66iptLqoWoI64Pv7Dlh7nWC4ddXDFnFCNUYBTSzeTBnX32c/PiqdNy/xfgmmECjmSy54zox E1Vo+9wVR8oY5HNCgJZBuY20ebc8tRzl5QIr7UAIbj9XFXmXHb0aHd95SyiPQ2IWzYsLg+aHr8X 3cQ1+xtVYfvr1bWHXw21tNeUKIxKrgPLova+CpADd5hio1MSlWBOFM7DLXOUN0ZQdi3KAkbYNiA +Mju3mFGxYZAUd61eWqDZTeZGwF/3bwXsHBTQ+DsTnJvCrQz3L8RnOvXFmAkmoYBJI6rH3sce/w l8OfXdpW62WBCFSLiYPA4wAMiwUmZUEahDWDk1TMhKiYtxSB2SJioLEsCTtZ8FaTH6Q7z4lWw2L 70SIcne5QNUP6IQ== X-Developer-Key: i=ricardo@marliere.net; a=openpgp; fpr=030A8E9E424EE3C0655787E1C90B8A7C638658A6 Now that the driver core can properly handle constant struct bus_type, move the rtl_subsys 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 --- drivers/platform/x86/ibm_rtl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/x86/ibm_rtl.c b/drivers/platform/x86/ibm_rtl.c index 2ab7d9ac542d..1d4bbae115f1 100644 --- a/drivers/platform/x86/ibm_rtl.c +++ b/drivers/platform/x86/ibm_rtl.c @@ -179,7 +179,7 @@ static ssize_t rtl_set_state(struct device *dev, return ret; } -static struct bus_type rtl_subsys = { +static const struct bus_type rtl_subsys = { .name = "ibm_rtl", .dev_name = "ibm_rtl", };