Commit 8d5cc8ee authored by Jiri Slaby (SUSE)'s avatar Jiri Slaby (SUSE) Committed by Greg Kroah-Hartman
Browse files

tty: vt: make consw::con_switch() return a bool



The non-zero (true) return value from consw::con_switch() means a redraw
is needed. So make this return type a bool explicitly instead of int.
The latter might imply that -Eerrors are expected. They are not.

And document the hook.

Signed-off-by: default avatar"Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Cc: Helge Deller <deller@gmx.de>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: linux-fbdev@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-parisc@vger.kernel.org
Tested-by: Helge Deller <deller@gmx.de> # parisc STI console
Link: https://lore.kernel.org/r/20240122110401.7289-31-jirislaby@kernel.org


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a292e3fc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -970,7 +970,7 @@ void redraw_screen(struct vc_data *vc, int is_switch)
	}

	if (redraw) {
		int update;
		bool update;
		int old_was_color = vc->vc_can_do_color;

		set_origin(vc);
+2 −2
Original line number Diff line number Diff line
@@ -122,9 +122,9 @@ static bool dummycon_scroll(struct vc_data *vc, unsigned int top,
	return false;
}

static int dummycon_switch(struct vc_data *vc)
static bool dummycon_switch(struct vc_data *vc)
{
	return 0;
	return false;
}

/*
+2 −2
Original line number Diff line number Diff line
@@ -446,9 +446,9 @@ static void mdacon_clear(struct vc_data *c, unsigned int y, unsigned int x,
	scr_memsetw(dest, eattr, width * 2);
}

static int mdacon_switch(struct vc_data *c)
static bool mdacon_switch(struct vc_data *c)
{
	return 1;	/* redrawing needed */
	return true;	/* redrawing needed */
}

static int mdacon_blank(struct vc_data *c, int blank, int mode_switch)
+2 −2
Original line number Diff line number Diff line
@@ -459,7 +459,7 @@ static void newport_cursor(struct vc_data *vc, bool enable)
	newport_vc2_set(npregs, VC2_IREG_CURSY, ycurs);
}

static int newport_switch(struct vc_data *vc)
static bool newport_switch(struct vc_data *vc)
{
	static int logo_drawn = 0;

@@ -473,7 +473,7 @@ static int newport_switch(struct vc_data *vc)
		}
	}

	return 1;
	return true;
}

static int newport_blank(struct vc_data *c, int blank, int mode_switch)
+2 −2
Original line number Diff line number Diff line
@@ -293,9 +293,9 @@ static void sticon_clear(struct vc_data *conp, unsigned int sy, unsigned int sx,
	      conp->vc_video_erase_char, font_data[conp->vc_num]);
}

static int sticon_switch(struct vc_data *conp)
static bool sticon_switch(struct vc_data *conp)
{
    return 1;	/* needs refreshing */
    return true;	/* needs refreshing */
}

static int sticon_blank(struct vc_data *c, int blank, int mode_switch)
Loading