Skip to content

Commit

Permalink
powerpc/rtas: Replace magic values with defines
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Thomas Huth authored and Michael Ellerman committed Jul 23, 2015
1 parent 79cd952 commit 9ef0319
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions arch/powerpc/kernel/rtas.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 9ef0319

Please sign in to comment.