Re: [PATCH v2] efi: Resolve some shadow warnings

From: Matt Fleming
Date: Mon Sep 08 2014 - 12:08:14 EST


On Sat, 06 Sep, at 06:02:53AM, Jeff Kirsher wrote:
> From: Mark Rustad <mark.d.rustad@xxxxxxxxx>
>
> It is a really bad idea to declare variables or parameters that
> have the same name as common types. It is valid C, but it gets
> surprising if a macro expansion attempts to declare an inner
> local with that type. Change the local names to eliminate the
> hazard.
>
> Change s16 => str16, s8 => str8.
>
> This resolves warnings seen when using W=2 during make, for instance:
>
> drivers/firmware/efi/vars.c: In function âdup_variable_bugâ:
> drivers/firmware/efi/vars.c:324:44: warning: declaration of âs16â shadows a global declaration [-Wshadow]
> static void dup_variable_bug(efi_char16_t *s16, efi_guid_t *vendor_guid,
>
> drivers/firmware/efi/vars.c:328:8: warning: declaration of âs8â shadows a global declaration [-Wshadow]
> char *s8;
>
> Signed-off-by: Mark Rustad <mark.d.rustad@xxxxxxxxx>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@xxxxxxxxx>

Thanks Jeff, Mark, applied.

--
Matt Fleming, Intel Open Source Technology Center
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/