public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Gerd Hoffmann" <kraxel@redhat.com>
To: Laszlo Ersek <lersek@redhat.com>
Cc: devel@edk2.groups.io, Sunil V L <sunilvl@ventanamicro.com>,
	 Jiewen Yao <jiewen.yao@intel.com>,
	oliver@redhat.com, Andrei Warkentin <andrei.warkentin@intel.com>,
	 Ard Biesheuvel <ardb+tianocore@kernel.org>
Subject: Re: [edk2-devel] [PATCH v5 3/3] OvmfPkg/VirtNorFlashDxe: sanity-check variables
Date: Tue, 9 Jan 2024 15:11:06 +0100	[thread overview]
Message-ID: <7sym3x3fxx2nxp5wt7we6gqgxl4ngijggsmohmarb3fnozhxtj@cqkijlwl6etg> (raw)
In-Reply-To: <be2ec9a8-f5dd-0be5-d2f4-831519bd1b49@redhat.com>

  Hi,

> Nit: to my knowledge, the coding style forbids initialization of "auto"
> storage class variables (more commonly put, "non-static local
> variables"). IOW, we should spell the above as:
> 
> | diff --git a/OvmfPkg/VirtNorFlashDxe/VirtNorFlashFvb.c b/OvmfPkg/VirtNorFlashDxe/VirtNorFlashFvb.c
> | index ca2e40743dfd..8fcd999ac6df 100644
> | --- a/OvmfPkg/VirtNorFlashDxe/VirtNorFlashFvb.c
> | +++ b/OvmfPkg/VirtNorFlashDxe/VirtNorFlashFvb.c
> | @@ -283,7 +283,9 @@ ValidateFvHeader (
> |
> |      if (VarHeaderEnd >= VariableStoreHeader->Size) {
> |        if (VarOffset <= VariableStoreHeader->Size - sizeof (UINT16)) {
> | -        CONST UINT16  *StartId = (VOID *)((UINTN)VariableStoreHeader + VarOffset);
> | +        CONST UINT16  *StartId;
> | +
> | +        StartId = (VOID *)((UINTN)VariableStoreHeader + VarOffset);
> |          if (*StartId == 0x55aa) {
> |            DEBUG ((DEBUG_ERROR, "%a: startid at invalid location\n", __func__));
> |            return EFI_NOT_FOUND;
> 
> Do you want me to fix up the patch upon merge for you,

I happily accept that service offer ;)

thanks,
  Gerd



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#113449): https://edk2.groups.io/g/devel/message/113449
Mute This Topic: https://groups.io/mt/103617812/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



  reply	other threads:[~2024-01-09 14:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-09 11:28 [edk2-devel] [PATCH v5 0/3] OvmfPkg/VirtNorFlashDxe: sanity-check variables Gerd Hoffmann
2024-01-09 11:29 ` [edk2-devel] [PATCH v5 1/3] OvmfPkg/RiscVVirt: use gEfiAuthenticatedVariableGuid unconditionally Gerd Hoffmann
2024-01-09 11:29 ` [edk2-devel] [PATCH v5 2/3] OvmfPkg/VirtNorFlashDxe: stop accepting gEfiVariableGuid Gerd Hoffmann
2024-01-09 11:29 ` [edk2-devel] [PATCH v5 3/3] OvmfPkg/VirtNorFlashDxe: sanity-check variables Gerd Hoffmann
2024-01-09 13:14   ` Laszlo Ersek
2024-01-09 14:11     ` Gerd Hoffmann [this message]
2024-01-09 16:36       ` Laszlo Ersek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7sym3x3fxx2nxp5wt7we6gqgxl4ngijggsmohmarb3fnozhxtj@cqkijlwl6etg \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox