From 9ffdae0fd7a77b9a198a3330a8875f9cbef4c286 Mon Sep 17 00:00:00 2001 From: Justin Hibbits Date: Fri, 8 Mar 2019 03:59:53 +0000 Subject: [PATCH] powerpc: Fix cpufreq statement scoping The second statements on the lines are not guarded by the `if' condition. This triggers a warning with newer gcc. It's relatively harmless given the usage, but incorrect. Instead, wrap the statements so they're properly guarded. Reported by: powerpc64-gcc xtoolchain MFC after: 1 week --- sys/powerpc/cpufreq/dfs.c | 6 ++++-- sys/powerpc/cpufreq/pcr.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/powerpc/cpufreq/dfs.c b/sys/powerpc/cpufreq/dfs.c index 070e2841881e..de4d077a7338 100644 --- a/sys/powerpc/cpufreq/dfs.c +++ b/sys/powerpc/cpufreq/dfs.c @@ -157,8 +157,10 @@ dfs_settings(device_t dev, struct cf_setting *sets, int *count) sets[0].freq = 10000; sets[0].dev = dev; sets[1].freq = 5000; sets[1].dev = dev; - if (sc->dfs4) - sets[2].freq = 2500; sets[2].dev = dev; + if (sc->dfs4) { + sets[2].freq = 2500; + sets[2].dev = dev; + } *count = states; return (0); diff --git a/sys/powerpc/cpufreq/pcr.c b/sys/powerpc/cpufreq/pcr.c index b4f2d8107c71..15f37bd46d82 100644 --- a/sys/powerpc/cpufreq/pcr.c +++ b/sys/powerpc/cpufreq/pcr.c @@ -251,8 +251,10 @@ pcr_settings(device_t dev, struct cf_setting *sets, int *count) sets[0].freq = 10000; sets[0].dev = dev; sets[1].freq = 5000; sets[1].dev = dev; - if (sc->nmodes > 2) - sets[2].freq = 2500; sets[2].dev = dev; + if (sc->nmodes > 2) { + sets[2].freq = 2500; + sets[2].dev = dev; + } *count = sc->nmodes; return (0);