From: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
To: Thomas Huth <thuth@redhat.com>, linuxppc-dev@lists.ozlabs.org
Cc: paulus@samba.org
Subject: Re: [PATCH] powerpc/rtas: Replace magic values with defines
Date: Wed, 22 Jul 2015 17:24:47 -0700 [thread overview]
Message-ID: <55B0344F.3060008@linux.vnet.ibm.com> (raw)
In-Reply-To: <1437584207-20677-1-git-send-email-thuth@redhat.com>
On 07/22/2015 09:56 AM, Thomas Huth wrote:
> 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>
> ---
> arch/powerpc/kernel/rtas.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
> index 7a488c1..10fb402 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);
>
next prev parent reply other threads:[~2015-07-23 0:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-22 16:56 [PATCH] powerpc/rtas: Replace magic values with defines Thomas Huth
2015-07-23 0:24 ` Tyrel Datwyler [this message]
2015-08-03 1:35 ` Michael Ellerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55B0344F.3060008@linux.vnet.ibm.com \
--to=tyreld@linux.vnet.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=paulus@samba.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).