linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] powerpc/64s: Work around spurious warning on old gccs with -fsanitize-coverage
@ 2019-02-07  5:33 Andrew Donnellan
  2019-02-07  5:33 ` [PATCH 2/2] powerpc: Enable kcov Andrew Donnellan
  2019-02-07  6:37 ` [PATCH 1/2] powerpc/64s: Work around spurious warning on old gccs with -fsanitize-coverage Segher Boessenkool
  0 siblings, 2 replies; 10+ messages in thread
From: Andrew Donnellan @ 2019-02-07  5:33 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: syzkaller, dvyukov

Some older gccs (<GCC 7), when invoked with -fsanitize-coverage=trace-pc,
cause a spurious uninitialised variable warning in dt_cpu_ftrs.c:

  arch/powerpc/kernel/dt_cpu_ftrs.c: In function ‘cpufeatures_process_feature’:
  arch/powerpc/kernel/dt_cpu_ftrs.c:686:7: warning: ‘m’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    if (m->cpu_ftr_bit_mask)

An upcoming patch will enable support for kcov, which requires
-fsanitize-coverage=trace-pc.

Work around this by explicitly initialising m to NULL.

Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
---
 arch/powerpc/kernel/dt_cpu_ftrs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/dt_cpu_ftrs.c b/arch/powerpc/kernel/dt_cpu_ftrs.c
index 8be3721d9302..2192b2114513 100644
--- a/arch/powerpc/kernel/dt_cpu_ftrs.c
+++ b/arch/powerpc/kernel/dt_cpu_ftrs.c
@@ -658,7 +658,7 @@ static void __init cpufeatures_setup_start(u32 isa)
 
 static bool __init cpufeatures_process_feature(struct dt_cpu_feature *f)
 {
-	const struct dt_cpu_feature_match *m;
+	const struct dt_cpu_feature_match *m = NULL;
 	bool known = false;
 	int i;
 
-- 
2.11.0


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

end of thread, other threads:[~2019-02-10  5:17 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-07  5:33 [PATCH 1/2] powerpc/64s: Work around spurious warning on old gccs with -fsanitize-coverage Andrew Donnellan
2019-02-07  5:33 ` [PATCH 2/2] powerpc: Enable kcov Andrew Donnellan
2019-02-07  6:37 ` [PATCH 1/2] powerpc/64s: Work around spurious warning on old gccs with -fsanitize-coverage Segher Boessenkool
2019-02-07  6:59   ` Andrew Donnellan
2019-02-07  7:49     ` Segher Boessenkool
2019-02-08  0:34       ` Andrew Donnellan
2019-02-08  3:02         ` Michael Ellerman
2019-02-08  3:11           ` Andrew Donnellan
2019-02-08 15:41           ` Segher Boessenkool
2019-02-10  5:14             ` Andrew Donnellan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).