[PATCH 10/46] acpi: pcc: reduce scope of variables

Keng-Yu Lin keng-yu.lin at canonical.com
Tue Jan 20 06:49:06 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/acpi/pcc/pcc.c:410]:
>         (style) The scope of the variable 'item' can be reduced.
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>  src/acpi/pcc/pcc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/acpi/pcc/pcc.c b/src/acpi/pcc/pcc.c
> index 0f01baa..94f9b9e 100644
> --- a/src/acpi/pcc/pcc.c
> +++ b/src/acpi/pcc/pcc.c
> @@ -407,7 +407,6 @@ static int pcc_test1(fwts_framework *fw)
>  {
>         ACPI_BUFFER       buf;
>         ACPI_STATUS       ret;
> -       fwts_list_link  *item;
>         fwts_list *pccs;
>         static char *name = "PCCH";
>         size_t name_len = strlen(name);
> @@ -421,6 +420,8 @@ static int pcc_test1(fwts_framework *fw)
>         fwts_log_nl(fw);
>
>         if ((pccs = fwts_acpi_object_get_names()) != NULL) {
> +               fwts_list_link  *item;
> +
>                 fwts_list_foreach(item, pccs) {
>                         char *pcc_name = fwts_list_data(char*, item);
>                         size_t len = strlen(pcc_name);
> --
> 2.1.4
>
>

Acked-by: Keng-Yu Lin <kengyu at canonical.com>



More information about the fwts-devel mailing list