Skip to content

Commit

Permalink
vt: use min() to limit intervals
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jiri Slaby authored and Greg Kroah-Hartman committed Mar 16, 2020
1 parent b18d1c2 commit 85af370
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/tty/vt/vt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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);
Expand Down

0 comments on commit 85af370

Please sign in to comment.