ACK: [PATCH] uefi: clean up a cppcheck style warning
ivanhu
ivan.hu at canonical.com
Mon Jan 18 07:00:47 UTC 2021
On 1/14/21 11:05 PM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> Cppcheck is complaining because the structure capsuleheader
> is being referenced but it is never used. It is probably a
> good idea to zero this structure to silence this warning and
> to ensure the referenced data does not contain garbage.
>
> Cleans cppcheck warning:
> src/uefi/uefirtmisc/uefirtmisc.c:102:21: style: Unused
> variable: capsuleheader [unusedVariable]
> EFI_CAPSULE_HEADER capsuleheader
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
> src/uefi/uefirtmisc/uefirtmisc.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/src/uefi/uefirtmisc/uefirtmisc.c b/src/uefi/uefirtmisc/uefirtmisc.c
> index 690e587c..9dbe4944 100644
> --- a/src/uefi/uefirtmisc/uefirtmisc.c
> +++ b/src/uefi/uefirtmisc/uefirtmisc.c
> @@ -103,6 +103,8 @@ static int querycapsulecapabilities_test(fwts_framework *fw, uint32_t multitestt
> uint64_t maxcapsulesize;
> uint64_t capsulecount;
>
> + memset(&capsuleheader, 0, sizeof(capsuleheader));
> +
> pcapsuleheaderarray[0] = &capsuleheader;
> pcapsuleheaderarray[1] = NULL;
> pcapsuleheaderarray[0]->CapsuleGuid = gEfiCapsuleHeaderGuid;
>
Acked-by: Ivan Hu <ivan.hu at canonical.com>
More information about the fwts-devel
mailing list