]> git.baikalelectronics.ru Git - uboot.git/commit
CONFIG_SYS_[ID]CACHE_OFF: unify the 'any' case
authorTrevor Woerner <trevor@toganlabs.com>
Fri, 3 May 2019 13:40:56 +0000 (09:40 -0400)
committerTom Rini <trini@konsulko.com>
Sat, 18 May 2019 12:15:34 +0000 (08:15 -0400)
commit68c4d6d03c602f7d6aad631532ad0624963efc0f
treeaaea9613ce1dfb3a872587d6ef0c4fa7f639efbb
parentc5a49c05641ccbe97f27efff48433726a271aade
CONFIG_SYS_[ID]CACHE_OFF: unify the 'any' case

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>
arch/arm/cpu/arm11/cpu.c
arch/nds32/cpu/n1213/start.S
arch/nds32/lib/cache.c
arch/xtensa/cpu/start.S