Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Jul 2019 19:07:42 +0000 (UTC)
From:      Justin Hibbits <jhibbits@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r349674 - stable/12/sys/powerpc/cpufreq
Message-ID:  <201907031907.x63J7gKB052515@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhibbits
Date: Wed Jul  3 19:07:42 2019
New Revision: 349674
URL: https://svnweb.freebsd.org/changeset/base/349674

Log:
  MFC r344915:
  
  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.

Modified:
  stable/12/sys/powerpc/cpufreq/dfs.c
  stable/12/sys/powerpc/cpufreq/pcr.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/powerpc/cpufreq/dfs.c
==============================================================================
--- stable/12/sys/powerpc/cpufreq/dfs.c	Wed Jul  3 19:01:41 2019	(r349673)
+++ stable/12/sys/powerpc/cpufreq/dfs.c	Wed Jul  3 19:07:42 2019	(r349674)
@@ -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: stable/12/sys/powerpc/cpufreq/pcr.c
==============================================================================
--- stable/12/sys/powerpc/cpufreq/pcr.c	Wed Jul  3 19:01:41 2019	(r349673)
+++ stable/12/sys/powerpc/cpufreq/pcr.c	Wed Jul  3 19:07:42 2019	(r349674)
@@ -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?201907031907.x63J7gKB052515>