Re: arch/m68k/68000/ints.c:82:30: error: 'ISR' undeclared

From: Geert Uytterhoeven
Date: Thu Jun 02 2022 - 03:24:17 EST


On Tue, May 31, 2022 at 5:44 PM kernel test robot <lkp@xxxxxxxxx> wrote:
> First bad commit (maybe != root cause):
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: 8ab2afa23bd197df47819a87f0265c0ac95c5b6a
> commit: 6b8be804ff376f6657ccdf6b29974e7c793d88c4 m68knommu: fix 68000 CPU link with no platform selected
> date: 6 days ago
> config: m68k-buildonly-randconfig-r004-20220530 (https://download.01.org/0day-ci/archive/20220531/202205310707.ppwnnzce-lkp@xxxxxxxxx/config)
> compiler: m68k-linux-gcc (GCC) 11.3.0
> reproduce (this is a W=1 build):
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6b8be804ff376f6657ccdf6b29974e7c793d88c4
> git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> git fetch --no-tags linus master
> git checkout 6b8be804ff376f6657ccdf6b29974e7c793d88c4
> # save the config file
> mkdir build_dir && cp config build_dir/.config
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=m68k SHELL=/bin/bash arch/m68k/68000/
>
> If you fix the issue, kindly add following tag where applicable
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
>
> All errors (new ones prefixed by >>):
>
> arch/m68k/68000/ints.c:77:6: warning: no previous prototype for 'process_int' [-Wmissing-prototypes]
> 77 | void process_int(int vec, struct pt_regs *fp)
> | ^~~~~~~~~~~
> arch/m68k/68000/ints.c: In function 'process_int':
> >> arch/m68k/68000/ints.c:82:30: error: 'ISR' undeclared (first use in this function)
> 82 | unsigned long pend = ISR;
> | ^~~
> arch/m68k/68000/ints.c:82:30: note: each undeclared identifier is reported only once for each function it appears in
> arch/m68k/68000/ints.c: In function 'intc_irq_unmask':
> >> arch/m68k/68000/ints.c:135:9: error: 'IMR' undeclared (first use in this function)
> 135 | IMR &= ~(1 << d->irq);
> | ^~~
> arch/m68k/68000/ints.c: In function 'intc_irq_mask':
> arch/m68k/68000/ints.c:140:9: error: 'IMR' undeclared (first use in this function)
> 140 | IMR |= (1 << d->irq);
> | ^~~
> arch/m68k/68000/ints.c: At top level:
> arch/m68k/68000/ints.c:153:13: warning: no previous prototype for 'trap_init' [-Wmissing-prototypes]
> 153 | void __init trap_init(void)
> | ^~~~~~~~~
> arch/m68k/68000/ints.c:172:13: warning: no previous prototype for 'init_IRQ' [-Wmissing-prototypes]
> 172 | void __init init_IRQ(void)
> | ^~~~~~~~
> arch/m68k/68000/ints.c: In function 'init_IRQ':
> >> arch/m68k/68000/ints.c:176:9: error: 'IVR' undeclared (first use in this function)
> 176 | IVR = 0x40; /* Set DragonBall IVR (interrupt base) to 64 */
> | ^~~
> arch/m68k/68000/ints.c:179:9: error: 'IMR' undeclared (first use in this function)
> 179 | IMR = ~0;
> | ^~~

If M68000=y, but none of M68{,EZ,VZ}328 are enabled, ISR and IMR are
not defined. Most of the code in arch/m68k/68000/ints.c is specific
to the '328 series, and does not apply to plain 68000, but we can't
just not compile ints.c, as we do need definitions of trap_init()
and init_IRQ().
Factor out the '328 parts in dragonball.o, and keep a __weak dummy
init_IRQ() in ints.c?

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