linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] /proc/sysrq-trigger: accept multiple keys at once
@ 2023-11-13 18:22 Tomas Mudrunka
  2023-11-13 18:33 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 21+ messages in thread
From: Tomas Mudrunka @ 2023-11-13 18:22 UTC (permalink / raw)
  Cc: tomas.mudrunka, Greg Kroah-Hartman, Jiri Slaby, linux-kernel,
	linux-serial

Just for convenience.
This way we can do:
`echo reisub > /proc/sysrq-trigger`
Instead of:
`for i in r e i s u b; do echo "$i" > /proc/sysrq-trigger; done;`

Signed-off-by: Tomas Mudrunka <tomas.mudrunka@gmail.com>
---
 drivers/tty/sysrq.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c
index 6b4a28bcf..bc5a679f6 100644
--- a/drivers/tty/sysrq.c
+++ b/drivers/tty/sysrq.c
@@ -1154,10 +1154,12 @@ EXPORT_SYMBOL(unregister_sysrq_key);
 static ssize_t write_sysrq_trigger(struct file *file, const char __user *buf,
 				   size_t count, loff_t *ppos)
 {
-	if (count) {
+	size_t i;
+
+	for (i = 0; i < count; i++) {
 		char c;
 
-		if (get_user(c, buf))
+		if (get_user(c, buf+i))
 			return -EFAULT;
 		__handle_sysrq(c, false);
 	}
-- 
2.42.1


^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2023-11-20 11:32 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-13 18:22 [PATCH] /proc/sysrq-trigger: accept multiple keys at once Tomas Mudrunka
2023-11-13 18:33 ` Greg Kroah-Hartman
2023-11-13 21:09   ` Tomáš Mudruňka
2023-11-13 21:37     ` Greg Kroah-Hartman
2023-11-14  9:35       ` [PATCH v2] " Tomas Mudrunka
2023-11-14  9:44         ` Jiri Slaby
2023-11-14  9:49           ` [PATCH v3] " Tomas Mudrunka
2023-11-14  9:50             ` Jiri Slaby
2023-11-14  9:55               ` [PATCH v4] " Tomas Mudrunka
2023-11-14 12:14                 ` Greg KH
2023-11-14 12:41                   ` [PATCH v5] " Tomas Mudrunka
2023-11-14 15:12                     ` [PATCH v6] " Tomas Mudrunka
2023-11-14 18:04                       ` Jiri Slaby
2023-11-14 22:00                         ` Randy Dunlap
2023-11-15 10:10                           ` Jiri Slaby
2023-11-15 10:27                             ` [PATCH v7] " Tomas Mudrunka
2023-11-15 10:29                             ` [PATCH v8] " Tomas Mudrunka
2023-11-15 10:34                             ` [PATCH v9] " Tomas Mudrunka
2023-11-20  7:45                               ` Jiri Slaby
2023-11-20 11:14                                 ` [PATCH v10] " Tomas Mudrunka
2023-11-20 11:32                                   ` Jiri Slaby

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).