All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/math_emu/efp: Include module.h
@ 2022-08-31 15:20 ` Nathan Chancellor
  0 siblings, 0 replies; 12+ messages in thread
From: Nathan Chancellor @ 2022-08-31 15:20 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Nicholas Piggin, Christophe Leroy, Nick Desaulniers, Tom Rix,
	Arnd Bergmann, linuxppc-dev, linux-kernel, llvm, patches,
	Nathan Chancellor, kernel test robot

When building with a recent version of clang, there are a couple of
errors around the call to module_init():

  arch/powerpc/math-emu/math_efp.c:927:1: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
  module_init(spe_mathemu_init);
  ^
  int
  arch/powerpc/math-emu/math_efp.c:927:13: error: a parameter list without types is only allowed in a function definition
  module_init(spe_mathemu_init);
              ^
  2 errors generated.

module_init() is a macro, which is not getting expanded because module.h
is not included in this file. Add the include so that the macro can
expand properly, clearing up the build failure.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---

No Fixes tag because it seems likely that this is a transient include
issue (the code builds with GCC). The robot blamed commit e8c07082a810
("Kbuild: move to -std=gnu11") but I think that just exposed these
errors, not caused them.

 arch/powerpc/math-emu/math_efp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/math-emu/math_efp.c b/arch/powerpc/math-emu/math_efp.c
index 39b84e7452e1..aa3bb8da1cb9 100644
--- a/arch/powerpc/math-emu/math_efp.c
+++ b/arch/powerpc/math-emu/math_efp.c
@@ -17,6 +17,7 @@
 
 #include <linux/types.h>
 #include <linux/prctl.h>
+#include <linux/module.h>
 
 #include <linux/uaccess.h>
 #include <asm/reg.h>

base-commit: dcf8e5633e2e69ad60b730ab5905608b756a032f
-- 
2.37.3


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

* [PATCH] powerpc/math_emu/efp: Include module.h
@ 2022-08-31 15:20 ` Nathan Chancellor
  0 siblings, 0 replies; 12+ messages in thread
From: Nathan Chancellor @ 2022-08-31 15:20 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: kernel test robot, Arnd Bergmann, Tom Rix, llvm,
	Nick Desaulniers, linux-kernel, patches, Nathan Chancellor,
	Nicholas Piggin, linuxppc-dev

When building with a recent version of clang, there are a couple of
errors around the call to module_init():

  arch/powerpc/math-emu/math_efp.c:927:1: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
  module_init(spe_mathemu_init);
  ^
  int
  arch/powerpc/math-emu/math_efp.c:927:13: error: a parameter list without types is only allowed in a function definition
  module_init(spe_mathemu_init);
              ^
  2 errors generated.

module_init() is a macro, which is not getting expanded because module.h
is not included in this file. Add the include so that the macro can
expand properly, clearing up the build failure.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---

No Fixes tag because it seems likely that this is a transient include
issue (the code builds with GCC). The robot blamed commit e8c07082a810
("Kbuild: move to -std=gnu11") but I think that just exposed these
errors, not caused them.

 arch/powerpc/math-emu/math_efp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/math-emu/math_efp.c b/arch/powerpc/math-emu/math_efp.c
index 39b84e7452e1..aa3bb8da1cb9 100644
--- a/arch/powerpc/math-emu/math_efp.c
+++ b/arch/powerpc/math-emu/math_efp.c
@@ -17,6 +17,7 @@
 
 #include <linux/types.h>
 #include <linux/prctl.h>
+#include <linux/module.h>
 
 #include <linux/uaccess.h>
 #include <asm/reg.h>

base-commit: dcf8e5633e2e69ad60b730ab5905608b756a032f
-- 
2.37.3


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

* Re: [PATCH] powerpc/math_emu/efp: Include module.h
  2022-08-31 15:20 ` Nathan Chancellor
@ 2022-09-01  5:41   ` Christophe Leroy
  -1 siblings, 0 replies; 12+ messages in thread
From: Christophe Leroy @ 2022-09-01  5:41 UTC (permalink / raw)
  To: Nathan Chancellor, Michael Ellerman
  Cc: Nicholas Piggin, Nick Desaulniers, Tom Rix, Arnd Bergmann,
	linuxppc-dev, linux-kernel, llvm, patches, kernel test robot



Le 31/08/2022 à 17:20, Nathan Chancellor a écrit :
> When building with a recent version of clang, there are a couple of
> errors around the call to module_init():
> 
>    arch/powerpc/math-emu/math_efp.c:927:1: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
>    module_init(spe_mathemu_init);
>    ^
>    int
>    arch/powerpc/math-emu/math_efp.c:927:13: error: a parameter list without types is only allowed in a function definition
>    module_init(spe_mathemu_init);
>                ^
>    2 errors generated.
> 
> module_init() is a macro, which is not getting expanded because module.h
> is not included in this file. Add the include so that the macro can
> expand properly, clearing up the build failure.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
> 
> No Fixes tag because it seems likely that this is a transient include
> issue (the code builds with GCC). The robot blamed commit e8c07082a810
> ("Kbuild: move to -std=gnu11") but I think that just exposed these
> errors, not caused them.

Well spoted.

Seems like a GCC bug. The code builds fine but silently ignores the 
issue and the following section is missing:

   8 .initcall6.init 00000004  00000000  00000000  00008b30  2**2
                   CONTENTS, ALLOC, LOAD, RELOC, DATA

It means spe_mathemu_init() is never called.

I think it would be worth a GCC bug report.

And by the way:

Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Fixes: ac6f120369ff ("powerpc/85xx: Workaroudn e500 CPU erratum A005")


> 
>   arch/powerpc/math-emu/math_efp.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/arch/powerpc/math-emu/math_efp.c b/arch/powerpc/math-emu/math_efp.c
> index 39b84e7452e1..aa3bb8da1cb9 100644
> --- a/arch/powerpc/math-emu/math_efp.c
> +++ b/arch/powerpc/math-emu/math_efp.c
> @@ -17,6 +17,7 @@
>   
>   #include <linux/types.h>
>   #include <linux/prctl.h>
> +#include <linux/module.h>
>   
>   #include <linux/uaccess.h>
>   #include <asm/reg.h>
> 
> base-commit: dcf8e5633e2e69ad60b730ab5905608b756a032f

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

* Re: [PATCH] powerpc/math_emu/efp: Include module.h
@ 2022-09-01  5:41   ` Christophe Leroy
  0 siblings, 0 replies; 12+ messages in thread
From: Christophe Leroy @ 2022-09-01  5:41 UTC (permalink / raw)
  To: Nathan Chancellor, Michael Ellerman
  Cc: kernel test robot, Arnd Bergmann, Tom Rix, llvm,
	Nick Desaulniers, linux-kernel, Nicholas Piggin, patches,
	linuxppc-dev



Le 31/08/2022 à 17:20, Nathan Chancellor a écrit :
> When building with a recent version of clang, there are a couple of
> errors around the call to module_init():
> 
>    arch/powerpc/math-emu/math_efp.c:927:1: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
>    module_init(spe_mathemu_init);
>    ^
>    int
>    arch/powerpc/math-emu/math_efp.c:927:13: error: a parameter list without types is only allowed in a function definition
>    module_init(spe_mathemu_init);
>                ^
>    2 errors generated.
> 
> module_init() is a macro, which is not getting expanded because module.h
> is not included in this file. Add the include so that the macro can
> expand properly, clearing up the build failure.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
> 
> No Fixes tag because it seems likely that this is a transient include
> issue (the code builds with GCC). The robot blamed commit e8c07082a810
> ("Kbuild: move to -std=gnu11") but I think that just exposed these
> errors, not caused them.

Well spoted.

Seems like a GCC bug. The code builds fine but silently ignores the 
issue and the following section is missing:

   8 .initcall6.init 00000004  00000000  00000000  00008b30  2**2
                   CONTENTS, ALLOC, LOAD, RELOC, DATA

It means spe_mathemu_init() is never called.

I think it would be worth a GCC bug report.

And by the way:

Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Fixes: ac6f120369ff ("powerpc/85xx: Workaroudn e500 CPU erratum A005")


> 
>   arch/powerpc/math-emu/math_efp.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/arch/powerpc/math-emu/math_efp.c b/arch/powerpc/math-emu/math_efp.c
> index 39b84e7452e1..aa3bb8da1cb9 100644
> --- a/arch/powerpc/math-emu/math_efp.c
> +++ b/arch/powerpc/math-emu/math_efp.c
> @@ -17,6 +17,7 @@
>   
>   #include <linux/types.h>
>   #include <linux/prctl.h>
> +#include <linux/module.h>
>   
>   #include <linux/uaccess.h>
>   #include <asm/reg.h>
> 
> base-commit: dcf8e5633e2e69ad60b730ab5905608b756a032f

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

* Re: [PATCH] powerpc/math_emu/efp: Include module.h
  2022-09-01  5:41   ` Christophe Leroy
@ 2022-09-01 19:47     ` Segher Boessenkool
  -1 siblings, 0 replies; 12+ messages in thread
From: Segher Boessenkool @ 2022-09-01 19:47 UTC (permalink / raw)
  To: Christophe Leroy
  Cc: kernel test robot, Arnd Bergmann, llvm, Nick Desaulniers,
	linux-kernel, Nicholas Piggin, patches, Nathan Chancellor,
	Tom Rix, linuxppc-dev

On Thu, Sep 01, 2022 at 05:41:33AM +0000, Christophe Leroy wrote:
> I think it would be worth a GCC bug report.

We need a stand-alone testcase for this.  When you have created one, at
least 98% of the time you discover the bug is in user code after all.

Which is a very good thing, it means the problem can be fixed simpler,
cheaper, and a lot faster :-)


Segher

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

* Re: [PATCH] powerpc/math_emu/efp: Include module.h
@ 2022-09-01 19:47     ` Segher Boessenkool
  0 siblings, 0 replies; 12+ messages in thread
From: Segher Boessenkool @ 2022-09-01 19:47 UTC (permalink / raw)
  To: Christophe Leroy
  Cc: Nathan Chancellor, Michael Ellerman, kernel test robot,
	Arnd Bergmann, Tom Rix, llvm, Nick Desaulniers, linux-kernel,
	Nicholas Piggin, patches, linuxppc-dev

On Thu, Sep 01, 2022 at 05:41:33AM +0000, Christophe Leroy wrote:
> I think it would be worth a GCC bug report.

We need a stand-alone testcase for this.  When you have created one, at
least 98% of the time you discover the bug is in user code after all.

Which is a very good thing, it means the problem can be fixed simpler,
cheaper, and a lot faster :-)


Segher

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

* Re: [PATCH] powerpc/math_emu/efp: Include module.h
  2022-09-01 19:47     ` Segher Boessenkool
@ 2022-09-02  8:43       ` Christophe Leroy
  -1 siblings, 0 replies; 12+ messages in thread
From: Christophe Leroy @ 2022-09-02  8:43 UTC (permalink / raw)
  To: Segher Boessenkool
  Cc: Nathan Chancellor, Michael Ellerman, kernel test robot,
	Arnd Bergmann, Tom Rix, llvm, Nick Desaulniers, linux-kernel,
	Nicholas Piggin, patches, linuxppc-dev



Le 01/09/2022 à 21:47, Segher Boessenkool a écrit :
> On Thu, Sep 01, 2022 at 05:41:33AM +0000, Christophe Leroy wrote:
>> I think it would be worth a GCC bug report.
> 
> We need a stand-alone testcase for this.  When you have created one, at
> least 98% of the time you discover the bug is in user code after all.
> 
> Which is a very good thing, it means the problem can be fixed simpler,
> cheaper, and a lot faster :-)

Easy to reproduce with a .c file that has a single line:

non_existing_macro(xxx);


Apparently that's due to the -w option in arch/powerpc/math_emu/Makefile:

	ccflags-y = -w

Was introduced by commit d2b194ed8208 ("powerpc/math-emu: Use kernel 
generic math-emu code")

If I understand correctly it means 'ignore all warnings'. Then it seems 
CLANG doesn't honor that request.

Christophe

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

* Re: [PATCH] powerpc/math_emu/efp: Include module.h
@ 2022-09-02  8:43       ` Christophe Leroy
  0 siblings, 0 replies; 12+ messages in thread
From: Christophe Leroy @ 2022-09-02  8:43 UTC (permalink / raw)
  To: Segher Boessenkool
  Cc: kernel test robot, Arnd Bergmann, llvm, Nick Desaulniers,
	linux-kernel, Nicholas Piggin, patches, Nathan Chancellor,
	Tom Rix, linuxppc-dev



Le 01/09/2022 à 21:47, Segher Boessenkool a écrit :
> On Thu, Sep 01, 2022 at 05:41:33AM +0000, Christophe Leroy wrote:
>> I think it would be worth a GCC bug report.
> 
> We need a stand-alone testcase for this.  When you have created one, at
> least 98% of the time you discover the bug is in user code after all.
> 
> Which is a very good thing, it means the problem can be fixed simpler,
> cheaper, and a lot faster :-)

Easy to reproduce with a .c file that has a single line:

non_existing_macro(xxx);


Apparently that's due to the -w option in arch/powerpc/math_emu/Makefile:

	ccflags-y = -w

Was introduced by commit d2b194ed8208 ("powerpc/math-emu: Use kernel 
generic math-emu code")

If I understand correctly it means 'ignore all warnings'. Then it seems 
CLANG doesn't honor that request.

Christophe

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

* Re: [PATCH] powerpc/math_emu/efp: Include module.h
  2022-09-02  8:43       ` Christophe Leroy
@ 2022-09-02 12:40         ` Segher Boessenkool
  -1 siblings, 0 replies; 12+ messages in thread
From: Segher Boessenkool @ 2022-09-02 12:40 UTC (permalink / raw)
  To: Christophe Leroy
  Cc: Nathan Chancellor, Michael Ellerman, kernel test robot,
	Arnd Bergmann, Tom Rix, llvm, Nick Desaulniers, linux-kernel,
	Nicholas Piggin, patches, linuxppc-dev

On Fri, Sep 02, 2022 at 08:43:49AM +0000, Christophe Leroy wrote:
> Le 01/09/2022 à 21:47, Segher Boessenkool a écrit :
> > On Thu, Sep 01, 2022 at 05:41:33AM +0000, Christophe Leroy wrote:
> >> I think it would be worth a GCC bug report.
> > 
> > We need a stand-alone testcase for this.  When you have created one, at
> > least 98% of the time you discover the bug is in user code after all.
> > 
> > Which is a very good thing, it means the problem can be fixed simpler,
> > cheaper, and a lot faster :-)
> 
> Easy to reproduce with a .c file that has a single line:
> 
> non_existing_macro(xxx);

That was fast (and cheap and simple) :-)

> Apparently that's due to the -w option in arch/powerpc/math_emu/Makefile:
> 
> 	ccflags-y = -w
> 
> Was introduced by commit d2b194ed8208 ("powerpc/math-emu: Use kernel 
> generic math-emu code")
> 
> If I understand correctly it means 'ignore all warnings'. Then it seems 
> CLANG doesn't honor that request.

'-w'
     Inhibit all warning messages.

GCC's initial commit has this already (1992).


Segher

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

* Re: [PATCH] powerpc/math_emu/efp: Include module.h
@ 2022-09-02 12:40         ` Segher Boessenkool
  0 siblings, 0 replies; 12+ messages in thread
From: Segher Boessenkool @ 2022-09-02 12:40 UTC (permalink / raw)
  To: Christophe Leroy
  Cc: kernel test robot, Arnd Bergmann, llvm, Nick Desaulniers,
	linux-kernel, Nicholas Piggin, patches, Nathan Chancellor,
	Tom Rix, linuxppc-dev

On Fri, Sep 02, 2022 at 08:43:49AM +0000, Christophe Leroy wrote:
> Le 01/09/2022 à 21:47, Segher Boessenkool a écrit :
> > On Thu, Sep 01, 2022 at 05:41:33AM +0000, Christophe Leroy wrote:
> >> I think it would be worth a GCC bug report.
> > 
> > We need a stand-alone testcase for this.  When you have created one, at
> > least 98% of the time you discover the bug is in user code after all.
> > 
> > Which is a very good thing, it means the problem can be fixed simpler,
> > cheaper, and a lot faster :-)
> 
> Easy to reproduce with a .c file that has a single line:
> 
> non_existing_macro(xxx);

That was fast (and cheap and simple) :-)

> Apparently that's due to the -w option in arch/powerpc/math_emu/Makefile:
> 
> 	ccflags-y = -w
> 
> Was introduced by commit d2b194ed8208 ("powerpc/math-emu: Use kernel 
> generic math-emu code")
> 
> If I understand correctly it means 'ignore all warnings'. Then it seems 
> CLANG doesn't honor that request.

'-w'
     Inhibit all warning messages.

GCC's initial commit has this already (1992).


Segher

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

* Re: [PATCH] powerpc/math_emu/efp: Include module.h
  2022-08-31 15:20 ` Nathan Chancellor
@ 2022-09-09 12:06   ` Michael Ellerman
  -1 siblings, 0 replies; 12+ messages in thread
From: Michael Ellerman @ 2022-09-09 12:06 UTC (permalink / raw)
  To: Nathan Chancellor, Michael Ellerman
  Cc: linuxppc-dev, kernel test robot, Christophe Leroy,
	Nicholas Piggin, llvm, linux-kernel, Nick Desaulniers,
	Arnd Bergmann, patches, Tom Rix

On Wed, 31 Aug 2022 08:20:15 -0700, Nathan Chancellor wrote:
> When building with a recent version of clang, there are a couple of
> errors around the call to module_init():
> 
>   arch/powerpc/math-emu/math_efp.c:927:1: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
>   module_init(spe_mathemu_init);
>   ^
>   int
>   arch/powerpc/math-emu/math_efp.c:927:13: error: a parameter list without types is only allowed in a function definition
>   module_init(spe_mathemu_init);
>               ^
>   2 errors generated.
> 
> [...]

Applied to powerpc/next.

[1/1] powerpc/math_emu/efp: Include module.h
      https://git.kernel.org/powerpc/c/cfe0d370e0788625ce0df3239aad07a2506c1796

cheers

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

* Re: [PATCH] powerpc/math_emu/efp: Include module.h
@ 2022-09-09 12:06   ` Michael Ellerman
  0 siblings, 0 replies; 12+ messages in thread
From: Michael Ellerman @ 2022-09-09 12:06 UTC (permalink / raw)
  To: Nathan Chancellor, Michael Ellerman
  Cc: kernel test robot, Arnd Bergmann, Tom Rix, llvm,
	Nick Desaulniers, linux-kernel, patches, Nicholas Piggin,
	linuxppc-dev

On Wed, 31 Aug 2022 08:20:15 -0700, Nathan Chancellor wrote:
> When building with a recent version of clang, there are a couple of
> errors around the call to module_init():
> 
>   arch/powerpc/math-emu/math_efp.c:927:1: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
>   module_init(spe_mathemu_init);
>   ^
>   int
>   arch/powerpc/math-emu/math_efp.c:927:13: error: a parameter list without types is only allowed in a function definition
>   module_init(spe_mathemu_init);
>               ^
>   2 errors generated.
> 
> [...]

Applied to powerpc/next.

[1/1] powerpc/math_emu/efp: Include module.h
      https://git.kernel.org/powerpc/c/cfe0d370e0788625ce0df3239aad07a2506c1796

cheers

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

end of thread, other threads:[~2022-09-09 12:12 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-31 15:20 [PATCH] powerpc/math_emu/efp: Include module.h Nathan Chancellor
2022-08-31 15:20 ` Nathan Chancellor
2022-09-01  5:41 ` Christophe Leroy
2022-09-01  5:41   ` Christophe Leroy
2022-09-01 19:47   ` Segher Boessenkool
2022-09-01 19:47     ` Segher Boessenkool
2022-09-02  8:43     ` Christophe Leroy
2022-09-02  8:43       ` Christophe Leroy
2022-09-02 12:40       ` Segher Boessenkool
2022-09-02 12:40         ` Segher Boessenkool
2022-09-09 12:06 ` Michael Ellerman
2022-09-09 12:06   ` Michael Ellerman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.