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

tty: vt: use enum constants for VESA blanking modes



Use the new enum for VESA constants. This improves type checking in
consw::con_blank().

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


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 15d0fff7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -175,7 +175,7 @@ int do_poke_blanked_console;
int console_blanked;
EXPORT_SYMBOL(console_blanked);

static int vesa_blank_mode; /* 0:none 1:suspendV 2:suspendH 3:powerdown */
static enum vesa_blank_mode vesa_blank_mode;
static int vesa_off_interval;
static int blankinterval;
core_param(consoleblank, blankinterval, int, 0444);
@@ -4320,7 +4320,7 @@ static int set_vesa_blanking(u8 __user *mode_user)
		return -EFAULT;

	console_lock();
	vesa_blank_mode = (mode < 4) ? mode : VESA_NO_BLANKING;
	vesa_blank_mode = (mode <= VESA_BLANK_MAX) ? mode : VESA_NO_BLANKING;
	console_unlock();

	return 0;
+4 −2
Original line number Diff line number Diff line
@@ -79,7 +79,8 @@ 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, int blank, int mode_switch)
static int dummycon_blank(struct vc_data *vc, enum vesa_blank_mode blank,
			  int mode_switch)
{
	/* Redraw, so that we get putc(s) for output done while blanked */
	return 1;
@@ -89,7 +90,8 @@ 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, int blank, int mode_switch)
static int dummycon_blank(struct vc_data *vc, enum vesa_blank_mode blank,
			  int mode_switch)
{
	return 0;
}
+2 −1
Original line number Diff line number Diff line
@@ -451,7 +451,8 @@ static bool mdacon_switch(struct vc_data *c)
	return true;	/* redrawing needed */
}

static int mdacon_blank(struct vc_data *c, int blank, int mode_switch)
static int mdacon_blank(struct vc_data *c, enum vesa_blank_mode blank,
			int mode_switch)
{
	if (mda_type == TYPE_MDA) {
		if (blank) 
+2 −1
Original line number Diff line number Diff line
@@ -476,7 +476,8 @@ static bool newport_switch(struct vc_data *vc)
	return true;
}

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

+2 −1
Original line number Diff line number Diff line
@@ -298,7 +298,8 @@ static bool sticon_switch(struct vc_data *conp)
    return true;	/* needs refreshing */
}

static int sticon_blank(struct vc_data *c, int blank, int mode_switch)
static int sticon_blank(struct vc_data *c, enum vesa_blank_mode blank,
			int mode_switch)
{
    if (blank == VESA_NO_BLANKING) {
	if (mode_switch)
Loading