The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Helge Deller <deller@gmx.de>, Helge Deller <deller@kernel.org>,
	 kernel test robot <lkp@intel.com>,
	oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: drivers/video/fbdev/au1100fb.c:448:46: error: implicit declaration of function 'KSEG1ADDR'; did you mean 'CKSEG1ADDR'?
Date: Fri, 6 Mar 2026 09:37:12 +0100	[thread overview]
Message-ID: <aaqOcs4CFMt1wiXo@monoceros> (raw)
In-Reply-To: <CAMuHMdWKnP2W2mZuX_aWipOzCSjkJqA_0cRv1ALcjvgm-r=FZw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3300 bytes --]

Hello Geert,

On Fri, Mar 06, 2026 at 08:57:27AM +0100, Geert Uytterhoeven wrote:
> On Thu, 5 Mar 2026 at 09:58, Helge Deller <deller@gmx.de> wrote:
> > On 3/5/26 09:07, Uwe Kleine-König wrote:
> > > On Wed, Mar 04, 2026 at 07:23:30PM +0100, Helge Deller wrote:
> > >> -#if defined(CONFIG_COMPILE_TEST) && !defined(CONFIG_MIPS)
> > >> +#if defined(CONFIG_COMPILE_TEST) && !(defined(CONFIG_MIPS) && !defined(CONFIG_64BIT))
> > >
> > > The condition is equivalent to
> > >
> > >       defined(CONFIG_COMPILE_TEST) && (!defined(CONFIG_MIPS) || defined(CONFIG_64BIT))
> > >
> > > which is logically a bit easier, but I'm unsure if it's easier to
> > > understand (IMHO both are bad).
> >
> > Yes, both are bad. I changed it to your proposal.
> 
> Yes, I had to read it twice, but that applies to both :-(
> 
> What about "#ifndef KSEG1ADDR" instead, or would that be considered
> too dangerous?  <asm/addrspace.h> is included by MIPS' <asm/io.h>
>  so it should always be included if the I/O accessors are available.

Just to state the (maybe?) obvious: With the more complicated expression
it is asserted that the build breaks if on mips32 the definition
disappears e.g. because arch/mips/include/asm/addrspace.h isn't included
implicitly any more or the macro is renamed to unify with mips64's
CKSEG1ADDR. With just `#ifndef KSEG1ADDR` the driver would break without
the compiler noticing and put it's fbdata somewhere in the address
space.

I guess it's subjective, but my preference would be to keep
the more complicated expression (despite being complicated).

An alternative would be:

diff --git a/arch/mips/alchemy/devboards/db1000.c b/arch/mips/alchemy/devboards/db1000.c
index 6984cd5169b5..1958ad0e02a8 100644
--- a/arch/mips/alchemy/devboards/db1000.c
+++ b/arch/mips/alchemy/devboards/db1000.c
@@ -98,8 +98,8 @@ int __init db1500_pci_setup(void)
 
 static struct resource au1100_lcd_resources[] = {
 	[0] = {
-		.start	= AU1100_LCD_PHYS_ADDR,
-		.end	= AU1100_LCD_PHYS_ADDR + 0x800 - 1,
+		.start	= KSEG1ADDR(AU1100_LCD_PHYS_ADDR),
+		.end	= KSEG1ADDR(AU1100_LCD_PHYS_ADDR + 0x800 - 1),
 		.flags	= IORESOURCE_MEM,
 	},
 	[1] = {
diff --git a/drivers/video/fbdev/au1100fb.c b/drivers/video/fbdev/au1100fb.c
index 1a04154bc535..70b96e9ea454 100644
--- a/drivers/video/fbdev/au1100fb.c
+++ b/drivers/video/fbdev/au1100fb.c
@@ -380,11 +380,6 @@ static struct au1100fb_panel known_lcd_panels[] =
 #define panel_is_color(panel) (panel->control_base & LCD_CONTROL_PC)
 #define panel_swap_rgb(panel) (panel->control_base & LCD_CONTROL_CCO)
 
-#if defined(CONFIG_COMPILE_TEST) && !defined(CONFIG_MIPS)
-/* This is only defined to be able to compile this driver on non-mips platforms */
-#define KSEG1ADDR(x) (x)
-#endif
-
 #define DRIVER_NAME "au1100fb"
 #define DRIVER_DESC "LCD controller driver for AU1100 processors"
 
@@ -764,7 +759,7 @@ static int au1100fb_drv_probe(struct platform_device *dev)
 		return -EBUSY;
 	}
 
-	fbdev->regs = (struct au1100fb_regs*)KSEG1ADDR(fbdev->info.fix.mmio_start);
+	fbdev->regs = (struct au1100fb_regs*)fbdev->info.fix.mmio_start;
 
 	pr_devel("Register memory map at %p", fbdev->regs);
 	pr_devel("phys=0x%08x, size=%zu", fbdev->regs_phys, fbdev->regs_len);


Best regards
Uwe

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2026-03-06  8:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-04 14:03 drivers/video/fbdev/au1100fb.c:448:46: error: implicit declaration of function 'KSEG1ADDR'; did you mean 'CKSEG1ADDR'? kernel test robot
2026-03-04 18:23 ` Helge Deller
2026-03-05  8:07   ` Uwe Kleine-König
2026-03-05  8:57     ` Helge Deller
2026-03-05 16:30       ` Uwe Kleine-König
2026-03-06  7:57       ` Geert Uytterhoeven
2026-03-06  8:37         ` Uwe Kleine-König [this message]
2026-03-06  8:47           ` Geert Uytterhoeven

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=aaqOcs4CFMt1wiXo@monoceros \
    --to=u.kleine-koenig@baylibre.com \
    --cc=deller@gmx.de \
    --cc=deller@kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.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