From: "Cédric Le Goater" <clg@fr.ibm.com>
To: benh@kernel.crashing.org
Cc: "Cédric Le Goater" <clg@fr.ibm.com>, linuxppc-dev@lists.ozlabs.org
Subject: [PATCH v2 05/15] powerpc/boot: add PROM_ERROR define in oflib
Date: Mon, 14 Apr 2014 09:47:04 +0200 [thread overview]
Message-ID: <1397461634-20949-6-git-send-email-clg@fr.ibm.com> (raw)
In-Reply-To: <1397461634-20949-1-git-send-email-clg@fr.ibm.com>
In-Reply-To: <1395651884.30488.10.camel@pasglop>
This is mostly useful to make to the boot wrapper code closer with
the kernel code in prom_init.
Signed-off-by: Cédric Le Goater <clg@fr.ibm.com>
---
Changes since v1:
- moved PROM_ERROR definition in of.h. of_try_claim() will make
use of it in the next patch.
arch/powerpc/boot/of.h | 2 ++
arch/powerpc/boot/oflib.c | 6 +++---
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/boot/of.h b/arch/powerpc/boot/of.h
index 40d95bf7402b..0f058ef69521 100644
--- a/arch/powerpc/boot/of.h
+++ b/arch/powerpc/boot/of.h
@@ -23,4 +23,6 @@ typedef u32 __be32;
#define cpu_to_be32(x) (x)
#define be32_to_cpu(x) (x)
+#define PROM_ERROR (-1u)
+
#endif /* _PPC_BOOT_OF_H_ */
diff --git a/arch/powerpc/boot/oflib.c b/arch/powerpc/boot/oflib.c
index 0f72b1a42133..7f61f2eb5653 100644
--- a/arch/powerpc/boot/oflib.c
+++ b/arch/powerpc/boot/oflib.c
@@ -55,7 +55,7 @@ int of_call_prom(const char *service, int nargs, int nret, ...)
args.args[nargs+i] = 0;
if (prom(&args) < 0)
- return -1;
+ return PROM_ERROR;
return (nret > 0) ? be32_to_cpu(args.args[nargs]) : 0;
}
@@ -80,9 +80,9 @@ static int of_call_prom_ret(const char *service, int nargs, int nret,
args.args[nargs+i] = 0;
if (prom(&args) < 0)
- return -1;
+ return PROM_ERROR;
- if (rets != (void *) 0)
+ if (rets != NULL)
for (i = 1; i < nret; ++i)
rets[i-1] = be32_to_cpu(args.args[nargs+i]);
--
1.7.10.4
next prev parent reply other threads:[~2014-04-14 7:48 UTC|newest]
Thread overview: 79+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-07 15:59 [RFC PATCH 00/18] powerpc/boot: 64bit little endian wrapper for pseries Cédric Le Goater
2014-02-07 15:59 ` [RFC PATCH 01/18] powerpc/boot: fix do_div for 64bit wrapper Cédric Le Goater
2014-02-07 15:59 ` [RFC PATCH 02/18] powerpc/boot: use a common prom_args struct in oflib Cédric Le Goater
2014-02-07 15:59 ` [RFC PATCH 03/18] powerpc/boot: use prom_arg_t " Cédric Le Goater
2014-02-07 15:59 ` [RFC PATCH 04/18] powerpc/boot: add byteswapping routines " Cédric Le Goater
2014-02-07 15:59 ` [RFC PATCH 05/18] powerpc/boot: add PROM_ERROR define " Cédric Le Goater
2014-02-07 15:59 ` [RFC PATCH 06/18] powerpc/boot: rework of_claim() to make it 64bit friendly Cédric Le Goater
2014-02-07 15:59 ` [RFC PATCH 07/18] powerpc/boot: define typedef ihandle as u32 Cédric Le Goater
2014-02-07 15:59 ` [RFC PATCH 08/18] powerpc/boot: fix compile warning in 64bit Cédric Le Goater
2014-02-07 15:59 ` [RFC PATCH 09/18] powerpc/boot: define byteswapping routines for little endian Cédric Le Goater
2014-02-07 15:59 ` [RFC PATCH 10/18] powerpc/boot: add 64bit and little endian support to addnote Cédric Le Goater
2014-02-07 15:59 ` [RFC PATCH 11/18] powerpc/boot: add little endian support to elf utils Cédric Le Goater
2014-02-07 15:59 ` [RFC PATCH 12/18] powerpc/boot: define a routine to enter prom Cédric Le Goater
2014-02-07 15:59 ` [RFC PATCH 13/18] powerpc/boot: modify entry point for 64bit Cédric Le Goater
2014-02-07 15:59 ` [RFC PATCH 14/18] powerpc/boot: modify how we enter kernel on 64bit Cédric Le Goater
2014-02-07 15:59 ` [RFC PATCH 15/18] powerpc/boot: add a global entry point for pseries Cédric Le Goater
2014-02-07 15:59 ` [RFC PATCH 16/18] powerpc/boot: add support for 64bit big endian wrapper Cédric Le Goater
2014-02-07 15:59 ` [RFC PATCH 17/18] powerpc/boot: add support for 64bit little " Cédric Le Goater
2014-02-07 15:59 ` [RFC PATCH 18/18] powerpc/boot: add PPC64_BOOT_WRAPPER config option Cédric Le Goater
2014-03-20 15:09 ` [PATCH 00/18] powerpc/boot: 64bit little endian wrapper Cédric Le Goater
2014-03-20 17:03 ` Geoff Levand
2014-03-21 8:37 ` Cedric Le Goater
2014-03-21 9:37 ` Cedric Le Goater
2014-03-21 17:28 ` Geoff Levand
2014-03-21 17:40 ` Cedric Le Goater
2014-03-20 15:09 ` [PATCH 01/18] powerpc/boot: fix do_div for 64bit wrapper Cédric Le Goater
2014-03-20 15:09 ` [PATCH 02/18] powerpc/boot: use a common prom_args struct in oflib Cédric Le Goater
2014-03-20 15:09 ` [PATCH 03/18] powerpc/boot: use prom_arg_t " Cédric Le Goater
2014-03-20 15:09 ` [PATCH 04/18] powerpc/boot: add byteswapping routines " Cédric Le Goater
2014-03-20 15:10 ` [PATCH 05/18] powerpc/boot: add PROM_ERROR define " Cédric Le Goater
2014-03-20 15:10 ` [PATCH 06/18] powerpc/boot: rework of_claim() to make it 64bit friendly Cédric Le Goater
2014-03-20 15:10 ` [PATCH 07/18] powerpc/boot: define typedef ihandle as u32 Cédric Le Goater
2014-03-20 15:10 ` [PATCH 08/18] powerpc/boot: fix compile warning in 64bit Cédric Le Goater
2014-03-20 15:10 ` [PATCH 09/18] powerpc/boot: define byteswapping routines for little endian Cédric Le Goater
2014-03-20 15:10 ` [PATCH 10/18] powerpc/boot: add 64bit and little endian support to addnote Cédric Le Goater
2014-03-20 15:10 ` [PATCH 11/18] powerpc/boot: add little endian support to elf utils Cédric Le Goater
2014-03-20 15:10 ` [PATCH 12/18] powerpc/boot: define a routine to enter prom Cédric Le Goater
2014-03-20 15:10 ` [PATCH 13/18] powerpc/boot: modify entry point for 64bit Cédric Le Goater
2014-03-20 15:10 ` [PATCH 14/18] powerpc/boot: modify how we enter kernel on 64bit Cédric Le Goater
2014-03-20 15:10 ` [PATCH 15/18] powerpc/boot: add a global entry point for pseries Cédric Le Goater
2014-03-20 15:10 ` [PATCH 16/18] powerpc/boot: add support for 64bit big endian wrapper Cédric Le Goater
2014-03-20 15:10 ` [PATCH 17/18] powerpc/boot: add support for 64bit little " Cédric Le Goater
2014-03-20 15:10 ` [PATCH 18/18] powerpc/boot: add PPC64_BOOT_WRAPPER config option Cédric Le Goater
2014-03-24 3:42 ` Benjamin Herrenschmidt
2014-03-24 8:38 ` Cedric Le Goater
2014-03-24 9:04 ` Benjamin Herrenschmidt
2014-03-24 10:22 ` [PATCH] powerpc/boot: fix global entry point for pseries Cédric Le Goater
2014-04-14 7:46 ` [PATCH v2 00/15] powerpc/boot: 64bit little endian wrapper Cédric Le Goater
2014-04-14 7:47 ` [PATCH v2 01/15] powerpc/boot: fix do_div for 64bit wrapper Cédric Le Goater
2014-04-14 7:47 ` [PATCH v2 02/15] powerpc/boot: use a common prom_args struct in oflib Cédric Le Goater
2014-04-14 7:47 ` [PATCH v2 03/15] powerpc/boot: use prom_arg_t " Cédric Le Goater
2014-04-14 7:47 ` [PATCH v2 04/15] powerpc/boot: add byteswapping routines " Cédric Le Goater
2014-04-14 7:47 ` Cédric Le Goater [this message]
2014-04-14 7:47 ` [PATCH v2 06/15] powerpc/boot: rework of_claim() to make it 64bit friendly Cédric Le Goater
2014-04-14 7:47 ` [PATCH v2 07/15] powerpc/boot: define typedef ihandle as u32 Cédric Le Goater
2014-04-14 7:47 ` [PATCH v2 08/15] powerpc/boot: fix compile warning in 64bit Cédric Le Goater
2014-04-14 7:47 ` [PATCH v2 09/15] powerpc/boot: define byteswapping routines for little endian Cédric Le Goater
2014-04-14 7:47 ` [PATCH v2 10/15] powerpc/boot: add 64bit and little endian support to addnote Cédric Le Goater
2014-04-14 7:47 ` [PATCH v2 11/15] powerpc/boot: add little endian support to elf utils Cédric Le Goater
2014-04-14 7:47 ` [PATCH v2 12/15] powerpc/boot: define a routine to enter prom Cédric Le Goater
2014-04-14 7:47 ` [PATCH v2 13/15] powerpc/boot: modify entry point for 64bit Cédric Le Goater
2014-04-14 7:47 ` [PATCH v2 14/15] powerpc/boot: add a global entry point for pseries Cédric Le Goater
2014-04-14 7:47 ` [PATCH v2 15/15] powerpc/boot: add support for 64bit little endian wrapper Cédric Le Goater
2014-04-24 7:23 ` [PATCH v2 00/15] powerpc/boot: 64bit little endian wrapper (rebased on v3.15-rc2) Cédric Le Goater
2014-04-24 7:23 ` [PATCH v2 01/15] powerpc/boot: fix do_div for 64bit wrapper Cédric Le Goater
2014-04-24 7:23 ` [PATCH v2 02/15] powerpc/boot: use a common prom_args struct in oflib Cédric Le Goater
2014-04-24 7:23 ` [PATCH v2 03/15] powerpc/boot: use prom_arg_t " Cédric Le Goater
2014-04-24 7:23 ` [PATCH v2 04/15] powerpc/boot: add byteswapping routines " Cédric Le Goater
2014-04-24 7:23 ` [PATCH v2 05/15] powerpc/boot: add PROM_ERROR define " Cédric Le Goater
2014-04-24 7:23 ` [PATCH v2 06/15] powerpc/boot: rework of_claim() to make it 64bit friendly Cédric Le Goater
2014-04-24 7:23 ` [PATCH v2 07/15] powerpc/boot: define typedef ihandle as u32 Cédric Le Goater
2014-04-24 7:23 ` [PATCH v2 08/15] powerpc/boot: fix compile warning in 64bit Cédric Le Goater
2014-04-24 7:23 ` [PATCH v2 09/15] powerpc/boot: define byteswapping routines for little endian Cédric Le Goater
2014-04-24 7:23 ` [PATCH v2 10/15] powerpc/boot: add 64bit and little endian support to addnote Cédric Le Goater
2014-04-24 7:23 ` [PATCH v2 11/15] powerpc/boot: add little endian support to elf utils Cédric Le Goater
2014-04-24 7:23 ` [PATCH v2 12/15] powerpc/boot: define a routine to enter prom Cédric Le Goater
2014-04-24 7:23 ` [PATCH v2 13/15] powerpc/boot: modify entry point for 64bit Cédric Le Goater
2014-04-24 7:23 ` [PATCH v2 14/15] powerpc/boot: add a global entry point for pseries Cédric Le Goater
2014-04-24 7:23 ` [PATCH v2 15/15] powerpc/boot: add support for 64bit little endian wrapper Cédric Le Goater
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=1397461634-20949-6-git-send-email-clg@fr.ibm.com \
--to=clg@fr.ibm.com \
--cc=benh@kernel.crashing.org \
--cc=linuxppc-dev@lists.ozlabs.org \
/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).