tty: vt: reflow csi_J()
authorJiri Slaby (SUSE) <jirislaby@kernel.org>
Mon, 22 Jan 2024 11:03:26 +0000 (12:03 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 28 Jan 2024 02:08:53 +0000 (18:08 -0800)
Push cases one level left, according to coding style. And reorder local
variables.

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Tested-by: Helge Deller <deller@gmx.de> # parisc STI console
Link: https://lore.kernel.org/r/20240122110401.7289-13-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/vt/vt.c

index 85e89fb9b2075117f3c31a32c8dc211c1e7afe0a..bf77d962eeb4aa29195151dae5df55a60115c369 100644 (file)
@@ -1507,34 +1507,34 @@ enum CSI_J {
 
 static void csi_J(struct vc_data *vc, enum CSI_J vpar)
 {
+       unsigned short *start;
        unsigned int count;
-       unsigned short * start;
 
        switch (vpar) {
-               case CSI_J_CURSOR_TO_END:
-                       vc_uniscr_clear_line(vc, vc->state.x,
-                                            vc->vc_cols - vc->state.x);
-                       vc_uniscr_clear_lines(vc, vc->state.y + 1,
-                                             vc->vc_rows - vc->state.y - 1);
-                       count = (vc->vc_scr_end - vc->vc_pos) >> 1;
-                       start = (unsigned short *)vc->vc_pos;
-                       break;
-               case CSI_J_START_TO_CURSOR:
-                       vc_uniscr_clear_line(vc, 0, vc->state.x + 1);
-                       vc_uniscr_clear_lines(vc, 0, vc->state.y);
-                       count = ((vc->vc_pos - vc->vc_origin) >> 1) + 1;
-                       start = (unsigned short *)vc->vc_origin;
-                       break;
-               case CSI_J_FULL:
-                       flush_scrollback(vc);
-                       fallthrough;
-               case CSI_J_VISIBLE:
-                       vc_uniscr_clear_lines(vc, 0, vc->vc_rows);
-                       count = vc->vc_cols * vc->vc_rows;
-                       start = (unsigned short *)vc->vc_origin;
-                       break;
-               default:
-                       return;
+       case CSI_J_CURSOR_TO_END:
+               vc_uniscr_clear_line(vc, vc->state.x,
+                                    vc->vc_cols - vc->state.x);
+               vc_uniscr_clear_lines(vc, vc->state.y + 1,
+                                     vc->vc_rows - vc->state.y - 1);
+               count = (vc->vc_scr_end - vc->vc_pos) >> 1;
+               start = (unsigned short *)vc->vc_pos;
+               break;
+       case CSI_J_START_TO_CURSOR:
+               vc_uniscr_clear_line(vc, 0, vc->state.x + 1);
+               vc_uniscr_clear_lines(vc, 0, vc->state.y);
+               count = ((vc->vc_pos - vc->vc_origin) >> 1) + 1;
+               start = (unsigned short *)vc->vc_origin;
+               break;
+       case CSI_J_FULL:
+               flush_scrollback(vc);
+               fallthrough;
+       case CSI_J_VISIBLE:
+               vc_uniscr_clear_lines(vc, 0, vc->vc_rows);
+               count = vc->vc_cols * vc->vc_rows;
+               start = (unsigned short *)vc->vc_origin;
+               break;
+       default:
+               return;
        }
        scr_memsetw(start, vc->vc_video_erase_char, 2 * count);
        if (con_should_update(vc))