mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* arch/arm/mm/proc.c:82:6: error: conflicting types for 'cpu_arm920_reset'
@ 2024-06-25 20:37 kernel test robot
  2024-06-26 17:21 ` Nathan Chancellor
  0 siblings, 1 reply; 4+ messages in thread
From: kernel test robot @ 2024-06-25 20:37 UTC (permalink / raw)
  To: Linus Walleij
  Cc: llvm, oe-kbuild-all, linux-kernel, Russell King (Oracle), Sami Tolvanen

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   55027e689933ba2e64f3d245fb1ff185b3e7fc81
commit: 1a4fec49efe5273eb2fcf575175a117745f76f97 ARM: 9392/2: Support CLANG CFI
date:   8 weeks ago
config: arm-randconfig-002-20240626 (https://download.01.org/0day-ci/archive/20240626/202406260432.6WGV2jCk-lkp@intel.com/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project ad79a14c9e5ec4a369eed4adf567c22cc029863f)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240626/202406260432.6WGV2jCk-lkp@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202406260432.6WGV2jCk-lkp@intel.com/

All errors (new ones prefixed by >>):

>> arch/arm/mm/proc.c:82:6: error: conflicting types for 'cpu_arm920_reset'
      82 | void cpu_arm920_reset(void);
         |      ^
   arch/arm/include/asm/proc-fns.h:96:13: note: previous declaration is here
      96 | extern void cpu_reset(unsigned long addr, bool hvc) __attribute__((noreturn));
         |             ^
   arch/arm/include/asm/glue-proc.h:251:21: note: expanded from macro 'cpu_reset'
     251 | #define cpu_reset                       __glue(CPU_NAME,_reset)
         |                                         ^
   arch/arm/include/asm/glue.h:20:26: note: expanded from macro '__glue'
      20 | #define __glue(name,fn)         ____glue(name,fn)
         |                                 ^
   arch/arm/include/asm/glue.h:16:27: note: expanded from macro '____glue'
      16 | #define ____glue(name,fn)       name##fn
         |                                 ^
   <scratch space>:70:1: note: expanded from here
      70 | cpu_arm920_reset
         | ^
   1 error generated.


vim +/cpu_arm920_reset +82 arch/arm/mm/proc.c

393999fa96273b Linus Walleij 2024-04-23  76  
393999fa96273b Linus Walleij 2024-04-23  77  #ifdef CONFIG_CPU_ARM920T
393999fa96273b Linus Walleij 2024-04-23  78  void cpu_arm920_proc_init(void);
393999fa96273b Linus Walleij 2024-04-23  79  __ADDRESSABLE(cpu_arm920_proc_init);
393999fa96273b Linus Walleij 2024-04-23  80  void cpu_arm920_proc_fin(void);
393999fa96273b Linus Walleij 2024-04-23  81  __ADDRESSABLE(cpu_arm920_proc_fin);
393999fa96273b Linus Walleij 2024-04-23 @82  void cpu_arm920_reset(void);
393999fa96273b Linus Walleij 2024-04-23  83  __ADDRESSABLE(cpu_arm920_reset);
393999fa96273b Linus Walleij 2024-04-23  84  int cpu_arm920_do_idle(void);
393999fa96273b Linus Walleij 2024-04-23  85  __ADDRESSABLE(cpu_arm920_do_idle);
393999fa96273b Linus Walleij 2024-04-23  86  void cpu_arm920_dcache_clean_area(void *addr, int size);
393999fa96273b Linus Walleij 2024-04-23  87  __ADDRESSABLE(cpu_arm920_dcache_clean_area);
393999fa96273b Linus Walleij 2024-04-23  88  void cpu_arm920_switch_mm(phys_addr_t pgd_phys, struct mm_struct *mm);
393999fa96273b Linus Walleij 2024-04-23  89  __ADDRESSABLE(cpu_arm920_switch_mm);
393999fa96273b Linus Walleij 2024-04-23  90  void cpu_arm920_set_pte_ext(pte_t *ptep, pte_t pte, unsigned int ext);
393999fa96273b Linus Walleij 2024-04-23  91  __ADDRESSABLE(cpu_arm920_set_pte_ext);
393999fa96273b Linus Walleij 2024-04-23  92  #ifdef CONFIG_ARM_CPU_SUSPEND
393999fa96273b Linus Walleij 2024-04-23  93  void cpu_arm920_do_suspend(void *);
393999fa96273b Linus Walleij 2024-04-23  94  __ADDRESSABLE(cpu_arm920_do_suspend);
393999fa96273b Linus Walleij 2024-04-23  95  void cpu_arm920_do_resume(void *);
393999fa96273b Linus Walleij 2024-04-23  96  __ADDRESSABLE(cpu_arm920_do_resume);
393999fa96273b Linus Walleij 2024-04-23  97  #endif /* CONFIG_ARM_CPU_SUSPEND */
393999fa96273b Linus Walleij 2024-04-23  98  #endif /* CONFIG_CPU_ARM920T */
393999fa96273b Linus Walleij 2024-04-23  99  

:::::: The code at line 82 was first introduced by commit
:::::: 393999fa96273bab8d6efb2f4724030916afd61b ARM: 9389/2: mm: Define prototypes for all per-processor calls

:::::: TO: Linus Walleij <linus.walleij@linaro.org>
:::::: CC: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: arch/arm/mm/proc.c:82:6: error: conflicting types for 'cpu_arm920_reset'
  2024-06-25 20:37 arch/arm/mm/proc.c:82:6: error: conflicting types for 'cpu_arm920_reset' kernel test robot
@ 2024-06-26 17:21 ` Nathan Chancellor
  2024-06-26 20:59   ` Linus Walleij
  0 siblings, 1 reply; 4+ messages in thread
From: Nathan Chancellor @ 2024-06-26 17:21 UTC (permalink / raw)
  To: kernel test robot
  Cc: Linus Walleij, llvm, oe-kbuild-all, linux-kernel,
	Russell King (Oracle),
	Sami Tolvanen

On Wed, Jun 26, 2024 at 04:37:00AM +0800, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   55027e689933ba2e64f3d245fb1ff185b3e7fc81
> commit: 1a4fec49efe5273eb2fcf575175a117745f76f97 ARM: 9392/2: Support CLANG CFI
> date:   8 weeks ago
> config: arm-randconfig-002-20240626 (https://download.01.org/0day-ci/archive/20240626/202406260432.6WGV2jCk-lkp@intel.com/config)
> compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project ad79a14c9e5ec4a369eed4adf567c22cc029863f)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240626/202406260432.6WGV2jCk-lkp@intel.com/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@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202406260432.6WGV2jCk-lkp@intel.com/
> 
> All errors (new ones prefixed by >>):
> 
> >> arch/arm/mm/proc.c:82:6: error: conflicting types for 'cpu_arm920_reset'
>       82 | void cpu_arm920_reset(void);
>          |      ^
>    arch/arm/include/asm/proc-fns.h:96:13: note: previous declaration is here
>       96 | extern void cpu_reset(unsigned long addr, bool hvc) __attribute__((noreturn));
>          |             ^
>    arch/arm/include/asm/glue-proc.h:251:21: note: expanded from macro 'cpu_reset'
>      251 | #define cpu_reset                       __glue(CPU_NAME,_reset)
>          |                                         ^
>    arch/arm/include/asm/glue.h:20:26: note: expanded from macro '__glue'
>       20 | #define __glue(name,fn)         ____glue(name,fn)
>          |                                 ^
>    arch/arm/include/asm/glue.h:16:27: note: expanded from macro '____glue'
>       16 | #define ____glue(name,fn)       name##fn
>          |                                 ^
>    <scratch space>:70:1: note: expanded from here
>       70 | cpu_arm920_reset
>          | ^
>    1 error generated.

Hmmm, it seems like the prototypes of the reset functions in
arch/arm/mm/proc.c are incorrect? This builds for me with the original
configuration and allmodconfig + CONFIG_CFI_CLANG=y.

diff --git a/arch/arm/mm/proc.c b/arch/arm/mm/proc.c
index bdbbf65d1b36..4e4b5733bd26 100644
--- a/arch/arm/mm/proc.c
+++ b/arch/arm/mm/proc.c
@@ -17,7 +17,7 @@ void cpu_arm7tdmi_proc_init(void);
 __ADDRESSABLE(cpu_arm7tdmi_proc_init);
 void cpu_arm7tdmi_proc_fin(void);
 __ADDRESSABLE(cpu_arm7tdmi_proc_fin);
-void cpu_arm7tdmi_reset(void);
+void cpu_arm7tdmi_reset(unsigned long addr, bool hvc) __attribute__((noreturn));
 __ADDRESSABLE(cpu_arm7tdmi_reset);
 int cpu_arm7tdmi_do_idle(void);
 __ADDRESSABLE(cpu_arm7tdmi_do_idle);
@@ -32,7 +32,7 @@ void cpu_arm720_proc_init(void);
 __ADDRESSABLE(cpu_arm720_proc_init);
 void cpu_arm720_proc_fin(void);
 __ADDRESSABLE(cpu_arm720_proc_fin);
-void cpu_arm720_reset(void);
+void cpu_arm720_reset(unsigned long addr, bool hvc) __attribute__((noreturn));
 __ADDRESSABLE(cpu_arm720_reset);
 int cpu_arm720_do_idle(void);
 __ADDRESSABLE(cpu_arm720_do_idle);
@@ -49,7 +49,7 @@ void cpu_arm740_proc_init(void);
 __ADDRESSABLE(cpu_arm740_proc_init);
 void cpu_arm740_proc_fin(void);
 __ADDRESSABLE(cpu_arm740_proc_fin);
-void cpu_arm740_reset(void);
+void cpu_arm740_reset(unsigned long addr, bool hvc) __attribute__((noreturn));
 __ADDRESSABLE(cpu_arm740_reset);
 int cpu_arm740_do_idle(void);
 __ADDRESSABLE(cpu_arm740_do_idle);
@@ -64,7 +64,7 @@ void cpu_arm9tdmi_proc_init(void);
 __ADDRESSABLE(cpu_arm9tdmi_proc_init);
 void cpu_arm9tdmi_proc_fin(void);
 __ADDRESSABLE(cpu_arm9tdmi_proc_fin);
-void cpu_arm9tdmi_reset(void);
+void cpu_arm9tdmi_reset(unsigned long addr, bool hvc) __attribute__((noreturn));
 __ADDRESSABLE(cpu_arm9tdmi_reset);
 int cpu_arm9tdmi_do_idle(void);
 __ADDRESSABLE(cpu_arm9tdmi_do_idle);
@@ -79,7 +79,7 @@ void cpu_arm920_proc_init(void);
 __ADDRESSABLE(cpu_arm920_proc_init);
 void cpu_arm920_proc_fin(void);
 __ADDRESSABLE(cpu_arm920_proc_fin);
-void cpu_arm920_reset(void);
+void cpu_arm920_reset(unsigned long addr, bool hvc) __attribute__((noreturn));
 __ADDRESSABLE(cpu_arm920_reset);
 int cpu_arm920_do_idle(void);
 __ADDRESSABLE(cpu_arm920_do_idle);
@@ -102,7 +102,7 @@ void cpu_arm922_proc_init(void);
 __ADDRESSABLE(cpu_arm922_proc_init);
 void cpu_arm922_proc_fin(void);
 __ADDRESSABLE(cpu_arm922_proc_fin);
-void cpu_arm922_reset(void);
+void cpu_arm922_reset(unsigned long addr, bool hvc) __attribute__((noreturn));
 __ADDRESSABLE(cpu_arm922_reset);
 int cpu_arm922_do_idle(void);
 __ADDRESSABLE(cpu_arm922_do_idle);
@@ -119,7 +119,7 @@ void cpu_arm925_proc_init(void);
 __ADDRESSABLE(cpu_arm925_proc_init);
 void cpu_arm925_proc_fin(void);
 __ADDRESSABLE(cpu_arm925_proc_fin);
-void cpu_arm925_reset(void);
+void cpu_arm925_reset(unsigned long addr, bool hvc) __attribute__((noreturn));
 __ADDRESSABLE(cpu_arm925_reset);
 int cpu_arm925_do_idle(void);
 __ADDRESSABLE(cpu_arm925_do_idle);
@@ -159,7 +159,7 @@ void cpu_arm940_proc_init(void);
 __ADDRESSABLE(cpu_arm940_proc_init);
 void cpu_arm940_proc_fin(void);
 __ADDRESSABLE(cpu_arm940_proc_fin);
-void cpu_arm940_reset(void);
+void cpu_arm940_reset(unsigned long addr, bool hvc) __attribute__((noreturn));
 __ADDRESSABLE(cpu_arm940_reset);
 int cpu_arm940_do_idle(void);
 __ADDRESSABLE(cpu_arm940_do_idle);
@@ -174,7 +174,7 @@ void cpu_arm946_proc_init(void);
 __ADDRESSABLE(cpu_arm946_proc_init);
 void cpu_arm946_proc_fin(void);
 __ADDRESSABLE(cpu_arm946_proc_fin);
-void cpu_arm946_reset(void);
+void cpu_arm946_reset(unsigned long addr, bool hvc) __attribute__((noreturn));
 __ADDRESSABLE(cpu_arm946_reset);
 int cpu_arm946_do_idle(void);
 __ADDRESSABLE(cpu_arm946_do_idle);
@@ -429,7 +429,7 @@ void cpu_v7_proc_init(void);
 __ADDRESSABLE(cpu_v7_proc_init);
 void cpu_v7_proc_fin(void);
 __ADDRESSABLE(cpu_v7_proc_fin);
-void cpu_v7_reset(void);
+void cpu_v7_reset(unsigned long addr, bool hvc) __attribute__((noreturn));
 __ADDRESSABLE(cpu_v7_reset);
 int cpu_v7_do_idle(void);
 __ADDRESSABLE(cpu_v7_do_idle);

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: arch/arm/mm/proc.c:82:6: error: conflicting types for 'cpu_arm920_reset'
  2024-06-26 17:21 ` Nathan Chancellor
