All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: Segher Boessenkool <segher@kernel.crashing.org>
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: Tue, 25 Feb 2020 12:38:16 +1100	[thread overview]
Message-ID: <2d0fdc56-bb83-ae82-9bdf-d8c0e117ea69@ozlabs.ru> (raw)
In-Reply-To: <20200224100442.GE22482@gate.crashing.org>



On 24/02/2020 21:04, Segher Boessenkool wrote:
> 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).

oh cool, I did not think gcc is that smart.



-- 
Alexey

  reply	other threads:[~2020-02-25  1:40 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
2020-02-25  1:38     ` Alexey Kardashevskiy [this message]
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=2d0fdc56-bb83-ae82-9bdf-d8c0e117ea69@ozlabs.ru \
    --to=aik@ozlabs.ru \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=oohall@gmail.com \
    --cc=segher@kernel.crashing.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.