From: "Marek Behún" <marek.behun@nic.cz>
To: "Pali Rohár" <pali@kernel.org>
Cc: Tony Dinh <mibodhi@gmail.com>,
U-Boot Mailing List <u-boot@lists.denx.de>,
Stefan Roese <sr@denx.de>, Tom Rini <trini@konsulko.com>
Subject: Re: kwboot: Marvell Dove UART booting
Date: Sun, 13 Feb 2022 22:33:20 +0100 [thread overview]
Message-ID: <20220213223320.762bc6c4@thinkpad> (raw)
In-Reply-To: <20220213212310.ugq7uye4rhnhak5z@pali>
On Sun, 13 Feb 2022 22:23:10 +0100
Pali Rohár <pali@kernel.org> wrote:
> > In that case the whole ternary operator can be dropped, i.e. instead of
> > ((hdr->ext > 1) ? (hdr->ext * 0x20) : 0)
> > you can have
> > ((hdr->ext - 1) * 0x20)
> > if I interpret this correctly.
>
> No, it cannot be dropped, with correction it is:
>
> ((hdr->ext > 1) ? ((hdr->ext - 1) * 0x20) : 0)
>
> When hdr->ext is zero, result must be also 0, not (uint8_t)-1 * 0x20.
Oh, so hdr->ext can be zero. OK.
So you can drop at least the "> 1":
hdr->ext ? ((hdr->ext - 1) * 0x20) : 0
but that is almost as horrible as with "> 1", so you can keep it if you
want :)
Marek
next prev parent reply other threads:[~2022-02-13 21:33 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-23 4:08 kwboot: Marvell Dove UART booting Tony Dinh
2021-12-26 21:41 ` Tony Dinh
2022-01-01 21:53 ` Pali Rohár
2022-01-01 22:54 ` Tony Dinh
2022-01-01 23:12 ` Pali Rohár
2022-01-02 0:00 ` Tony Dinh
2022-01-02 0:28 ` Pali Rohár
2022-02-13 16:10 ` Pali Rohár
2022-02-13 16:16 ` Pali Rohár
2022-02-13 19:41 ` Pali Rohár
2022-02-13 21:15 ` Marek Behún
2022-02-13 21:23 ` Pali Rohár
2022-02-13 21:33 ` Marek Behún [this message]
2022-02-13 21:55 ` Tony Dinh
2022-02-13 22:45 ` Tony Dinh
2022-02-13 22:48 ` Pali Rohár
2022-02-13 23:24 ` Tony Dinh
2022-02-13 23:42 ` Pali Rohár
2022-02-14 0:08 ` Tony Dinh
2022-02-14 0:21 ` Pali Rohár
2022-02-14 1:10 ` Tony Dinh
2022-02-14 9:58 ` Pali Rohár
2022-02-14 22:00 ` Tony Dinh
2022-02-15 19:11 ` Pali Rohár
2022-02-15 22:11 ` Tony Dinh
2022-02-15 23:02 ` Pali Rohár
2022-02-17 4:18 ` Tony Dinh
2023-03-20 20:33 ` Pali Rohár
2023-03-20 20:48 ` Tony Dinh
2023-03-20 21:06 ` Pali Rohár
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=20220213223320.762bc6c4@thinkpad \
--to=marek.behun@nic.cz \
--cc=mibodhi@gmail.com \
--cc=pali@kernel.org \
--cc=sr@denx.de \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
/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.