[PATCH 19/46] cpu: maxfreq: reduce scope of variables

Keng-Yu Lin keng-yu.lin at canonical.com
Tue Jan 20 06:55:30 UTC 2015


On Wed, Jan 14, 2015 at 3:04 AM, Colin King <colin.king at canonical.com> wrote:
> 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
>
>
Acked-by: Keng-Yu Lin <kengyu at canonical.com>



More information about the fwts-devel mailing list