summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2015-07-22 18:56:47 +0200
committerMichael Ellerman <mpe@ellerman.id.au>2015-07-23 16:27:05 +1000
commit9ef03193a93553885b43731c47d3b6ae90e677c4 (patch)
treec74c8ee8a2000d090fb13c9a061042569dce7dfe
parent79cd95200035fb4b39b089dd01c13302eee6ee03 (diff)
downloadlinux-9ef03193a93553885b43731c47d3b6ae90e677c4.tar.bz2
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 <thuth@redhat.com> Reviewed-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rw-r--r--arch/powerpc/kernel/rtas.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index 7a488c108410..10fb4024a0ce 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -478,8 +478,9 @@ unsigned int rtas_busy_delay_time(int status)
if (status == RTAS_BUSY) {
ms = 1;
- } else if (status >= 9900 && status <= 9905) {
- order = status - 9900;
+ } else if (status >= RTAS_EXTENDED_DELAY_MIN &&
+ status <= RTAS_EXTENDED_DELAY_MAX) {
+ order = status - RTAS_EXTENDED_DELAY_MIN;
for (ms = 1; order > 0; order--)
ms *= 10;
}
@@ -641,7 +642,8 @@ int rtas_set_indicator_fast(int indicator, int index, int new_value)
rc = rtas_call(token, 3, 1, NULL, indicator, index, new_value);
- WARN_ON(rc == -2 || (rc >= 9900 && rc <= 9905));
+ WARN_ON(rc == RTAS_BUSY || (rc >= RTAS_EXTENDED_DELAY_MIN &&
+ rc <= RTAS_EXTENDED_DELAY_MAX));
if (rc < 0)
return rtas_error_rc(rc);