casaroli commented on code in PR #14490:
URL: https://github.com/apache/nuttx/pull/14490#discussion_r4434908585
##########
arch/arm/src/armv7-m/arm_cache.c:
##########
@@ -530,13 +530,12 @@ void up_enable_dcache(void)
do
{
int32_t tmpways = ways;
-
do
{
sw = ((tmpways << wshift) | (sets << sshift));
putreg32(sw, NVIC_DCISW);
}
- while (tmpways--);
+ while (tmpways > 0 && tmpways--)
Review Comment:
This line has no `;`, so the file does not compile. With the `;`, the loop
stops at the same point as `while (tmpways--)`: both test the old value against
`0`. `CCSIDR_WAYS()` is at most `0x3ff`, so `tmpways` is never negative.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]