aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@linaro.org>2025-08-06 14:46:12 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-08-13 17:42:26 +0200
commit96c08ff80b8fce45e49fee5eba4b40b1654eb5aa (patch)
treefec7f40304eb6eae9af0dc3b9687430925415ffa /drivers/tty
parentLinux 6.17-rc1 (diff)
downloadlinux-96c08ff80b8fce45e49fee5eba4b40b1654eb5aa.tar.gz
linux-96c08ff80b8fce45e49fee5eba4b40b1654eb5aa.zip
tty: sysrq: delete unnecessary check
This code checks if (write) is true twice in a row. It's more readable to delete the first check. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Jiri Slaby <jirislaby@kernel.org> Link: https://lore.kernel.org/r/aJNAhHtKkhWjosDV@stanley.mountain Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/sysrq.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c
index 97f8a9a52285..1f78b0db3b25 100644
--- a/drivers/tty/sysrq.c
+++ b/drivers/tty/sysrq.c
@@ -1133,8 +1133,7 @@ static int sysrq_sysctl_handler(const struct ctl_table *table, int write,
* Behaves like do_proc_dointvec as t does not have min nor max.
*/
ret = proc_dointvec_minmax(&t, write, buffer, lenp, ppos);
-
- if (ret || !write)
+ if (ret)
return ret;
if (write)