[PATCH 19/46] cpu: maxfreq: reduce scope of variables
Colin King
colin.king at canonical.com
Tue Jan 13 19:04:38 UTC 2015
From: Colin Ian King <colin.king at canonical.com>
cppcheck is picking up some minor style issues which can
be easily fixed:
[src/cpu/maxfreq/maxfreq.c:36]:
(style) The scope of the variable 'val' can be reduced.
Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
src/cpu/maxfreq/maxfreq.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/cpu/maxfreq/maxfreq.c b/src/cpu/maxfreq/maxfreq.c
index a5b3558..0d7bbb9 100644
--- a/src/cpu/maxfreq/maxfreq.c
+++ b/src/cpu/maxfreq/maxfreq.c
@@ -33,9 +33,10 @@
static double maxfreq_max(const char *str)
{
double max = -1.0;
- double val;
while (str && *str) {
+ double val;
+
while ((*str != '\0') && isspace(*str))
str++;
--
2.1.4
More information about the fwts-devel
mailing list