From: Segher Boessenkool <segher@kernel.crashing.org>
To: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: linuxppc-dev@lists.ozlabs.org, Oliver O'Halloran <oohall@gmail.com>
Subject: Re: [PATCH 1/2] powerpc/powernv: Treat an empty reboot string as default
Date: Mon, 24 Feb 2020 04:04:42 -0600 [thread overview]
Message-ID: <20200224100442.GE22482@gate.crashing.org> (raw)
In-Reply-To: <767d85e7-7d8f-4a88-b16e-a4d69fb51343@ozlabs.ru>
On Mon, Feb 24, 2020 at 01:32:28PM +1100, Alexey Kardashevskiy wrote:
> On 17/02/2020 13:48, Oliver O'Halloran wrote:
> > Treat an empty reboot cmd string the same as a NULL string. This squashes a
> > spurious unsupported reboot message that sometimes gets out when using
> > xmon.
> > - if (!cmd)
> > + if (!cmd || !strlen(cmd))
>
> nit: this does not matter here in practice but
>
> if (!cmd || cmd[0] == '\0')
>
> is faster (you do not care about the length anyway) and safer (@cmd can
> potentially be endless) ;)
No it isn't, this compiles to identical machine code. (I tested with
GCC 9, and going back until 4.6 -- the generated code becomes
progressively worse (unrelated to this code, fwiw), but identical for
both cases all the time).
Segher
next prev parent reply other threads:[~2020-02-24 10:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-17 2:48 [PATCH 1/2] powerpc/powernv: Treat an empty reboot string as default Oliver O'Halloran
2020-02-17 2:48 ` [PATCH 2/2] powerpc/powernv: Add explicit fast-reboot support Oliver O'Halloran
2020-02-24 3:16 ` Andrew Donnellan
2020-02-24 2:32 ` [PATCH 1/2] powerpc/powernv: Treat an empty reboot string as default Alexey Kardashevskiy
2020-02-24 10:04 ` Segher Boessenkool [this message]
2020-02-25 1:38 ` Alexey Kardashevskiy
2020-02-24 3:13 ` Andrew Donnellan
2020-03-06 0:27 ` Michael Ellerman
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-all 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=20200224100442.GE22482@gate.crashing.org \
--to=segher@kernel.crashing.org \
--cc=aik@ozlabs.ru \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=oohall@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).