All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] mdacon: fix redefinition of 'scr_memsetw'
@ 2021-09-07  2:03 Jackie Liu
  2021-09-14 14:52 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Jackie Liu @ 2021-09-07  2:03 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, liu.yun

From: Jackie Liu <liuyun01@kylinos.cn>

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.

Fixes: ac036f9570a2 ("vga: optimise console scrolling")
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-fbdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>
---
 drivers/video/console/mdacon.c | 1 -
 include/linux/vt_buffer.h      | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/video/console/mdacon.c b/drivers/video/console/mdacon.c
index ef29b321967f..5898d01bc492 100644
--- a/drivers/video/console/mdacon.c
+++ b/drivers/video/console/mdacon.c
@@ -42,7 +42,6 @@
 #include <linux/init.h>
 
 #include <asm/io.h>
-#include <asm/vga.h>
 
 static DEFINE_SPINLOCK(mda_lock);
 
diff --git a/include/linux/vt_buffer.h b/include/linux/vt_buffer.h
index 848db1b1569f..3a79cc27a33b 100644
--- a/include/linux/vt_buffer.h
+++ b/include/linux/vt_buffer.h
@@ -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
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] mdacon: fix redefinition of 'scr_memsetw'
  2021-09-07  2:03 [PATCH v2] mdacon: fix redefinition of 'scr_memsetw' Jackie Liu
@ 2021-09-14 14:52 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2021-09-14 14:52 UTC (permalink / raw)
  To: Jackie Liu; +Cc: linux-kernel

On Tue, Sep 07, 2021 at 10:03:26AM +0800, Jackie Liu wrote:
> From: Jackie Liu <liuyun01@kylinos.cn>
> 
> 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.
> 
> Fixes: ac036f9570a2 ("vga: optimise console scrolling")
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: linux-fbdev@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>
> ---
>  drivers/video/console/mdacon.c | 1 -
>  include/linux/vt_buffer.h      | 2 +-
>  2 files changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/video/console/mdacon.c b/drivers/video/console/mdacon.c
> index ef29b321967f..5898d01bc492 100644
> --- a/drivers/video/console/mdacon.c
> +++ b/drivers/video/console/mdacon.c
> @@ -42,7 +42,6 @@
>  #include <linux/init.h>
>  
>  #include <asm/io.h>
> -#include <asm/vga.h>
>  
>  static DEFINE_SPINLOCK(mda_lock);
>  
> diff --git a/include/linux/vt_buffer.h b/include/linux/vt_buffer.h
> index 848db1b1569f..3a79cc27a33b 100644
> --- a/include/linux/vt_buffer.h
> +++ b/include/linux/vt_buffer.h
> @@ -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
>  
> -- 
> 2.25.1
> 

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

This needs to go through the dri-devel mailing list, please resubmit it
with my reviewed-by on it.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-14 14:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-07  2:03 [PATCH v2] mdacon: fix redefinition of 'scr_memsetw' Jackie Liu
2021-09-14 14:52 ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.