1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-03 12:35:02 +00:00

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
This commit is contained in:
Justin Hibbits 2019-03-08 03:59:53 +00:00
parent ab69c4858c
commit 9ffdae0fd7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=344915
2 changed files with 8 additions and 4 deletions

View File

@ -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);

View File

@ -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);