public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Jackie Liu <liu.yun@linux.dev>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mdacon: fix redefinition of 'scr_memsetw'
Date: Mon, 6 Sep 2021 15:48:55 +0200	[thread overview]
Message-ID: <YTYcRwUewqvpsJGY@kroah.com> (raw)
In-Reply-To: <f5092b702487f29a245ec2b2725fe9e3@linux.dev>

On Mon, Sep 06, 2021 at 01:44:21PM +0000, Jackie Liu wrote:
> Hi, Greg.
> 
> 
> September 6, 2021 6:46 PM, "Greg KH" <gregkh@linuxfoundation.org> 写到:
> 
> > On Mon, Sep 06, 2021 at 06:20:30PM +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: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> > 
> > As this has always been an issue, how is this really a "fix"?
> 
> The problem has always existed, but there will be no compilation errors.
> The driver needs to include <asm/vga.h> at the beginning if we want build
> CONFIG_MDA_CONSOLE=m
> 
> After ac036f9570a2, redefined 'scr_memsetw'. but they are not arm and x86 architectures,
> so it's not very important. It can also be Fixes: ac036f9570a2 ("vga: optimise console scrolling")

That might make more sense to put here, instead of the "beginning of
history".

> > How can the above config options be set in this manner, do you have to
> > do it manually or does a system really need that configuration?
> 
> This is a problem reported by my CI, when doing make randomconfigs. Of course,
> this is a very tiny fix.
> 
> > 
> >> 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..3e71f879e7c0 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) || defined(CONFIG_MDA_CONSOLE) ||
> >> defined(CONFIG_MDA_CONSOLE_MODULE)
> > 
> > If this really is needed, please use the correct define macro that
> > catches both of these options.
> 
> Do you have any suggestions? 
> 
> I saw that this file is also written like this:
> ./arch/arm/mach-pxa/spitz.c:455:#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)

Look at the IS_ENABLED() macro.

thanks,

greg k-h

      reply	other threads:[~2021-09-06 13:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-06 10:20 [PATCH] mdacon: fix redefinition of 'scr_memsetw' Jackie Liu
2021-09-06 10:46 ` Greg KH
2021-09-06 13:44   ` Jackie Liu
2021-09-06 13:48     ` Greg KH [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YTYcRwUewqvpsJGY@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liu.yun@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox