lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <tencent_F413E4391B578208516E16AA0FC81F2FEC07@qq.com>
Date: Thu,  3 Apr 2025 15:15:35 +0800
From: xiaopeitux@...mail.com
To: gregkh@...uxfoundation.org,
	jirislaby@...nel.org,
	linux-serial@...r.kernel.org,
	linux-kernel@...r.kernel.org
Cc: Pei Xiao <xiaopei01@...inos.cn>
Subject: [PATCH] tty/sysrq: make sysrq_replay_logs_op const and refactor sysrq_mask()

From: Pei Xiao <xiaopei01@...inos.cn>

Mark sysrq_replay_logs_op as const and simplify sysrq_mask().

Signed-off-by: Pei Xiao <xiaopei01@...inos.cn>
---
 drivers/tty/sysrq.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c
index f85ce02e4725..c2a26abcb8cd 100644
--- a/drivers/tty/sysrq.c
+++ b/drivers/tty/sysrq.c
@@ -71,9 +71,7 @@ static bool sysrq_on(void)
  */
 int sysrq_mask(void)
 {
-	if (sysrq_always_enabled)
-		return 1;
-	return sysrq_enabled;
+	return sysrq_always_enabled ? 1 : sysrq_enabled;
 }
 EXPORT_SYMBOL_GPL(sysrq_mask);
 
@@ -454,7 +452,7 @@ static void sysrq_handle_replay_logs(u8 key)
 {
 	console_try_replay_all();
 }
-static struct sysrq_key_op sysrq_replay_logs_op = {
+static const struct sysrq_key_op sysrq_replay_logs_op = {
 	.handler        = sysrq_handle_replay_logs,
 	.help_msg       = "replay-kernel-logs(R)",
 	.action_msg     = "Replay kernel logs on consoles",
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