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

From: Uwe Kleine-König

Date: Thu Mar 05 2026 - 11:33:31 EST


On Thu, Mar 05, 2026 at 09:57:29AM +0100, Helge Deller wrote:
> Hi Uwe,
>
> 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.
> > > /* This is only defined to be able to compile this driver on non-mips platforms */
> >
> > Maybe adapt the comment here, too? Something like:
> >
> > /*
> > * KSEG1ADDR() is defined in arch/mips/include/asm/addrspace.h
> > * for 32 bit configurations. Provide a stub for compile testing
> > * on other platforms.
> > */
>
> done.
>
> I've updated the patch in the fbdev git tree, which you can find here:
> https://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev.git/log/?h=for-next
>
> I'll keep the patch a few days in there and will push next week.

https://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev.git/commit/?h=for-next&id=93bf32c3d571a9e160306659cef096fe4f79a7f0
looks good to me, feel free to replace the Cc: for my by an

Acked-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxx>

. And let me note that "fbdev: au1100fb: Make driver compilable on
non-mips platforms" is very accurate :-D.

Best regards
Uwe

Attachment: signature.asc
Description: PGP signature