From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Sun, 19 May 2019 16:44:22 -0400 Subject: [U-Boot] [PATCH v3 1/5] CONFIG_SYS_[ID]CACHE_OFF: unify the 'any' case In-Reply-To: <20190503134100.23636-2-trevor@toganlabs.com> References: <20190503134100.23636-1-trevor@toganlabs.com> <20190503134100.23636-2-trevor@toganlabs.com> Message-ID: <20190519204422.GR22232@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 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: