public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Mike Maslenkin" <mike.maslenkin@gmail.com>
To: devel@edk2.groups.io, pedro.falcato@gmail.com
Subject: Re: [edk2-devel] [PATCH 1/2] MdeModulePkg/SataControllerDxe: Remove useless null check
Date: Tue, 9 May 2023 01:28:04 +0300	[thread overview]
Message-ID: <CAL77WPC90K2Ed0qn4+6BC7_0EC3aw0cnjUrXqU2Dc6KgfTrJ0Q@mail.gmail.com> (raw)
In-Reply-To: <20230508215246.217002-2-pedro.falcato@gmail.com>

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.

  reply	other threads:[~2023-05-08 22:28 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   ` Mike Maslenkin [this message]
2023-05-08 22:46     ` [edk2-devel] " Pedro Falcato
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=CAL77WPC90K2Ed0qn4+6BC7_0EC3aw0cnjUrXqU2Dc6KgfTrJ0Q@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