mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Ricardo B. Marliere" <ricardo@marliere.net>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	 "Ricardo B. Marliere" <ricardo@marliere.net>
Subject: [PATCH 2/2] Input: serio - make serio_bus const
Date: Sat, 10 Feb 2024 12:15:02 -0300	[thread overview]
Message-ID: <20240210-bus_cleanup-input2-v1-2-0daef7e034e0@marliere.net> (raw)
In-Reply-To: <20240210-bus_cleanup-input2-v1-0-0daef7e034e0@marliere.net>

Now that the driver core can properly handle constant struct bus_type,
move the serio_bus 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/input/serio/serio.c | 2 +-
 include/linux/serio.h       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
index 767fc9efb4a8..a8838b522627 100644
--- a/drivers/input/serio/serio.c
+++ b/drivers/input/serio/serio.c
@@ -1007,7 +1007,7 @@ irqreturn_t serio_interrupt(struct serio *serio,
 }
 EXPORT_SYMBOL(serio_interrupt);
 
-struct bus_type serio_bus = {
+const struct bus_type serio_bus = {
 	.name		= "serio",
 	.drv_groups	= serio_driver_groups,
 	.match		= serio_bus_match,
diff --git a/include/linux/serio.h b/include/linux/serio.h
index 6c27d413da92..7ca41af93b37 100644
--- a/include/linux/serio.h
+++ b/include/linux/serio.h
@@ -15,7 +15,7 @@
 #include <linux/mod_devicetable.h>
 #include <uapi/linux/serio.h>
 
-extern struct bus_type serio_bus;
+extern const struct bus_type serio_bus;
 
 struct serio {
 	void *port_data;

-- 
2.43.0


  parent reply	other threads:[~2024-02-10 15:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-10 15:15 [PATCH 0/2] Input: struct bus_type cleanup Ricardo B. Marliere
2024-02-10 15:15 ` [PATCH 1/2] Input: synaptics-rmi4 - make rmi_bus_type const Ricardo B. Marliere
2024-03-03 23:07   ` Dmitry Torokhov
2024-02-10 15:15 ` Ricardo B. Marliere [this message]
2024-03-03 23:07   ` [PATCH 2/2] Input: serio - make serio_bus const Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240210-bus_cleanup-input2-v1-2-0daef7e034e0@marliere.net \
    --to=ricardo@marliere.net \
    --cc=dmitry.torokhov@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®