From: "Laszlo Ersek" <lersek@redhat.com>
To: David Woodhouse <dwmw2@infradead.org>, devel@edk2.groups.io
Cc: Ray Ni <ray.ni@intel.com>
Subject: Re: [edk2-devel] [PATCH v2 5/7] OvmfPkg/LegacyBiosDxe: Use EfiBootManagerGetBootDescription()
Date: Tue, 25 Jun 2019 21:16:23 +0200 [thread overview]
Message-ID: <3ad47704-b32a-c92f-8779-6384ae75cf31@redhat.com> (raw)
In-Reply-To: <76174dc3b41dbc62d9d953522c2474707afea2df.camel@infradead.org>
On 06/25/19 16:10, David Woodhouse wrote:
> On Tue, 2019-06-25 at 15:29 +0200, Laszlo Ersek wrote:
>> (2) You removed the NULL-initialization altogether,
>
> Well yeah, you told me the EDK-II coding standards forbid the common
> defensive coding technique used in the language called "C", of
> initialising the variable where it's declared. I wasn't up for arguing
> about it, so I just stopped doing it.
>
> Now you tell me to put it back, just in a more cumbersome way... OK,
> I'll do that too.
For the record, I wrote:
The edk2 coding style forbids initialization of locals. Please use a
separate assignment if necessary.
I guess I didn't foresee that you'd decide it wasn't necessary after all
:) If I had thought of that, I could have dropped "if necessary".
> I'm not sure the answer is going to make me any happier... but *why*
> are we not allowed to just initialise variables where they're declared?
I don't remember. I had simply accepted this guideline years ago and
haven't gone back to question it since. There's no time to fight the
same old battles again and again. :)
>>> +
>>> + //
>>> + // Truncate Description and convert to ASCII.
>>> + //
>>> + if (StrLen (Description) >= sizeof (AsciiDescription)) {
>>> + Description[sizeof (AsciiDescription) - 1] = L'0';
>>
>> (3) Sneaky typo. You mean (and I requested) L'\0'. L'0' is different. :)
>
> Oops :)
>
> What was it I said about testing of corner cases when
> updating/rebasing? I had explicitly tested this by cutting the size
> down to 16 and watching it actually truncate. Obviously I didn't do
> *that* again this time round (I have now!)
>
> Well spotted; thanks!
>
> I've pushed all the fixes you've just pointed out (thanks again) to my
> 'csm' branch. Won't send another series by email today; I'll let the
> dust settle and some of the other discussions continue.
I agree, let's give Ray and others time to react. My comments have been
mostly cosmetic in this round anyway.
> When I do repost, I may send the required functional patches 1-3,7 on
> their own as I think they're ready to apply as-is, and leave the
> cosmetic patches 4-6 in a separate series for further bikeshedding.
1-3,7 only touch OvmfPkg, so I could push those quickly then.
Thanks,
Laszlo
next prev parent reply other threads:[~2019-06-25 19:16 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-25 11:48 [PATCH v2 1/7] OvmfPkg/LegacyBios: set NumberBbsEntries to the size of BbsTable David Woodhouse
2019-06-25 11:48 ` [PATCH v2 2/7] OvmfPkg/LegacyBbs: Add boot entries for VirtIO and NVME devices David Woodhouse
2019-06-25 11:48 ` [PATCH v2 3/7] OvmfPkg: Don't build in QemuVideoDxe when we have CSM David Woodhouse
2019-06-25 11:48 ` [PATCH v2 4/7] MdeModulePkg/UefiBootManagerLib: export EfiBootManagerGetBootDescription() David Woodhouse
2019-06-27 2:12 ` [edk2-devel] " Ni, Ray
2019-06-25 11:48 ` [PATCH v2 5/7] OvmfPkg/LegacyBiosDxe: Use EfiBootManagerGetBootDescription() David Woodhouse
2019-06-25 13:29 ` Laszlo Ersek
2019-06-25 14:10 ` [edk2-devel] " David Woodhouse
2019-06-25 19:16 ` Laszlo Ersek [this message]
2019-06-25 11:48 ` [PATCH v2 6/7] MdeModulePkg/UefiBootManagerLib: describe VirtIO devices correctly David Woodhouse
2019-06-25 13:44 ` Laszlo Ersek
2019-06-25 11:48 ` [PATCH v2 7/7] OvmfPkg: don't assign PCI BARs above 4GiB when CSM enabled David Woodhouse
2019-06-25 13:47 ` 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=3ad47704-b32a-c92f-8779-6384ae75cf31@redhat.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