public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andras Sebok <sebokandris2009@gmail.com>
To: linux-serial@vger.kernel.org
Cc: andriseseboke@gmail.com, linux-kernel@vger.kernel.org,
	jirislaby@kernel.org, gregkh@linuxfoundation.org,
	Andras Sebok <sebokandris2009@gmail.com>
Subject: [PATCH 2/2] Add disabled text to indicate inactive commands in sysrq help menu
Date: Mon, 28 Aug 2023 12:27:56 +0200	[thread overview]
Message-ID: <20230828102753.4811-5-sebokandris2009@gmail.com> (raw)
In-Reply-To: <20230828102753.4811-2-sebokandris2009@gmail.com>

This patch adds disabled text after disabled commands in sysrq help.

before:
sak : k

after:
sak : k (disabled)

Signed-off-by: Andras Sebok <sebokandris2009@gmail.com>
---
 drivers/tty/sysrq.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c
index 831cdadf366f..1af78f76232e 100644
--- a/drivers/tty/sysrq.c
+++ b/drivers/tty/sysrq.c
@@ -617,6 +617,9 @@ void __handle_sysrq(int key, bool check_mask)
 				if (j != i)
 					continue;
 				pr_cont("%s ", sysrq_key_table[i]->help_msg);
+				if (!check_mask || (check_mask &&
+					!sysrq_on_mask(sysrq_key_table[i]->enable_mask)))
+					pr_cont("(disabled)");
 				pr_cont("\n");
 			}
 		}
-- 
2.41.0


  reply	other threads:[~2023-08-28 10:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-28 10:27 [PATCH 1/2] Simplify sysrq help Andras Sebok
2023-08-28 10:27 ` Andras Sebok [this message]
2023-08-28 10:52   ` [PATCH 2/2] Add disabled text to indicate inactive commands in sysrq help menu Greg KH
2023-08-28 10:51 ` [PATCH 1/2] Simplify sysrq help Greg KH
2023-08-28 14:03   ` Theodore Ts'o

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=20230828102753.4811-5-sebokandris2009@gmail.com \
    --to=sebokandris2009@gmail.com \
    --cc=andriseseboke@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.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