Date: Fri, 8 Mar 2019 03:59:54 +0000 (UTC) From: Justin Hibbits <jhibbits@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344915 - head/sys/powerpc/cpufreq Message-ID: <201903080359.x283xsa7087146@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhibbits Date: Fri Mar 8 03:59:53 2019 New Revision: 344915 URL: https://svnweb.freebsd.org/changeset/base/344915 Log: 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 Modified: head/sys/powerpc/cpufreq/dfs.c head/sys/powerpc/cpufreq/pcr.c Modified: head/sys/powerpc/cpufreq/dfs.c ============================================================================== --- head/sys/powerpc/cpufreq/dfs.c Fri Mar 8 02:00:49 2019 (r344914) +++ head/sys/powerpc/cpufreq/dfs.c Fri Mar 8 03:59:53 2019 (r344915) @@ -157,8 +157,10 @@ dfs_settings(device_t dev, struct cf_setting *sets, in 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); Modified: head/sys/powerpc/cpufreq/pcr.c ============================================================================== --- head/sys/powerpc/cpufreq/pcr.c Fri Mar 8 02:00:49 2019 (r344914) +++ head/sys/powerpc/cpufreq/pcr.c Fri Mar 8 03:59:53 2019 (r344915) @@ -251,8 +251,10 @@ pcr_settings(device_t dev, struct cf_setting *sets, in 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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201903080359.x283xsa7087146>