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

tty: vt: drop get_vc_uniscr()

Its definition depends on the NO_VC_UNI_SCREEN macro. But that is never
defined, so remove all this completely. I.e. expand the macro to
vc->vc_uni_screen everywhere.
Signed-off-by: default avatarJiri Slaby (SUSE) <jirislaby@kernel.org>
Reviewed-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20230112080136.4929-2-jirislaby@kernel.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3831c2a4
...@@ -316,13 +316,6 @@ void schedule_console_callback(void) ...@@ -316,13 +316,6 @@ void schedule_console_callback(void)
* Code to manage unicode-based screen buffers * Code to manage unicode-based screen buffers
*/ */
#ifdef NO_VC_UNI_SCREEN
/* this disables and optimizes related code away at compile time */
#define get_vc_uniscr(vc) NULL
#else
#define get_vc_uniscr(vc) vc->vc_uni_screen
#endif
typedef uint32_t char32_t; typedef uint32_t char32_t;
/* /*
...@@ -369,7 +362,7 @@ static void vc_uniscr_set(struct vc_data *vc, struct uni_screen *new_uniscr) ...@@ -369,7 +362,7 @@ static void vc_uniscr_set(struct vc_data *vc, struct uni_screen *new_uniscr)
static void vc_uniscr_putc(struct vc_data *vc, char32_t uc) static void vc_uniscr_putc(struct vc_data *vc, char32_t uc)
{ {
struct uni_screen *uniscr = get_vc_uniscr(vc); struct uni_screen *uniscr = vc->vc_uni_screen;
if (uniscr) if (uniscr)
uniscr->lines[vc->state.y][vc->state.x] = uc; uniscr->lines[vc->state.y][vc->state.x] = uc;
...@@ -377,7 +370,7 @@ static void vc_uniscr_putc(struct vc_data *vc, char32_t uc) ...@@ -377,7 +370,7 @@ static void vc_uniscr_putc(struct vc_data *vc, char32_t uc)
static void vc_uniscr_insert(struct vc_data *vc, unsigned int nr) static void vc_uniscr_insert(struct vc_data *vc, unsigned int nr)
{ {
struct uni_screen *uniscr = get_vc_uniscr(vc); struct uni_screen *uniscr = vc->vc_uni_screen;
if (uniscr) { if (uniscr) {
char32_t *ln = uniscr->lines[vc->state.y]; char32_t *ln = uniscr->lines[vc->state.y];
...@@ -390,7 +383,7 @@ static void vc_uniscr_insert(struct vc_data *vc, unsigned int nr) ...@@ -390,7 +383,7 @@ static void vc_uniscr_insert(struct vc_data *vc, unsigned int nr)
static void vc_uniscr_delete(struct vc_data *vc, unsigned int nr) static void vc_uniscr_delete(struct vc_data *vc, unsigned int nr)
{ {
struct uni_screen *uniscr = get_vc_uniscr(vc); struct uni_screen *uniscr = vc->vc_uni_screen;
if (uniscr) { if (uniscr) {
char32_t *ln = uniscr->lines[vc->state.y]; char32_t *ln = uniscr->lines[vc->state.y];
...@@ -404,7 +397,7 @@ static void vc_uniscr_delete(struct vc_data *vc, unsigned int nr) ...@@ -404,7 +397,7 @@ static void vc_uniscr_delete(struct vc_data *vc, unsigned int nr)
static void vc_uniscr_clear_line(struct vc_data *vc, unsigned int x, static void vc_uniscr_clear_line(struct vc_data *vc, unsigned int x,
unsigned int nr) unsigned int nr)
{ {
struct uni_screen *uniscr = get_vc_uniscr(vc); struct uni_screen *uniscr = vc->vc_uni_screen;
if (uniscr) { if (uniscr) {
char32_t *ln = uniscr->lines[vc->state.y]; char32_t *ln = uniscr->lines[vc->state.y];
...@@ -416,7 +409,7 @@ static void vc_uniscr_clear_line(struct vc_data *vc, unsigned int x, ...@@ -416,7 +409,7 @@ static void vc_uniscr_clear_line(struct vc_data *vc, unsigned int x,
static void vc_uniscr_clear_lines(struct vc_data *vc, unsigned int y, static void vc_uniscr_clear_lines(struct vc_data *vc, unsigned int y,
unsigned int nr) unsigned int nr)
{ {
struct uni_screen *uniscr = get_vc_uniscr(vc); struct uni_screen *uniscr = vc->vc_uni_screen;
if (uniscr) { if (uniscr) {
unsigned int cols = vc->vc_cols; unsigned int cols = vc->vc_cols;
...@@ -429,7 +422,7 @@ static void vc_uniscr_clear_lines(struct vc_data *vc, unsigned int y, ...@@ -429,7 +422,7 @@ static void vc_uniscr_clear_lines(struct vc_data *vc, unsigned int y,
static void vc_uniscr_scroll(struct vc_data *vc, unsigned int t, unsigned int b, static void vc_uniscr_scroll(struct vc_data *vc, unsigned int t, unsigned int b,
enum con_scroll dir, unsigned int nr) enum con_scroll dir, unsigned int nr)
{ {
struct uni_screen *uniscr = get_vc_uniscr(vc); struct uni_screen *uniscr = vc->vc_uni_screen;
if (uniscr) { if (uniscr) {
unsigned int i, j, k, sz, d, clear; unsigned int i, j, k, sz, d, clear;
...@@ -545,7 +538,7 @@ int vc_uniscr_check(struct vc_data *vc) ...@@ -545,7 +538,7 @@ int vc_uniscr_check(struct vc_data *vc)
void vc_uniscr_copy_line(const struct vc_data *vc, void *dest, bool viewed, void vc_uniscr_copy_line(const struct vc_data *vc, void *dest, bool viewed,
unsigned int row, unsigned int col, unsigned int nr) unsigned int row, unsigned int col, unsigned int nr)
{ {
struct uni_screen *uniscr = get_vc_uniscr(vc); struct uni_screen *uniscr = vc->vc_uni_screen;
int offset = row * vc->vc_size_row + col * 2; int offset = row * vc->vc_size_row + col * 2;
unsigned long pos; unsigned long pos;
...@@ -1206,7 +1199,7 @@ static int vc_do_resize(struct tty_struct *tty, struct vc_data *vc, ...@@ -1206,7 +1199,7 @@ static int vc_do_resize(struct tty_struct *tty, struct vc_data *vc,
if (!newscreen) if (!newscreen)
return -ENOMEM; return -ENOMEM;
if (get_vc_uniscr(vc)) { if (vc->vc_uni_screen) {
new_uniscr = vc_uniscr_alloc(new_cols, new_rows); new_uniscr = vc_uniscr_alloc(new_cols, new_rows);
if (!new_uniscr) { if (!new_uniscr) {
kfree(newscreen); kfree(newscreen);
...@@ -1258,7 +1251,7 @@ static int vc_do_resize(struct tty_struct *tty, struct vc_data *vc, ...@@ -1258,7 +1251,7 @@ static int vc_do_resize(struct tty_struct *tty, struct vc_data *vc,
end = old_origin + old_row_size * min(old_rows, new_rows); end = old_origin + old_row_size * min(old_rows, new_rows);
vc_uniscr_copy_area(new_uniscr, new_cols, new_rows, vc_uniscr_copy_area(new_uniscr, new_cols, new_rows,
get_vc_uniscr(vc), rlth/2, first_copied_row, vc->vc_uni_screen, rlth/2, first_copied_row,
min(old_rows, new_rows)); min(old_rows, new_rows));
vc_uniscr_set(vc, new_uniscr); vc_uniscr_set(vc, new_uniscr);
...@@ -4706,7 +4699,7 @@ EXPORT_SYMBOL_GPL(screen_glyph); ...@@ -4706,7 +4699,7 @@ EXPORT_SYMBOL_GPL(screen_glyph);
u32 screen_glyph_unicode(const struct vc_data *vc, int n) u32 screen_glyph_unicode(const struct vc_data *vc, int n)
{ {
struct uni_screen *uniscr = get_vc_uniscr(vc); struct uni_screen *uniscr = vc->vc_uni_screen;
if (uniscr) if (uniscr)
return uniscr->lines[n / vc->vc_cols][n % vc->vc_cols]; return uniscr->lines[n / vc->vc_cols][n % vc->vc_cols];
......
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