Re: drivers/video/fbdev/au1100fb.c:448:46: error: implicit declaration of function 'KSEG1ADDR'; did you mean 'CKSEG1ADDR'?

From: Geert Uytterhoeven

Date: Fri Mar 06 2026 - 02:57:46 EST


Hi Helge,

On Thu, 5 Mar 2026 at 09:58, Helge Deller <deller@xxxxxx> 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:
> >> * kernel test robot <lkp@xxxxxxxxx>:
> >>> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> >>> head: 0031c06807cfa8aa51a759ff8aa09e1aa48149af
> >>> commit: 6f366e86481a7503a821de82930df517dddd4047 fbdev: au1100fb: Make driver compilable on non-mips platforms
> >>> date: 13 days ago
> >>> config: mips-randconfig-r052-20260304 (https://download.01.org/0day-ci/archive/20260304/202603042127.PT6LuKqi-lkp@xxxxxxxxx/config)
> >>> compiler: mips64-linux-gcc (GCC) 14.3.0
> >>> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260304/202603042127.PT6LuKqi-lkp@xxxxxxxxx/reproduce)
> >>>
> >>> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> >>> the same patch/commit), kindly add following tags
> >>> | Reported-by: kernel test robot <lkp@xxxxxxxxx>
> >>> | Closes: https://lore.kernel.org/oe-kbuild-all/202603042127.PT6LuKqi-lkp@xxxxxxxxx/
> >>>
> >>> All error/warnings (new ones prefixed by >>):
> >>>
> >>> drivers/video/fbdev/au1100fb.c: In function 'au1100fb_drv_probe':
> >>>>> drivers/video/fbdev/au1100fb.c:448:46: error: implicit declaration of function 'KSEG1ADDR'; did you mean 'CKSEG1ADDR'? [-Wimplicit-function-declaration]
> >>> 448 | fbdev->regs = (struct au1100fb_regs*)KSEG1ADDR(fbdev->info.fix.mmio_start);
> >>> | ^~~~~~~~~
> >>> | CKSEG1ADDR
> >>>>> drivers/video/fbdev/au1100fb.c:448:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
> >>> 448 | fbdev->regs = (struct au1100fb_regs*)KSEG1ADDR(fbdev->info.fix.mmio_start);
> >>> | ^
> >>
> >> I've pushed the patch below into the fbdev git tree.
> >> It should (hopefully) fix the issue.
> >>
> >> Helge
> >>
> >>
> >> From: Helge Deller <deller@xxxxxx>
> >> Subject: [PATCH] fbdev: au1100fb: Fix build on MIPS64
> >>
> >> Fix an error reported by the kernel test robot:
> >> au1100fb.c: error: implicit declaration of function 'KSEG1ADDR'; did you mean 'CKSEG1ADDR'?
> >>
> >> The header asm/mach-au1x00/au1000.h is unused apart from pulling in
> >> <linux/delay.h> (for mdelay()) and <linux/io.h> (for KSEG1ADDR()). Then
> >> the only platform specific part in the driver is the usage of the KSEG1ADDR
> >> macro, which for the non-mips case can be stubbed.
> >
> > This paragraph is copied from 6f366e86481a and doesn't make sense here.
>
> Yes, I noticed that later and removed it already.
>
> > I'd write something like:
> >
> > arch/mips/include/asm/addrspace.h defines KSEG1ADDR only for 32 bit
> > configurations. So provide its compile-test stub also for 64bit
> > mips builds.
>
> Ok, added.
>
> >> Fixes: 6f366e86481a ("fbdev: au1100fb: Make driver compilable on non-mips platforms")
> >> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> >> Closes: https://lore.kernel.org/oe-kbuild-all/202603042127.PT6LuKqi-lkp@xxxxxxxxx/
> >> Signed-off-by: Helge Deller <deller@xxxxxx>
> >> Cc: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxx>
> >>
> >> diff --git a/drivers/video/fbdev/au1100fb.c b/drivers/video/fbdev/au1100fb.c
> >> index 1a04154bc535..3b104d377d28 100644
> >> --- a/drivers/video/fbdev/au1100fb.c
> >> +++ b/drivers/video/fbdev/au1100fb.c
> >> @@ -380,7 +380,7 @@ 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)
> >> +#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.

---
Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds