All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc: Only define __parse_fpscr() when required
@ 2023-09-22 12:33 ` Christophe Leroy
  0 siblings, 0 replies; 4+ messages in thread
From: Christophe Leroy @ 2023-09-22 12:33 UTC (permalink / raw)
  To: Michael Ellerman, Nicholas Piggin
  Cc: Christophe Leroy, linux-kernel, linuxppc-dev, kernel test robot

Clang 17 reports:

arch/powerpc/kernel/traps.c:1167:19: error: unused function '__parse_fpscr' [-Werror,-Wunused-function]

__parse_fpscr() is called from two sites. First call is guarded
by #ifdef CONFIG_PPC_FPU_REGS

Second call is guarded by CONFIG_MATH_EMULATION which selects
CONFIG_PPC_FPU_REGS.

So only define __parse_fpscr() when CONFIG_PPC_FPU_REGS is defined.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202309210327.WkqSd5Bq-lkp@intel.com/
Fixes: b6254ced4da6 ("powerpc/signal: Don't manage floating point regs when no FPU")
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
 arch/powerpc/kernel/traps.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index eeff136b83d9..a52c786c2aec 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -1164,6 +1164,7 @@ void emulate_single_step(struct pt_regs *regs)
 		__single_step_exception(regs);
 }
 
+#ifdef CONFIG_PPC_FPU_REGS
 static inline int __parse_fpscr(unsigned long fpscr)
 {
 	int ret = FPE_FLTUNK;
@@ -1190,6 +1191,7 @@ static inline int __parse_fpscr(unsigned long fpscr)
 
 	return ret;
 }
+#endif
 
 static void parse_fpe(struct pt_regs *regs)
 {
-- 
2.41.0


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

* [PATCH] powerpc: Only define __parse_fpscr() when required
@ 2023-09-22 12:33 ` Christophe Leroy
  0 siblings, 0 replies; 4+ messages in thread
From: Christophe Leroy @ 2023-09-22 12:33 UTC (permalink / raw)
  To: Michael Ellerman, Nicholas Piggin
  Cc: linuxppc-dev, linux-kernel, kernel test robot

Clang 17 reports:

arch/powerpc/kernel/traps.c:1167:19: error: unused function '__parse_fpscr' [-Werror,-Wunused-function]

__parse_fpscr() is called from two sites. First call is guarded
by #ifdef CONFIG_PPC_FPU_REGS

Second call is guarded by CONFIG_MATH_EMULATION which selects
CONFIG_PPC_FPU_REGS.

So only define __parse_fpscr() when CONFIG_PPC_FPU_REGS is defined.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202309210327.WkqSd5Bq-lkp@intel.com/
Fixes: b6254ced4da6 ("powerpc/signal: Don't manage floating point regs when no FPU")
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
 arch/powerpc/kernel/traps.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index eeff136b83d9..a52c786c2aec 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -1164,6 +1164,7 @@ void emulate_single_step(struct pt_regs *regs)
 		__single_step_exception(regs);
 }
 
+#ifdef CONFIG_PPC_FPU_REGS
 static inline int __parse_fpscr(unsigned long fpscr)
 {
 	int ret = FPE_FLTUNK;
@@ -1190,6 +1191,7 @@ static inline int __parse_fpscr(unsigned long fpscr)
 
 	return ret;
 }
+#endif
 
 static void parse_fpe(struct pt_regs *regs)
 {
-- 
2.41.0


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

* Re: [PATCH] powerpc: Only define __parse_fpscr() when required
  2023-09-22 12:33 ` Christophe Leroy
@ 2023-10-15 10:04   ` Michael Ellerman
  -1 siblings, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2023-10-15 10:04 UTC (permalink / raw)
  To: Nicholas Piggin, Christophe Leroy
  Cc: linux-kernel, linuxppc-dev, kernel test robot

On Fri, 22 Sep 2023 14:33:13 +0200, Christophe Leroy wrote:
> Clang 17 reports:
> 
> arch/powerpc/kernel/traps.c:1167:19: error: unused function '__parse_fpscr' [-Werror,-Wunused-function]
> 
> __parse_fpscr() is called from two sites. First call is guarded
> by #ifdef CONFIG_PPC_FPU_REGS
> 
> [...]

Applied to powerpc/next.

[1/1] powerpc: Only define __parse_fpscr() when required
      https://git.kernel.org/powerpc/c/c7e0d9bb9154c6e6b2ac8746faba27b53393f25e

cheers

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

* Re: [PATCH] powerpc: Only define __parse_fpscr() when required
@ 2023-10-15 10:04   ` Michael Ellerman
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2023-10-15 10:04 UTC (permalink / raw)
  To: Nicholas Piggin, Christophe Leroy
  Cc: linuxppc-dev, linux-kernel, kernel test robot

On Fri, 22 Sep 2023 14:33:13 +0200, Christophe Leroy wrote:
> Clang 17 reports:
> 
> arch/powerpc/kernel/traps.c:1167:19: error: unused function '__parse_fpscr' [-Werror,-Wunused-function]
> 
> __parse_fpscr() is called from two sites. First call is guarded
> by #ifdef CONFIG_PPC_FPU_REGS
> 
> [...]

Applied to powerpc/next.

[1/1] powerpc: Only define __parse_fpscr() when required
      https://git.kernel.org/powerpc/c/c7e0d9bb9154c6e6b2ac8746faba27b53393f25e

cheers

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

end of thread, other threads:[~2023-10-15 10:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-22 12:33 [PATCH] powerpc: Only define __parse_fpscr() when required Christophe Leroy
2023-09-22 12:33 ` Christophe Leroy
2023-10-15 10:04 ` Michael Ellerman
2023-10-15 10:04   ` 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.