diff --git a/arch/arm/src/armv7-a/arm_cache.c b/arch/arm/src/armv7-a/arm_cache.c index c595fcc5b1..bb59ebc4d0 100644 --- a/arch/arm/src/armv7-a/arm_cache.c +++ b/arch/arm/src/armv7-a/arm_cache.c @@ -134,7 +134,7 @@ void up_invalidate_icache_all(void) void up_clean_dcache(uintptr_t start, uintptr_t end) { - if (cp15_cache_size() < (end - start)) + if ((end - start) < cp15_cache_size()) { cp15_clean_dcache(start, end); } @@ -198,7 +198,7 @@ void up_clean_dcache_all(void) void up_flush_dcache(uintptr_t start, uintptr_t end) { - if (cp15_cache_size() < (end - start)) + if ((end - start) < cp15_cache_size()) { cp15_flush_dcache(start, end); } diff --git a/arch/arm/src/armv7-r/arm_cache.c b/arch/arm/src/armv7-r/arm_cache.c index 827d57231c..f1598d174c 100644 --- a/arch/arm/src/armv7-r/arm_cache.c +++ b/arch/arm/src/armv7-r/arm_cache.c @@ -134,7 +134,7 @@ void up_invalidate_icache_all(void) void up_clean_dcache(uintptr_t start, uintptr_t end) { - if (cp15_cache_size() < (end - start)) + if ((end - start) < cp15_cache_size()) { cp15_clean_dcache(start, end); } @@ -198,7 +198,7 @@ void up_clean_dcache_all(void) void up_flush_dcache(uintptr_t start, uintptr_t end) { - if (cp15_cache_size() < (end - start)) + if ((end - start) < cp15_cache_size()) { cp15_flush_dcache(start, end); }