summaryrefslogtreecommitdiff
path: root/drivers/tty/vt
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2020-03-16 07:59:09 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-03-16 08:41:17 +0100
commit85af37056a72c5e2e5758a44c94c78cbdf3658e3 (patch)
tree325fcc9e6e67868d4732b3a270810bdd983355b8 /drivers/tty/vt
parentb18d1c2efa47f7fbf20a7ca4e121a991c3272326 (diff)
vt: use min() to limit intervals
Instead of awkward ternary operator with comparison, use simple min() for blankinterval and vesa_off_interval. No functional change intended and "objdump -d" proves that. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20200316065911.11024-1-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/vt')
-rw-r--r--drivers/tty/vt/vt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index 2123bb09214c..6311f91d3cc7 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -1927,7 +1927,7 @@ static void setterm_command(struct vc_data *vc)
update_attr(vc);
break;
case 9: /* set blanking interval */
- blankinterval = ((vc->vc_par[1] < 60) ? vc->vc_par[1] : 60) * 60;
+ blankinterval = min(vc->vc_par[1], 60U) * 60;
poke_blanked_console();
break;
case 10: /* set bell frequency in Hz */
@@ -1951,7 +1951,7 @@ static void setterm_command(struct vc_data *vc)
poke_blanked_console();
break;
case 14: /* set vesa powerdown interval */
- vesa_off_interval = ((vc->vc_par[1] < 60) ? vc->vc_par[1] : 60) * 60 * HZ;
+ vesa_off_interval = min(vc->vc_par[1], 60U) * 60 * HZ;
break;
case 15: /* activate the previous console */
set_console(last_console);