Commit c3a834e8 authored by Jiri Slaby's avatar Jiri Slaby Committed by Greg Kroah-Hartman

vt: indent switch-case in setterm_command properly

Shift cases one level left. This makes the code more readable and some
lines need not wrap anymore.
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20200316065911.11024-3-jslaby@suse.czSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f0e8e3da
...@@ -1902,67 +1902,65 @@ static void set_mode(struct vc_data *vc, int on_off) ...@@ -1902,67 +1902,65 @@ static void set_mode(struct vc_data *vc, int on_off)
/* console_lock is held */ /* console_lock is held */
static void setterm_command(struct vc_data *vc) static void setterm_command(struct vc_data *vc)
{ {
switch(vc->vc_par[0]) { switch (vc->vc_par[0]) {
case 1: /* set color for underline mode */ case 1: /* set color for underline mode */
if (vc->vc_can_do_color && if (vc->vc_can_do_color && vc->vc_par[1] < 16) {
vc->vc_par[1] < 16) { vc->vc_ulcolor = color_table[vc->vc_par[1]];
vc->vc_ulcolor = color_table[vc->vc_par[1]]; if (vc->vc_underline)
if (vc->vc_underline) update_attr(vc);
update_attr(vc); }
} break;
break; case 2: /* set color for half intensity mode */
case 2: /* set color for half intensity mode */ if (vc->vc_can_do_color && vc->vc_par[1] < 16) {
if (vc->vc_can_do_color && vc->vc_halfcolor = color_table[vc->vc_par[1]];
vc->vc_par[1] < 16) { if (vc->vc_intensity == 0)
vc->vc_halfcolor = color_table[vc->vc_par[1]]; update_attr(vc);
if (vc->vc_intensity == 0) }
update_attr(vc); break;
} case 8: /* store colors as defaults */
break; vc->vc_def_color = vc->vc_attr;
case 8: /* store colors as defaults */ if (vc->vc_hi_font_mask == 0x100)
vc->vc_def_color = vc->vc_attr; vc->vc_def_color >>= 1;
if (vc->vc_hi_font_mask == 0x100) default_attr(vc);
vc->vc_def_color >>= 1; update_attr(vc);
default_attr(vc); break;
update_attr(vc); case 9: /* set blanking interval */
break; blankinterval = min(vc->vc_par[1], 60U) * 60;
case 9: /* set blanking interval */ poke_blanked_console();
blankinterval = min(vc->vc_par[1], 60U) * 60; break;
poke_blanked_console(); case 10: /* set bell frequency in Hz */
break; if (vc->vc_npar >= 1)
case 10: /* set bell frequency in Hz */ vc->vc_bell_pitch = vc->vc_par[1];
if (vc->vc_npar >= 1) else
vc->vc_bell_pitch = vc->vc_par[1]; vc->vc_bell_pitch = DEFAULT_BELL_PITCH;
else break;
vc->vc_bell_pitch = DEFAULT_BELL_PITCH; case 11: /* set bell duration in msec */
break; if (vc->vc_npar >= 1)
case 11: /* set bell duration in msec */ vc->vc_bell_duration = (vc->vc_par[1] < 2000) ?
if (vc->vc_npar >= 1) msecs_to_jiffies(vc->vc_par[1]) : 0;
vc->vc_bell_duration = (vc->vc_par[1] < 2000) ? else
msecs_to_jiffies(vc->vc_par[1]) : 0; vc->vc_bell_duration = DEFAULT_BELL_DURATION;
else break;
vc->vc_bell_duration = DEFAULT_BELL_DURATION; case 12: /* bring specified console to the front */
break; if (vc->vc_par[1] >= 1 && vc_cons_allocated(vc->vc_par[1] - 1))
case 12: /* bring specified console to the front */ set_console(vc->vc_par[1] - 1);
if (vc->vc_par[1] >= 1 && vc_cons_allocated(vc->vc_par[1] - 1)) break;
set_console(vc->vc_par[1] - 1); case 13: /* unblank the screen */
break; poke_blanked_console();
case 13: /* unblank the screen */ break;
poke_blanked_console(); case 14: /* set vesa powerdown interval */
break; vesa_off_interval = min(vc->vc_par[1], 60U) * 60 * HZ;
case 14: /* set vesa powerdown interval */ break;
vesa_off_interval = min(vc->vc_par[1], 60U) * 60 * HZ; case 15: /* activate the previous console */
break; set_console(last_console);
case 15: /* activate the previous console */ break;
set_console(last_console); case 16: /* set cursor blink duration in msec */
break; if (vc->vc_npar >= 1 && vc->vc_par[1] >= 50 &&
case 16: /* set cursor blink duration in msec */ vc->vc_par[1] <= USHRT_MAX)
if (vc->vc_npar >= 1 && vc->vc_par[1] >= 50 && vc->vc_cur_blink_ms = vc->vc_par[1];
vc->vc_par[1] <= USHRT_MAX) else
vc->vc_cur_blink_ms = vc->vc_par[1]; vc->vc_cur_blink_ms = DEFAULT_CURSOR_BLINK_MS;
else break;
vc->vc_cur_blink_ms = DEFAULT_CURSOR_BLINK_MS;
break;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment