[POWERPC] Change rheap functions to use ulongs instead of pointers
The rheap allocation functions return a pointer, but the actual value is based on how the heap was initialized, and so it can be anything, e.g. an offset into a buffer. A ulong is a better representation of the value returned by the allocation functions. This patch changes all of the relevant rheap functions to use a unsigned long integers instead of a pointer. In case of an error, the value returned is a negative error code that has been cast to an unsigned long. The caller can use the IS_ERR_VALUE() macro to check for this. All code which calls the rheap functions is updated accordingly. Macros IS_MURAM_ERR() and IS_DPERR(), have been deleted in favor of IS_ERR_VALUE(). Also added error checking to rh_attach_region(). Signed-off-by:Timur Tabi <timur@freescale.com> Signed-off-by:
Kumar Gala <galak@kernel.crashing.org>
Showing
- arch/powerpc/lib/rheap.c 67 additions, 50 deletionsarch/powerpc/lib/rheap.c
- arch/powerpc/sysdev/commproc.c 10 additions, 10 deletionsarch/powerpc/sysdev/commproc.c
- arch/powerpc/sysdev/cpm2_common.c 10 additions, 11 deletionsarch/powerpc/sysdev/cpm2_common.c
- arch/powerpc/sysdev/qe_lib/qe.c 14 additions, 15 deletionsarch/powerpc/sysdev/qe_lib/qe.c
- arch/powerpc/sysdev/qe_lib/ucc_fast.c 3 additions, 2 deletionsarch/powerpc/sysdev/qe_lib/ucc_fast.c
- arch/powerpc/sysdev/qe_lib/ucc_slow.c 4 additions, 3 deletionsarch/powerpc/sysdev/qe_lib/ucc_slow.c
- arch/ppc/8xx_io/commproc.c 11 additions, 11 deletionsarch/ppc/8xx_io/commproc.c
- arch/ppc/lib/rheap.c 49 additions, 46 deletionsarch/ppc/lib/rheap.c
- arch/ppc/syslib/cpm2_common.c 11 additions, 12 deletionsarch/ppc/syslib/cpm2_common.c
- drivers/net/fs_enet/mac-scc.c 1 addition, 1 deletiondrivers/net/fs_enet/mac-scc.c
- drivers/net/ucc_geth.c 15 additions, 15 deletionsdrivers/net/ucc_geth.c
- drivers/serial/cpm_uart/cpm_uart_cpm1.c 2 additions, 2 deletionsdrivers/serial/cpm_uart/cpm_uart_cpm1.c
- drivers/serial/cpm_uart/cpm_uart_cpm2.c 2 additions, 2 deletionsdrivers/serial/cpm_uart/cpm_uart_cpm2.c
- include/asm-powerpc/qe.h 4 additions, 9 deletionsinclude/asm-powerpc/qe.h
- include/asm-ppc/commproc.h 4 additions, 9 deletionsinclude/asm-ppc/commproc.h
- include/asm-ppc/cpm2.h 4 additions, 9 deletionsinclude/asm-ppc/cpm2.h
- include/asm-ppc/rheap.h 10 additions, 10 deletionsinclude/asm-ppc/rheap.h
Loading
Please register or sign in to comment