Message ID | 20240204-bus_cleanup-w1-v1-1-a0f4c84d7db3@marliere.net |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-51897-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp527635dyb; Sun, 4 Feb 2024 12:55:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IHWSWODs9/cQhqHoj//P8E9+ma6ow/7iziIr6NnJaNYWFYHPLiu6h01Bx99ZJ3QEkraU1u5 X-Received: by 2002:a05:6808:11c8:b0:3be:3326:bcd2 with SMTP id p8-20020a05680811c800b003be3326bcd2mr14724375oiv.15.1707080110797; Sun, 04 Feb 2024 12:55:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707080110; cv=pass; d=google.com; s=arc-20160816; b=lXYaObkfzbO0Pr38TH13qTi6MqKFzTa2nUz9DS4cvREr3UX3TmXA/fJ0L6O4Gk3boV OYjtsvQAldws/EX/KD/JuPUrkJDUJjQe2SG5EsR6qd3f8yyq3ICdavFlFyGQQDoZ8xkE KF8fnXYnSJ36fap5+0GAVYo27HNEy3vbqYZLrKBM8cAGPSQBWlJG9lLxldS13GTrzxBS S3d4X1ys/P+m5jCbcT9DUXcLbk+sUO81plURh98ewjv7TW1B/6aK64avTg+DEiIbJ1UR dpHut1ZhfyAKYH1Og/2qdIsBgfcUxUi7LJ9H4zzJG+v9DsBn26qOiX7AMlew2qIQuc61 cmgw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:message-id:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:subject:date :dkim-signature:from; bh=WAu0zvaIyFYOf/16euiq/gY/arIjrGPDYqgSqZ1rc3s=; fh=4UU3kpb86H29w0bnwEBKPW2Bv1VXKQwjtZjRiln6FWc=; b=w94dPec42wUnOYab6+iC7A9D4+6ipTVwJg24jiLmrxg1wVPIy9KcqZ+VJ+Z1klcaPo 1Bz2HfIgMCR7U/2fIFQVgPVK9ybEITB3DnV97l0eeI2KxTHVG49r45oouPbLb5vRZBXS S204QLT657uYCLwmOxLndLjJAtrxunR/c/bc27Nw4RjTtSUbiLTT9uwLFtUlULvIwlrT PSxSRZI7oprPFX6h/UZHZaing3Q02tIEIzYCoAUYzqKlLdHRhQZ24zjCkl/4k7WVqc2e S5HtHfWBXkAeoiZKROZOEl3DOnZj47k1O56wgpLoduuc0c5wji2JFbavFGsJNN8rO4qz 96TQ==; 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=uMX78pb3; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-51897-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51897-ouuuleilei=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCWo9uZykixtNxQChM1nX02MJ9aOF4yVhP9GylB+JW1KMyFR/NSMHV47rCxfgVUGBml1r5HmSjseybcHljWYLm2m6/ly0Q== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id g6-20020a632006000000b005d96d182c41si4987275pgg.490.2024.02.04.12.55.10 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 12:55:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51897-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=uMX78pb3; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-51897-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51897-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 8D352283252 for <ouuuleilei@gmail.com>; Sun, 4 Feb 2024 20:55:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E18E024B5B; Sun, 4 Feb 2024 20:54:57 +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="uMX78pb3" Received: from mail-ot1-f51.google.com (mail-ot1-f51.google.com [209.85.210.51]) (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 9D09525564 for <linux-kernel@vger.kernel.org>; Sun, 4 Feb 2024 20:54:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707080095; cv=none; b=n81A0KsumwTxYBkoRnoNSoxEpxQy4kF0bg0cuqXD8kx9TbcMTW4wllnIUf0AtlFk7nxZr9UBprhGeECCmBQMMj3eqk5LDFNgSdsgpCgknehaKWSU7bipKmW8arwEOONpfPXRu0tZgqiPfTcOYwl5FzTZeSXZRtLWCt3lTMpIu0I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707080095; c=relaxed/simple; bh=cRAjYVT3aU/0L1PTARLaimpHmTVl38ZB4JhjFVFkB38=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=nsHwg2NoVMixnCLZoUdQj0f8pp4UN74And/vjpchfDVfo4eqi1/3F2GhipvrZylh1iMYcMWdcHjWfm3WrOkF0Ldd1Iwt4giVhe58TrySGk1stE2OjV5AgVRlubHSisSJa0umMOHZ2JdABgd2RkPJGWulLi76va01ew4CW+pzAqU= 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=uMX78pb3 reason="key not found in DNS"; arc=none smtp.client-ip=209.85.210.51 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-ot1-f51.google.com with SMTP id 46e09a7af769-6e11faeb125so1901665a34.2 for <linux-kernel@vger.kernel.org>; Sun, 04 Feb 2024 12:54:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707080092; x=1707684892; h=cc:to: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=WAu0zvaIyFYOf/16euiq/gY/arIjrGPDYqgSqZ1rc3s=; b=v00BP6dimARunkTjIeLg0VCVXSwS+PWYE0cWM/wPNqe1nFvYI2m5IBC0DUUDA/cnGg exCvVtZyJBghGMGV74z/Obk/smY9VNUvJr4ND7qb/0zbOZGawiETnff6o2zmsr5YpVpK aAB4Z3GZfSXozyvRWWEpy+WFdUXUehCROk9hV6X41ZLZt5bQ8bj3pgFPINn9AC3xXlUN rXs8O5CfVT4roO2JfZRU1fDEHJXv04O67ElrhUnVOCp2c+SYtPbQLukfEhwvJPqmvj7D 0jDwNLuOHE5iJzCqP5YydDsbesLXw549Y5leHjIgezKy624NB6DdbI+bdu0g1PI2letF diDg== X-Gm-Message-State: AOJu0YxXdTbYeOxJVI/bhqriAd2mNvylm60urCFVUO7D+DP4IWjyb+Ar aYXPBj9UgvOUUU7YSKcRa3HCJGRzQGPxMz6lh9tX0/Oro1wTzHBG X-Received: by 2002:a05:6358:796:b0:178:b0c5:25e3 with SMTP id n22-20020a056358079600b00178b0c525e3mr14140538rwj.3.1707080092555; Sun, 04 Feb 2024 12:54:52 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCVzI98puzGg4k9tyw+p4AZJZ/pbVmC4RGWs+eyYEPenHBzO0OeeGeZn4PKXc3JYya8DLk56EXOGfE88PS50rQrZM7gJ5ZTn9HoK7w== Received: from mail.marliere.net ([24.199.118.162]) by smtp.gmail.com with ESMTPSA id pv8-20020a17090b3c8800b00296852b2df1sm1534565pjb.21.2024.02.04.12.54.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 12:54:52 -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=1707080091; 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; bh=WAu0zvaIyFYOf/16euiq/gY/arIjrGPDYqgSqZ1rc3s=; b=uMX78pb3b4VCrrb5LmEhjTSYkNScydvPn+SO4lUhVhBT87cdZppXTIRILwTlmH2TneG9KZ C/eBMuWfkUpCDarY89nNkemv9JkxUXjh/EFaSdPbiNdesIAqBhaWm0r9FKNOJhO5NxGQX2 JOFKUcNuUu9HTjCrebNX7ZEcjYNXWOwlzJQFB1npDKZk2FV3qKdbL+HzxhKoQ7ilugzdah JMibMx1ipMsmDy15YpLTF7CpyGVyGdtwJYvp3yj06s6U5GI3NbY1b06fKKS8lgvQqksG8F ME/nLx6xxhjQcTYw2yOKhwSNbIfmag4gnolN8wyWJRFrivphrjZUtZbH/o5w0g== Authentication-Results: ORIGINATING; auth=pass smtp.auth=ricardo@marliere.net smtp.mailfrom=ricardo@marliere.net Date: Sun, 04 Feb 2024 17:55:22 -0300 Subject: [PATCH] w1: make w1_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-w1-v1-1-a0f4c84d7db3@marliere.net> X-B4-Tracking: v=1; b=H4sIALn5v2UC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDIxMDIwMT3aTS4vjknNTEvNIC3XJD3VQTs0RD02QLI2PzNCWgpoKi1LTMCrC B0bG1tQCBLAPaYAAAAA== To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Cc: 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=1066; i=ricardo@marliere.net; h=from:subject:message-id; bh=cRAjYVT3aU/0L1PTARLaimpHmTVl38ZB4JhjFVFkB38=; b=owEBbQKS/ZANAwAKAckLinxjhlimAcsmYgBlv/m5U+00f/YTQlvlD9f2cq58CpxerCZ0bWDD+ bvM2J4VST2JAjMEAAEKAB0WIQQDCo6eQk7jwGVXh+HJC4p8Y4ZYpgUCZb/5uQAKCRDJC4p8Y4ZY pmKkD/9MpcidHxC4R8cGb+wEgoGtOiZDgb/kjKh+L6c4YnZ4MyZbxYJdhknpUayfAhcXuQNNgAz koODwYRJgtx1Up3FvIvrRTaPAmvkH+Rpkb3dGtagKLZSEJZ2zAfzMETth3/NDKfpTjgPL8v8Y+R MX9Ob9rUg1L0fqLeU6jUM9eEGMEk9oB5O5DY0MM756/dM95vJZZyElVhWYuvb9uPw864c8bqPv7 fIDhD/96uZmWJGIMYz+hnZCv1sveCIp+oZozNWghHYHPIh4YPPfIQyV20QaIdw94yQz6FyyqJOZ IZjWV7yHJiUyZP1PVAddHkpPvSKFn/hcRC86HecQ8YaKmYh23tLDArOlKVVi7vBOVme8ekZF1e6 UOFWNZGFxWyVlFhyYnXeDzVrUU7JiFA9vNqW6h5EAliOyMI3UNG/oe/O8+0kX+bpf4HoxjUCWJq XIGr6MxpaH71jLJ24y2c8DG30ffO+mc1miLCNFN0/Ldr0hoaga/TGVm57iNBxJpINKOPpuSIY1/ 8ah2E49NQDS0E2kKLHxpyY2SRItItI4l+Mn8W1awx/c4o84CGCI/7oX+2JNVTk8v34IJrcdce8K 9uU6QtD8hWFGG9VN0aJGa5eX6Z6ADxhBF1Hj/5tfYJdZFo+FJV7AQvm0uEk+1R1ZoscYQAZiafq g5QTKnUiojlQfyQ== X-Developer-Key: i=ricardo@marliere.net; a=openpgp; fpr=030A8E9E424EE3C0655787E1C90B8A7C638658A6 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790003234230117422 X-GMAIL-MSGID: 1790003234230117422 |
Series |
w1: make w1_bus_type const
|
|
Commit Message
Ricardo B. Marliere
Feb. 4, 2024, 8:55 p.m. UTC
Now that the driver core can properly handle constant struct bus_type,
move the w1_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/w1/w1.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
base-commit: 41b9fb381a486360b2daaec0c7480f8e3ff72bc7
change-id: 20240204-bus_cleanup-w1-e46a15c8237f
Best regards,
Comments
On 04/02/2024 21:55, Ricardo B. Marliere wrote: > Now that the driver core can properly handle constant struct bus_type, Does "Now" means some dependency on other patches? > move the w1_bus_type variable to be a constant structure as well, > placing it into read-only memory which can not be modified at runtime. Best regards, Krzysztof
On 5 Feb 08:34, Krzysztof Kozlowski wrote: > On 04/02/2024 21:55, Ricardo B. Marliere wrote: > > Now that the driver core can properly handle constant struct bus_type, > > Does "Now" means some dependency on other patches? Hi Krzysztof! Please check: https://lore.kernel.org/all/1305850262-9575-5-git-send-email-gregkh@suse.de/ You can apply as is. Thanks for reviewing, - Ricardo > > > move the w1_bus_type variable to be a constant structure as well, > > placing it into read-only memory which can not be modified at runtime. > > Best regards, > Krzysztof >
On Sun, 04 Feb 2024 17:55:22 -0300, Ricardo B. Marliere wrote: > Now that the driver core can properly handle constant struct bus_type, > move the w1_bus_type variable to be a constant structure as well, > placing it into read-only memory which can not be modified at runtime. > > Applied, thanks! [1/1] w1: make w1_bus_type const https://git.kernel.org/krzk/linux-w1/c/8650843ca42a7fd8255f4dcddbaa20393e01fe11 Best regards,
On Sun, Feb 04, 2024 at 05:55:22PM -0300, Ricardo B. Marliere wrote: > Now that the driver core can properly handle constant struct bus_type, > move the w1_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/w1/w1.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
On Mon, Feb 05, 2024 at 09:08:20AM -0300, Ricardo B. Marliere wrote: > On 5 Feb 08:34, Krzysztof Kozlowski wrote: > > On 04/02/2024 21:55, Ricardo B. Marliere wrote: > > > Now that the driver core can properly handle constant struct bus_type, > > > > Does "Now" means some dependency on other patches? > > Hi Krzysztof! > > Please check: > https://lore.kernel.org/all/1305850262-9575-5-git-send-email-gregkh@suse.de/ Sorry, no, that is for device_type, not bus_type. bus_type didn't become able to be const until 6.4 or so. thanks, greg k-h
On 5 Feb 19:08, Greg Kroah-Hartman wrote: > On Mon, Feb 05, 2024 at 09:08:20AM -0300, Ricardo B. Marliere wrote: > > On 5 Feb 08:34, Krzysztof Kozlowski wrote: > > > On 04/02/2024 21:55, Ricardo B. Marliere wrote: > > > > Now that the driver core can properly handle constant struct bus_type, > > > > > > Does "Now" means some dependency on other patches? > > > > Hi Krzysztof! > > > > Please check: > > https://lore.kernel.org/all/1305850262-9575-5-git-send-email-gregkh@suse.de/ > > Sorry, no, that is for device_type, not bus_type. bus_type didn't > become able to be const until 6.4 or so. Ah yes, sorry. The correct link should be: https://lore.kernel.org/all/20230313182918.1312597-35-gregkh@linuxfoundation.org/ > > thanks, > > greg k-h
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c index 5353cbd75126..afb1cc4606c5 100644 --- a/drivers/w1/w1.c +++ b/drivers/w1/w1.c @@ -167,7 +167,7 @@ static struct w1_family w1_default_family = { static int w1_uevent(const struct device *dev, struct kobj_uevent_env *env); -static struct bus_type w1_bus_type = { +static const struct bus_type w1_bus_type = { .name = "w1", .uevent = w1_uevent, };