Skip to content

Commit 9ef0319

Browse files
huthmpe
authored andcommitted
powerpc/rtas: Replace magic values with defines
rtas.h already has some nice #defines for RTAS return status codes - let's use them instead of hard-coded "magic" values! Signed-off-by: Thomas Huth <[email protected]> Reviewed-by: Tyrel Datwyler <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent 79cd952 commit 9ef0319

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

arch/powerpc/kernel/rtas.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -478,8 +478,9 @@ unsigned int rtas_busy_delay_time(int status)
478478

479479
if (status == RTAS_BUSY) {
480480
ms = 1;
481-
} else if (status >= 9900 && status <= 9905) {
482-
order = status - 9900;
481+
} else if (status >= RTAS_EXTENDED_DELAY_MIN &&
482+
status <= RTAS_EXTENDED_DELAY_MAX) {
483+
order = status - RTAS_EXTENDED_DELAY_MIN;
483484
for (ms = 1; order > 0; order--)
484485
ms *= 10;
485486
}
@@ -641,7 +642,8 @@ int rtas_set_indicator_fast(int indicator, int index, int new_value)
641642

642643
rc = rtas_call(token, 3, 1, NULL, indicator, index, new_value);
643644

644-
WARN_ON(rc == -2 || (rc >= 9900 && rc <= 9905));
645+
WARN_ON(rc == RTAS_BUSY || (rc >= RTAS_EXTENDED_DELAY_MIN &&
646+
rc <= RTAS_EXTENDED_DELAY_MAX));
645647

646648
if (rc < 0)
647649
return rtas_error_rc(rc);

0 commit comments

Comments
 (0)