mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-06 05:06:29 +00:00
tty: sysrq: switch the rest of keys to u8
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> Link: https://lore.kernel.org/r/20230712081811.29004-4-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
bcb48185ed
commit
8ac20a03da
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user