From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 1/5] CONFIG_SYS_[ID]CACHE_OFF: unify the 'any' case
Date: Sun, 19 May 2019 16:44:22 -0400 [thread overview]
Message-ID: <20190519204422.GR22232@bill-the-cat> (raw)
In-Reply-To: <20190503134100.23636-2-trevor@toganlabs.com>
On Fri, May 03, 2019 at 09:40:56AM -0400, Trevor Woerner wrote:
> According to De Morgan's Law[1]:
> !(A && B) = !A || !B
> !(A || B) = !A && !B
>
> There are 5 places in the code where we find:
> #if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF))
> and 4 places in the code where we find:
> #if (!defined(CONFIG_SYS_ICACHE_OFF) || !defined(CONFIG_SYS_DCACHE_OFF))
>
> In words, the construct:
> !defined(CONFIG_SYS_[DI]CACHE_OFF)
> means:
> "is the [DI]CACHE on?"
> and the construct:
> defined(CONFIG_SYS_[DI]CACHE_OFF)
> means:
> "is the [DI]CACHE off?"
>
> Therefore
> !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF))
> means:
> "the opposite of 'are they both off?'"
> in other words:
> "are either or both on?"
> and:
> (!defined(CONFIG_SYS_ICACHE_OFF) || !defined(CONFIG_SYS_DCACHE_OFF)
> means:
> "are either or both on?"
>
> As a result, I've converted the 4 instances of '(!A || !B)' to '!(A && B)' for
> consistency.
>
> [1] https://en.wikipedia.org/wiki/De_Morgan%27s_laws
>
> Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190519/f3cb3005/attachment.sig>
next prev parent reply other threads:[~2019-05-19 20:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-03 13:40 [U-Boot] [PATCH v3 0/5] Kconfig conversion: CONFIG_SYS_[DI]CACHE_OFF Trevor Woerner
2019-05-03 13:40 ` [U-Boot] [PATCH v3 1/5] CONFIG_SYS_[ID]CACHE_OFF: unify the 'any' case Trevor Woerner
2019-05-19 20:44 ` Tom Rini [this message]
2019-05-03 13:40 ` [U-Boot] [PATCH v3 2/5] CONFIG_SYS_[DI]CACHE_OFF: remove superfluous "1" Trevor Woerner
2019-05-19 20:44 ` Tom Rini
2019-05-03 13:40 ` [U-Boot] [PATCH v3 3/5] CONFIG_SYS_[DI]CACHE_OFF: remove commented lines Trevor Woerner
2019-05-19 20:44 ` Tom Rini
2019-05-03 13:40 ` [U-Boot] [PATCH v3 4/5] CONFIG_SYS_[DI]CACHE_OFF: convert to Kconfig Trevor Woerner
2019-05-19 20:44 ` Tom Rini
2019-05-03 13:41 ` [U-Boot] [PATCH v3 5/5] CONFIG_SPL_SYS_[DI]CACHE_OFF: add Trevor Woerner
2019-05-19 20:44 ` Tom Rini
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=20190519204422.GR22232@bill-the-cat \
--to=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox