Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/boot: Add PROM_ERROR define in oflib

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>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

authored by

Cédric Le Goater and committed by
Benjamin Herrenschmidt
9cc36bb0 926e6940

+5 -3
+2
arch/powerpc/boot/of.h
··· 23 23 #define cpu_to_be32(x) (x) 24 24 #define be32_to_cpu(x) (x) 25 25 26 + #define PROM_ERROR (-1u) 27 + 26 28 #endif /* _PPC_BOOT_OF_H_ */
+3 -3
arch/powerpc/boot/oflib.c
··· 55 55 args.args[nargs+i] = 0; 56 56 57 57 if (prom(&args) < 0) 58 - return -1; 58 + return PROM_ERROR; 59 59 60 60 return (nret > 0) ? be32_to_cpu(args.args[nargs]) : 0; 61 61 } ··· 80 80 args.args[nargs+i] = 0; 81 81 82 82 if (prom(&args) < 0) 83 - return -1; 83 + return PROM_ERROR; 84 84 85 - if (rets != (void *) 0) 85 + if (rets != NULL) 86 86 for (i = 1; i < nret; ++i) 87 87 rets[i-1] = be32_to_cpu(args.args[nargs+i]); 88 88