public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Pedro Falcato" <pedro.falcato@gmail.com>
To: Mike Maslenkin <mike.maslenkin@gmail.com>
Cc: devel@edk2.groups.io, Jian J Wang <jian.j.wang@intel.com>,
	 Liming Gao <gaoliming@byosoft.com.cn>,
	Hao A Wu <hao.a.wu@intel.com>, Ray Ni <ray.ni@intel.com>
Subject: Re: [edk2-devel] [PATCH 1/2] MdeModulePkg/SataControllerDxe: Remove useless null check
Date: Mon, 8 May 2023 23:46:21 +0100	[thread overview]
Message-ID: <CAKbZUD0Az3wih+wAXJNgzEY+tOMWH2GXH+s4iVgjwSU5U=Ndig@mail.gmail.com> (raw)
In-Reply-To: <CAL77WPC90K2Ed0qn4+6BC7_0EC3aw0cnjUrXqU2Dc6KgfTrJ0Q@mail.gmail.com>

On Mon, May 8, 2023 at 11:28 PM Mike Maslenkin <mike.maslenkin@gmail.com> wrote:
>
> Hello Pedro,
> Technically speaking  ASSERT (Private != NULL) doesn't cover this branch.
> It should crash before as result of UninstallMultipleProtocolInterfaces() call.
> Obviously it make no sense in release target (under normal condition
> when assertion is turned off), while this code does.
> But I would suggest to remove ASSERT (Private != NULL) as well since
> it is useless also.
> It needs to be very lucky to get NULL as result of BASE_CR(), but
> actually SATA_CONTROLLER_PRIVATE_DATA_FROM_THIS() and CR()
> definition care about this. There will be assert if signature doesn't
> match to dereferenced memory area before Private != NULL check.
>
> In fact, this patch just reduces indentation level by removing useless checks.

Hmm yes, I agree. I don't see how that ASSERT can realistically fire.
It should also be removed.
I'm keeping this patch as-is since it's essentially a cheap backport
from OVMF SataControllerDxe; maintainers, pull it if you'd like, or I
can send a v2 later on that cleans up that ASSERT as well.

The OVMF patch doesn't really depend on this, as this is just refactoring.

(sidenote: you're dropping all CCs accidentally)

-- 
Pedro

  reply	other threads:[~2023-05-08 22:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-08 21:52 [PATCH 0/2] OvmfPkg: Replace the OVMF-specific SataControllerDxe with the generic one Pedro Falcato
2023-05-08 21:52 ` [PATCH 1/2] MdeModulePkg/SataControllerDxe: Remove useless null check Pedro Falcato
2023-05-08 22:28   ` [edk2-devel] " Mike Maslenkin
2023-05-08 22:46     ` Pedro Falcato [this message]
2023-05-08 21:52 ` [PATCH 2/2] OvmfPkg: Replace the OVMF-specific SataControllerDxe with a generic one Pedro Falcato
2023-05-09  8:10   ` Laszlo Ersek
2023-05-09  7:36 ` [PATCH 0/2] OvmfPkg: Replace the OVMF-specific SataControllerDxe with the " Gerd Hoffmann
2023-05-09  8:06 ` Laszlo Ersek
2023-05-09 16:46   ` Pedro Falcato

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='CAKbZUD0Az3wih+wAXJNgzEY+tOMWH2GXH+s4iVgjwSU5U=Ndig@mail.gmail.com' \
    --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