mdacon: fix redefinition of 'scr_memsetw'
Subsystems (3)
PATCH v2 1/1 mdacon: fix redefinition of 'scr_memsetw'
From: Jackie Liu <[email protected]>
CONFIG_VGA_CONSOLE=n and CONFIG_MDA_CONSOLE=n will cause vt_buffer.h not include <asm/vga.h>.
But if we set CONFIG_MDA_CONSOLE=m, mdacon.c include <linux/vt_buffer.h> is in front of include <asm/vga.h>. VT_BUF_HAVE_MEMSETW is not defined, so vt_buffer.h will define a scr_memsetw, after that, vga.h also define a scr_memsetw, so the repeated definition of scr_memsetw appears, builds error.
We only need to make vt_buffer.h also contain vga.h when CONFIG_MDA_CONSOLE=m. This problem can be fixed.
BTW, mdacon.c no need to include vga.h forcibly, let vt_buffer.h do it.
--- drivers/video/console/mdacon.c | 1 - include/linux/vt_buffer.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-)
drivers/video/console/mdacon.c +0 -1
@@ -42,7 +42,6 @@#include <linux/init.h> #include <asm/io.h> -#include <asm/vga.h> static DEFINE_SPINLOCK (mda_lock);
include/linux/vt_buffer.h +1 -1
@@ -16,7 +16,7 @@#include <linux/string.h> -#if defined(CONFIG_VGA_CONSOLE ) || defined(CONFIG_MDA_CONSOLE ) +#if defined(CONFIG_VGA_CONSOLE ) ||IS_ENABLED (CONFIG_MDA_CONSOLE )#include <asm/vga.h> #endif
Signature · 1 line
2.25.1
Quoted 54 lines · Jackie Liu
From: Jackie Liu <[email protected]>
CONFIG_VGA_CONSOLE=nandCONFIG_MDA_CONSOLE=nwill causevt_buffer.hnot include <asm/vga.h>.But if we set
CONFIG_MDA_CONSOLE=m,mdacon.cinclude <linux/vt_buffer.h> is in front of include <asm/vga.h>.VT_BUF_HAVE_MEMSETWis not defined, sovt_buffer.hwill define ascr_memsetw, after that,vga.halso define ascr_memsetw, so the repeated definition ofscr_memsetwappears, builds error.We only need to make
vt_buffer.halso containvga.hwhenCONFIG_MDA_CONSOLE=m. This problem can be fixed.BTW,
mdacon.cno need to includevga.hforcibly, letvt_buffer.hdo it.Fixes ac036f9570a2 ("vga: optimise console scrolling")Cc Greg Kroah-Hartman <[email protected]>Signed-off-by Jackie Liu <[email protected]>--- drivers/video/console/mdacon.c | 1 - include/linux/vt_buffer.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-)drivers/video/console/mdacon.c +0
-1@@ -42,7 +42,6 @@#include <linux/init.h> #include <asm/io.h> -#include <asm/vga.h> static DEFINE_SPINLOCK (mda_lock);include/linux/vt_buffer.h +1
-1@@ -16,7 +16,7 @@#include <linux/string.h> -#if defined(CONFIG_VGA_CONSOLE ) || defined(CONFIG_MDA_CONSOLE ) +#if defined(CONFIG_VGA_CONSOLE ) ||IS_ENABLED (CONFIG_MDA_CONSOLE )#include <asm/vga.h> #endif Signature · 1 line
2.25.1
This needs to go through the dri-devel mailing list, please resubmit it with my reviewed-by on it.
thanks,
greg k-h