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>
This commit is contained in:
Dan Carpenter 2025-08-06 14:46:12 +03:00 committed by Greg Kroah-Hartman
parent 8f5ae30d69
commit 96c08ff80b
1 changed files with 1 additions and 2 deletions

View File

@ -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. * Behaves like do_proc_dointvec as t does not have min nor max.
*/ */
ret = proc_dointvec_minmax(&t, write, buffer, lenp, ppos); ret = proc_dointvec_minmax(&t, write, buffer, lenp, ppos);
if (ret)
if (ret || !write)
return ret; return ret;
if (write) if (write)