@ 2024-06-26 20:59   ` Linus Walleij
  2024-06-26 21:03     ` Nathan Chancellor
  0 siblings, 1 reply; 4+ messages in thread
From: Linus Walleij @ 2024-06-26 20:59 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: kernel test robot, llvm, oe-kbuild-all, linux-kernel,
	Russell King (Oracle),
	Sami Tolvanen

On Wed, Jun 26, 2024 at 7:21 PM Nathan Chancellor <nathan@kernel.org> wrote:

> Hmmm, it seems like the prototypes of the reset functions in
> arch/arm/mm/proc.c are incorrect? This builds for me with the original
> configuration and allmodconfig + CONFIG_CFI_CLANG=y.

Incidentally I fixed it earlier today!
https://lore.kernel.org/linux-arm-kernel/20240626-arm-proto-regression-v1-1-089c23ea13dd@linaro.org/

I added you on Reported-by for now.

> +void cpu_arm7tdmi_reset(unsigned long addr, bool hvc) __attribute__((noreturn));

The attribute is not needed on the prototype AFAICT?

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: arch/arm/mm/proc.c:82:6: error: conflicting types for 'cpu_arm920_reset'
  2024-06-26 20:59   ` Linus Walleij
@ 2024-06-26 21:03     ` Nathan Chancellor
  0 siblings, 0 replies; 4+ messages in thread
From: Nathan Chancellor @ 2024-06-26 21:03 UTC (permalink / raw)
  To: Linus Walleij
  Cc: kernel test robot, llvm, oe-kbuild-all, linux-kernel,
	Russell King (Oracle),
	Sami Tolvanen

On Wed, Jun 26, 2024 at 10:59:11PM +0200, Linus Walleij wrote:
> On Wed, Jun 26, 2024 at 7:21 PM Nathan Chancellor <nathan@kernel.org> wrote:
> 
> > Hmmm, it seems like the prototypes of the reset functions in
> > arch/arm/mm/proc.c are incorrect? This builds for me with the original
> > configuration and allmodconfig + CONFIG_CFI_CLANG=y.
> 
> Incidentally I fixed it earlier today!
> https://lore.kernel.org/linux-arm-kernel/20240626-arm-proto-regression-v1-1-089c23ea13dd@linaro.org/

Aha, I did not go searching like I normally do to see if a patch was
already sent for it, guess that would have saved me a little time :)

> I added you on Reported-by for now.
> 
> > +void cpu_arm7tdmi_reset(unsigned long addr, bool hvc) __attribute__((noreturn));
> 
> The attribute is not needed on the prototype AFAICT?

I think that in general, noreturn needs to be on prototypes, but for
this prototype/the sake of CFI, I don't think it matters. Sami is free
to correct me though.

Cheers,
Nathan

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-06-26 21:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-25 20:37 arch/arm/mm/proc.c:82:6: error: conflicting types for 'cpu_arm920_reset' kernel test robot
2024-06-26 17:21 ` Nathan Chancellor
2024-06-26 20:59   ` Linus Walleij
2024-06-26 21:03     ` Nathan Chancellor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®