public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc: silence a -Wcast-function-type warning in dawr_write_file_bool
@ 2019-05-15 12:09 Mathieu Malaterre
  2019-05-15 13:14 ` Christoph Hellwig
  2019-05-15 13:51 ` [PATCH v2] " Mathieu Malaterre
  0 siblings, 2 replies; 4+ messages in thread
From: Mathieu Malaterre @ 2019-05-15 12:09 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Mathieu Malaterre, Michael Neuling, Benjamin Herrenschmidt,
	Paul Mackerras, linuxppc-dev, linux-kernel

In commit c1fe190c0672 ("powerpc: Add force enable of DAWR on P9
option") the following piece of code was added:

   smp_call_function((smp_call_func_t)set_dawr, &null_brk, 0);

Since GCC 8 this trigger the following warning about incompatible
function types:

  arch/powerpc/kernel/hw_breakpoint.c:408:21: error: cast between incompatible function types from 'int (*)(struct arch_hw_breakpoint *)' to 'void (*)(void *)' [-Werror=cast-function-type]

Cast the function to an intermediate (void*) to make the compiler loose
knowledge about actual type.

Fixes: c1fe190c0672 ("powerpc: Add force enable of DAWR on P9 option")
Cc: Michael Neuling <mikey@neuling.org>
Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
 arch/powerpc/kernel/hw_breakpoint.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/hw_breakpoint.c b/arch/powerpc/kernel/hw_breakpoint.c
index f70fb89dbf60..baeb4c58de3b 100644
--- a/arch/powerpc/kernel/hw_breakpoint.c
+++ b/arch/powerpc/kernel/hw_breakpoint.c
@@ -405,7 +405,8 @@ static ssize_t dawr_write_file_bool(struct file *file,
 
 	/* If we are clearing, make sure all CPUs have the DAWR cleared */
 	if (!dawr_force_enable)
-		smp_call_function((smp_call_func_t)set_dawr, &null_brk, 0);
+		smp_call_function((smp_call_func_t)(void *)set_dawr,
+				  &null_brk, 0);
 
 	return rc;
 }
-- 
2.20.1


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

end of thread, other threads:[~2019-05-15 13:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-15 12:09 [PATCH] powerpc: silence a -Wcast-function-type warning in dawr_write_file_bool Mathieu Malaterre
2019-05-15 13:14 ` Christoph Hellwig
2019-05-15 13:37   ` Mathieu Malaterre
2019-05-15 13:51 ` [PATCH v2] " Mathieu Malaterre

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