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

tty: vt: make types around consw::con_blank() bool



Both the mode_switch parameter and the return value (a redraw needed)
are true/false. So switch them to bool, so that users won't return
-Eerrors or anything else.

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-36-jirislaby@kernel.org


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0a58d83d
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -79,21 +79,21 @@ static void dummycon_putcs(struct vc_data *vc, const u16 *s, unsigned int count,
	raw_notifier_call_chain(&dummycon_output_nh, 0, NULL);
}

static int dummycon_blank(struct vc_data *vc, enum vesa_blank_mode blank,
			  int mode_switch)
static bool dummycon_blank(struct vc_data *vc, enum vesa_blank_mode blank,
			   bool mode_switch)
{
	/* Redraw, so that we get putc(s) for output done while blanked */
	return 1;
	return true;
}
#else
static void dummycon_putc(struct vc_data *vc, u16 c, unsigned int y,
			  unsigned int x) { }
static void dummycon_putcs(struct vc_data *vc, const u16 *s, unsigned int count,
			   unsigned int ypos, unsigned int xpos) { }
static int dummycon_blank(struct vc_data *vc, enum vesa_blank_mode blank,
			  int mode_switch)
static bool dummycon_blank(struct vc_data *vc, enum vesa_blank_mode blank,
			   bool mode_switch)
{
	return 0;
	return false;
}
#endif

+4 −4
Original line number Diff line number Diff line
@@ -451,8 +451,8 @@ static bool mdacon_switch(struct vc_data *c)
	return true;	/* redrawing needed */
}

static int mdacon_blank(struct vc_data *c, enum vesa_blank_mode blank,
			int mode_switch)
static bool mdacon_blank(struct vc_data *c, enum vesa_blank_mode blank,
			 bool mode_switch)
{
	if (mda_type == TYPE_MDA) {
		if (blank) 
@@ -460,14 +460,14 @@ static int mdacon_blank(struct vc_data *c, enum vesa_blank_mode blank,
				mda_convert_attr(c->vc_video_erase_char),
				c->vc_screenbuf_size);
		/* Tell console.c that it has to restore the screen itself */
		return 1;
		return true;
	} else {
		if (blank)
			outb_p(0x00, mda_mode_port);	/* disable video */
		else
			outb_p(MDA_MODE_VIDEO_EN | MDA_MODE_BLINK_EN, 
				mda_mode_port);
		return 0;
		return false;
	}
}

+4 −3
Original line number Diff line number Diff line
@@ -476,8 +476,8 @@ static bool newport_switch(struct vc_data *vc)
	return true;
}

static int newport_blank(struct vc_data *c, enum vesa_blank_mode blank,
			 int mode_switch)
static bool newport_blank(struct vc_data *c, enum vesa_blank_mode blank,
			  bool mode_switch)
{
	unsigned short treg;

@@ -492,7 +492,8 @@ static int newport_blank(struct vc_data *c, enum vesa_blank_mode blank,
		newport_vc2_set(npregs, VC2_IREG_CONTROL,
				(treg & ~(VC2_CTRL_EDISP)));
	}
	return 1;

	return true;
}

static int newport_set_font(int unit, struct console_font *op, unsigned int vpitch)
+5 −4
Original line number Diff line number Diff line
@@ -298,19 +298,20 @@ static bool sticon_switch(struct vc_data *conp)
    return true;	/* needs refreshing */
}

static int sticon_blank(struct vc_data *c, enum vesa_blank_mode blank,
			int mode_switch)
static bool sticon_blank(struct vc_data *c, enum vesa_blank_mode blank,
			 bool mode_switch)
{
    if (blank == VESA_NO_BLANKING) {
	if (mode_switch)
	    vga_is_gfx = 0;
	return 1;
	return true;
    }
    sti_clear(sticon_sti, 0, 0, c->vc_rows, c->vc_cols, BLANK,
	      font_data[c->vc_num]);
    if (mode_switch)
	vga_is_gfx = 1;
    return 1;

    return true;
}

static u8 sticon_build_attr(struct vc_data *conp, u8 color,
+2 −2
Original line number Diff line number Diff line
@@ -797,8 +797,8 @@ static void vga_pal_blank(struct vgastate *state)
	}
}

static int vgacon_blank(struct vc_data *c, enum vesa_blank_mode blank,
			int mode_switch)
static bool vgacon_blank(struct vc_data *c, enum vesa_blank_mode blank,
			 bool mode_switch)
{
	switch (blank) {
	case VESA_NO_BLANKING:		/* Unblank */
Loading