Commit 7995c30d authored by Jiri Slaby (SUSE)'s avatar Jiri Slaby (SUSE) Committed by Greg Kroah-Hartman

tty: vt: make consw::con_debug_*() return void

The return value of con_debug_enter() and con_debug_leave() is ignored
on many fronts. So just don't propagate errors (the current
implementations return 0 anyway) and make the return type a void.
Signed-off-by: default avatar"Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Helge Deller <deller@gmx.de>
Cc: linux-fbdev@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Tested-by: Helge Deller <deller@gmx.de> # parisc STI console
Link: https://lore.kernel.org/r/20240122110401.7289-20-jirislaby@kernel.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 649f6fbe
...@@ -4012,15 +4012,9 @@ EXPORT_SYMBOL(con_is_visible); ...@@ -4012,15 +4012,9 @@ EXPORT_SYMBOL(con_is_visible);
* Called when the console is taken over by the kernel debugger, this * Called when the console is taken over by the kernel debugger, this
* function needs to save the current console state, then put the console * function needs to save the current console state, then put the console
* into a state suitable for the kernel debugger. * into a state suitable for the kernel debugger.
*
* RETURNS:
* Zero on success, nonzero if a failure occurred when trying to prepare
* the console for the debugger.
*/ */
int con_debug_enter(struct vc_data *vc) void con_debug_enter(struct vc_data *vc)
{ {
int ret = 0;
saved_fg_console = fg_console; saved_fg_console = fg_console;
saved_last_console = last_console; saved_last_console = last_console;
saved_want_console = want_console; saved_want_console = want_console;
...@@ -4029,7 +4023,7 @@ int con_debug_enter(struct vc_data *vc) ...@@ -4029,7 +4023,7 @@ int con_debug_enter(struct vc_data *vc)
vc->vc_mode = KD_TEXT; vc->vc_mode = KD_TEXT;
console_blanked = 0; console_blanked = 0;
if (vc->vc_sw->con_debug_enter) if (vc->vc_sw->con_debug_enter)
ret = vc->vc_sw->con_debug_enter(vc); vc->vc_sw->con_debug_enter(vc);
#ifdef CONFIG_KGDB_KDB #ifdef CONFIG_KGDB_KDB
/* Set the initial LINES variable if it is not already set */ /* Set the initial LINES variable if it is not already set */
if (vc->vc_rows < 999) { if (vc->vc_rows < 999) {
...@@ -4059,7 +4053,6 @@ int con_debug_enter(struct vc_data *vc) ...@@ -4059,7 +4053,6 @@ int con_debug_enter(struct vc_data *vc)
} }
} }
#endif /* CONFIG_KGDB_KDB */ #endif /* CONFIG_KGDB_KDB */
return ret;
} }
EXPORT_SYMBOL_GPL(con_debug_enter); EXPORT_SYMBOL_GPL(con_debug_enter);
...@@ -4068,15 +4061,10 @@ EXPORT_SYMBOL_GPL(con_debug_enter); ...@@ -4068,15 +4061,10 @@ EXPORT_SYMBOL_GPL(con_debug_enter);
* *
* Restore the console state to what it was before the kernel debugger * Restore the console state to what it was before the kernel debugger
* was invoked. * was invoked.
*
* RETURNS:
* Zero on success, nonzero if a failure occurred when trying to restore
* the console.
*/ */
int con_debug_leave(void) void con_debug_leave(void)
{ {
struct vc_data *vc; struct vc_data *vc;
int ret = 0;
fg_console = saved_fg_console; fg_console = saved_fg_console;
last_console = saved_last_console; last_console = saved_last_console;
...@@ -4086,8 +4074,7 @@ int con_debug_leave(void) ...@@ -4086,8 +4074,7 @@ int con_debug_leave(void)
vc = vc_cons[fg_console].d; vc = vc_cons[fg_console].d;
if (vc->vc_sw->con_debug_leave) if (vc->vc_sw->con_debug_leave)
ret = vc->vc_sw->con_debug_leave(vc); vc->vc_sw->con_debug_leave(vc);
return ret;
} }
EXPORT_SYMBOL_GPL(con_debug_leave); EXPORT_SYMBOL_GPL(con_debug_leave);
......
...@@ -2243,7 +2243,7 @@ static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch) ...@@ -2243,7 +2243,7 @@ static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch)
return 0; return 0;
} }
static int fbcon_debug_enter(struct vc_data *vc) static void fbcon_debug_enter(struct vc_data *vc)
{ {
struct fb_info *info = fbcon_info_from_console(vc->vc_num); struct fb_info *info = fbcon_info_from_console(vc->vc_num);
struct fbcon_ops *ops = info->fbcon_par; struct fbcon_ops *ops = info->fbcon_par;
...@@ -2253,10 +2253,9 @@ static int fbcon_debug_enter(struct vc_data *vc) ...@@ -2253,10 +2253,9 @@ static int fbcon_debug_enter(struct vc_data *vc)
if (info->fbops->fb_debug_enter) if (info->fbops->fb_debug_enter)
info->fbops->fb_debug_enter(info); info->fbops->fb_debug_enter(info);
fbcon_set_palette(vc, color_table); fbcon_set_palette(vc, color_table);
return 0;
} }
static int fbcon_debug_leave(struct vc_data *vc) static void fbcon_debug_leave(struct vc_data *vc)
{ {
struct fb_info *info = fbcon_info_from_console(vc->vc_num); struct fb_info *info = fbcon_info_from_console(vc->vc_num);
struct fbcon_ops *ops = info->fbcon_par; struct fbcon_ops *ops = info->fbcon_par;
...@@ -2264,7 +2263,6 @@ static int fbcon_debug_leave(struct vc_data *vc) ...@@ -2264,7 +2263,6 @@ static int fbcon_debug_leave(struct vc_data *vc)
ops->graphics = ops->save_graphics; ops->graphics = ops->save_graphics;
if (info->fbops->fb_debug_leave) if (info->fbops->fb_debug_leave)
info->fbops->fb_debug_leave(info); info->fbops->fb_debug_leave(info);
return 0;
} }
static int fbcon_get_font(struct vc_data *vc, struct console_font *font, unsigned int vpitch) static int fbcon_get_font(struct vc_data *vc, struct console_font *font, unsigned int vpitch)
......
...@@ -88,11 +88,11 @@ struct consw { ...@@ -88,11 +88,11 @@ struct consw {
* limited to, unblanking the console, loading an appropriate * limited to, unblanking the console, loading an appropriate
* palette, and allowing debugger generated output. * palette, and allowing debugger generated output.
*/ */
int (*con_debug_enter)(struct vc_data *vc); void (*con_debug_enter)(struct vc_data *vc);
/* /*
* Restore the console to its pre-debug state as closely as possible. * Restore the console to its pre-debug state as closely as possible.
*/ */
int (*con_debug_leave)(struct vc_data *vc); void (*con_debug_leave)(struct vc_data *vc);
}; };
extern const struct consw *conswitchp; extern const struct consw *conswitchp;
...@@ -113,17 +113,11 @@ int do_unregister_con_driver(const struct consw *csw); ...@@ -113,17 +113,11 @@ int do_unregister_con_driver(const struct consw *csw);
int do_take_over_console(const struct consw *sw, int first, int last, int deflt); int do_take_over_console(const struct consw *sw, int first, int last, int deflt);
void give_up_console(const struct consw *sw); void give_up_console(const struct consw *sw);
#ifdef CONFIG_HW_CONSOLE #ifdef CONFIG_HW_CONSOLE
int con_debug_enter(struct vc_data *vc); void con_debug_enter(struct vc_data *vc);
int con_debug_leave(void); void con_debug_leave(void);
#else #else
static inline int con_debug_enter(struct vc_data *vc) static inline void con_debug_enter(struct vc_data *vc) { }
{ static inline void con_debug_leave(void) { }
return 0;
}
static inline int con_debug_leave(void)
{
return 0;
}
#endif #endif
/* cursor */ /* cursor */
......
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