From: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
To: gregkh@linuxfoundation.org
Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
"Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Subject: [PATCH 03/10] tty: sysrq: switch the rest of keys to u8
Date: Wed, 12 Jul 2023 10:18:04 +0200 [thread overview]
Message-ID: <20230712081811.29004-4-jirislaby@kernel.org> (raw)
In-Reply-To: <20230712081811.29004-1-jirislaby@kernel.org>
Propagate u8 more from the bottom to the interface, so that sysrq
callers (usually drivers) see that u8 is expected.
Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
---
drivers/tty/sysrq.c | 16 ++++++++--------
include/linux/sysrq.h | 16 ++++++++--------
2 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c
index 1271a82c0887..ccf429ba348e 100644
--- a/drivers/tty/sysrq.c
+++ b/drivers/tty/sysrq.c
@@ -530,7 +530,7 @@ static const struct sysrq_key_op *sysrq_key_table[62] = {
};
/* key2index calculation, -1 on invalid index */
-static int sysrq_key_table_key2index(int key)
+static int sysrq_key_table_key2index(u8 key)
{
int retval;
@@ -548,7 +548,7 @@ static int sysrq_key_table_key2index(int key)
/*
* get and put functions for the table, exposed to modules.
*/
-static const struct sysrq_key_op *__sysrq_get_key_op(int key)
+static const struct sysrq_key_op *__sysrq_get_key_op(u8 key)
{
const struct sysrq_key_op *op_p = NULL;
int i;
@@ -560,7 +560,7 @@ static const struct sysrq_key_op *__sysrq_get_key_op(int key)
return op_p;
}
-static void __sysrq_put_key_op(int key, const struct sysrq_key_op *op_p)
+static void __sysrq_put_key_op(u8 key, const struct sysrq_key_op *op_p)
{
int i = sysrq_key_table_key2index(key);
@@ -568,7 +568,7 @@ static void __sysrq_put_key_op(int key, const struct sysrq_key_op *op_p)
sysrq_key_table[i] = op_p;
}
-void __handle_sysrq(int key, bool check_mask)
+void __handle_sysrq(u8 key, bool check_mask)
{
const struct sysrq_key_op *op_p;
int orig_log_level;
@@ -627,7 +627,7 @@ void __handle_sysrq(int key, bool check_mask)
suppress_printk = orig_suppress_printk;
}
-void handle_sysrq(int key)
+void handle_sysrq(u8 key)
{
if (sysrq_on())
__handle_sysrq(key, true);
@@ -1111,7 +1111,7 @@ int sysrq_toggle_support(int enable_mask)
}
EXPORT_SYMBOL_GPL(sysrq_toggle_support);
-static int __sysrq_swap_key_ops(int key, const struct sysrq_key_op *insert_op_p,
+static int __sysrq_swap_key_ops(u8 key, const struct sysrq_key_op *insert_op_p,
const struct sysrq_key_op *remove_op_p)
{
int retval;
@@ -1135,13 +1135,13 @@ static int __sysrq_swap_key_ops(int key, const struct sysrq_key_op *insert_op_p,
return retval;
}
-int register_sysrq_key(int key, const struct sysrq_key_op *op_p)
+int register_sysrq_key(u8 key, const struct sysrq_key_op *op_p)
{
return __sysrq_swap_key_ops(key, op_p, NULL);
}
EXPORT_SYMBOL(register_sysrq_key);
-int unregister_sysrq_key(int key, const struct sysrq_key_op *op_p)
+int unregister_sysrq_key(u8 key, const struct sysrq_key_op *op_p)
{
return __sysrq_swap_key_ops(key, NULL, op_p);
}
diff --git a/include/linux/sysrq.h b/include/linux/sysrq.h
index bb8d07814b0e..bdca467ebb77 100644
--- a/include/linux/sysrq.h
+++ b/include/linux/sysrq.h
@@ -43,10 +43,10 @@ struct sysrq_key_op {
* are available -- else NULL's).
*/
-void handle_sysrq(int key);
-void __handle_sysrq(int key, bool check_mask);
-int register_sysrq_key(int key, const struct sysrq_key_op *op);
-int unregister_sysrq_key(int key, const struct sysrq_key_op *op);
+void handle_sysrq(u8 key);
+void __handle_sysrq(u8 key, bool check_mask);
+int register_sysrq_key(u8 key, const struct sysrq_key_op *op);
+int unregister_sysrq_key(u8 key, const struct sysrq_key_op *op);
extern const struct sysrq_key_op *__sysrq_reboot_op;
int sysrq_toggle_support(int enable_mask);
@@ -54,20 +54,20 @@ int sysrq_mask(void);
#else
-static inline void handle_sysrq(int key)
+static inline void handle_sysrq(u8 key)
{
}
-static inline void __handle_sysrq(int key, bool check_mask)
+static inline void __handle_sysrq(u8 key, bool check_mask)
{
}
-static inline int register_sysrq_key(int key, const struct sysrq_key_op *op)
+static inline int register_sysrq_key(u8 key, const struct sysrq_key_op *op)
{
return -EINVAL;
}
-static inline int unregister_sysrq_key(int key, const struct sysrq_key_op *op)
+static inline int unregister_sysrq_key(u8 key, const struct sysrq_key_op *op)
{
return -EINVAL;
}
--
2.41.0
next prev parent reply other threads:[~2023-07-12 8:23 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-12 8:18 [PATCH 00/10] tty: u8 conversion preparation Jiri Slaby (SUSE)
2023-07-12 8:18 ` [PATCH 01/10] tty: sysrq: rename and re-type i in sysrq_handle_loglevel() Jiri Slaby (SUSE)
2023-07-12 8:18 ` [PATCH 02/10] tty: sysrq: switch sysrq handlers from int to u8 Jiri Slaby (SUSE)
2023-07-12 8:34 ` Thomas Zimmermann
2023-07-12 13:37 ` Paul E. McKenney
2023-07-12 15:19 ` Daniel Thompson
2023-07-13 2:45 ` WANG Xuerui
2023-07-12 8:18 ` Jiri Slaby (SUSE) [this message]
2023-07-12 8:18 ` [PATCH 04/10] tty: sysrq: use switch in sysrq_key_table_key2index() Jiri Slaby (SUSE)
2023-07-12 8:18 ` [PATCH 05/10] serial: convert uart sysrq handling to u8 Jiri Slaby (SUSE)
2023-07-12 8:18 ` [PATCH 06/10] serial: make uart_insert_char() accept u8s Jiri Slaby (SUSE)
2023-07-12 8:18 ` [PATCH 07/10] serial: pass state to __uart_start() directly Jiri Slaby (SUSE)
2023-07-12 8:18 ` [PATCH 08/10] serial: arc_uart: simplify flags handling in arc_serial_rx_chars() Jiri Slaby (SUSE)
2023-07-13 0:58 ` Vineet Gupta
2023-07-12 8:18 ` [PATCH 09/10] serial: omap-serial: remove flag from serial_omap_rdi() Jiri Slaby (SUSE)
2023-07-12 8:18 ` [PATCH 10/10] serial: drivers: switch ch and flag to u8 Jiri Slaby (SUSE)
2023-07-12 9:44 ` Maciej W. Rozycki
2023-07-12 12:35 ` Thierry Reding
2023-07-13 13:58 ` Tobias Klauser
2023-07-14 9:45 ` Richard Genoud
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=20230712081811.29004-4-jirislaby@kernel.org \
--to=jirislaby@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@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