powerpc: edac: Fix build error
PATCH 1/1 powerpc: edac: Fix build error
Fix the following build error:
drivers/edac/ppc4xx_edac.c: In function 'mfsdram':drivers/edac/ppc4xx_edac.c:249: error: implicit declaration of function '__mfdcri'drivers/edac/ppc4xx_edac.c: In function 'mtsdram':drivers/edac/ppc4xx_edac.c:266: error: implicit declaration of function '__mtdcri'drivers/edac/ppc4xx_edac.c:269: warning: 'return' with a value, in function returning voiddrivers/edac/ppc4xx_edac.c: In function 'ppc4xx_edac_init_csrows':drivers/edac/ppc4xx_edac.c:924: warning: initialization from incompatible pointer typedrivers/edac/ppc4xx_edac.c:977: error: request for member 'dimm' in something not a structure or uniondrivers/edac/ppc4xx_edac.c: In function 'ppc4xx_edac_map_dcrs':drivers/edac/ppc4xx_edac.c:1209: warning: passing argument 1 of 'dcr_map_mmio' discards qualifiers from pointer target type
This driver depends on PPC_DCR_NATIVE to be set for the relevant headers to be included. Also if PPC_DCR_MMIO=n the build fails. So make PPC_DCR depend on both these options.
This is compile tested only.
--- arch/powerpc/Kconfig | 6 +++--- drivers/edac/ppc4xx_edac.c | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-)
arch/powerpc/Kconfig +3 -3
@@ -233,15 +233,15 @@ config ARCH_SUSPEND_POSSIBLE config PPC_DCR_NATIVE bool - default n + default y config PPC_DCR_MMIO bool - default n + default y config PPC_DCR bool - depends on PPC_DCR_NATIVE || PPC_DCR_MMIO + depends on PPC_DCR_NATIVE && PPC_DCR_MMIO default y config PPC_OF_PLATFORM_PCI
drivers/edac/ppc4xx_edac.c +4 -4
@@ -246,8 +246,8 @@ static const char * const ppc4xx_plb_masters[9] = {static inline u32 mfsdram (const dcr_host_t *dcr_host,unsigned int idcr_n) { -return __mfdcri (dcr_host->base +SDRAM_DCR_ADDR_OFFSET , - dcr_host->base +SDRAM_DCR_DATA_OFFSET , +return __mfdcri (dcr_host->host.native.base +SDRAM_DCR_ADDR_OFFSET , + dcr_host->host.native.base +SDRAM_DCR_DATA_OFFSET , idcr_n); }
@@ -263,8 +263,8 @@ mfsdram(const dcr_host_t *dcr_host, unsigned int idcr_n)static inline void mtsdram (const dcr_host_t *dcr_host,unsigned int idcr_n,u32 value) { -return __mtdcri (dcr_host->base +SDRAM_DCR_ADDR_OFFSET , - dcr_host->base +SDRAM_DCR_DATA_OFFSET , +return __mtdcri (dcr_host->host.native.base +SDRAM_DCR_ADDR_OFFSET , + dcr_host->host.native.base +SDRAM_DCR_DATA_OFFSET , idcr_n, value); }
Signature · 1 line
1.9.1
Borislav Petkov
maintainerQuoted 19 lines · Pranith Kumar
Fix the following build error:
drivers/edac/ppc4xx_edac.c: In function 'mfsdram':drivers/edac/ppc4xx_edac.c:249: error: implicit declaration of function '__mfdcri'drivers/edac/ppc4xx_edac.c: In function 'mtsdram':drivers/edac/ppc4xx_edac.c:266: error: implicit declaration of function '__mtdcri'drivers/edac/ppc4xx_edac.c:269: warning: 'return' with a value, in function returning voiddrivers/edac/ppc4xx_edac.c: In function 'ppc4xx_edac_init_csrows':drivers/edac/ppc4xx_edac.c:924: warning: initialization from incompatible pointer typedrivers/edac/ppc4xx_edac.c:977: error: request for member 'dimm' in something not a structure or uniondrivers/edac/ppc4xx_edac.c: In function 'ppc4xx_edac_map_dcrs':drivers/edac/ppc4xx_edac.c:1209: warning: passing argument 1 of 'dcr_map_mmio' discards qualifiers from pointer target type
Quoted 5 lines
This driver depends on
PPC_DCR_NATIVEto be set for the relevant headers to be included. Also if PPC_DCR_MMIO=n the build fails. So makePPC_DCRdepend on both these options.This is compile tested only.
This driver has been carried through the years from misc people after its initial drop in 2009. And frankly, I'd prefer if someone with the hardware could actually test it before we break it any further.
Alternatively, if it is obsolete and no one uses it, we could very well delete it instead. Initial commit talks about the hw it supports:
dba7a77c0e40 ("edac: new ppc4xx driver module")
So it would be good if we got some opinions from the PPC crowd. Who are on CC.
(leaving in the rest for context).
Quoted 61 lines
Signed-off-by Pranith Kumar <[email protected]>CC Andrew Morton <[email protected]>--- arch/powerpc/Kconfig | 6 +++--- drivers/edac/ppc4xx_edac.c | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-)arch/powerpc/Kconfig +3
-3@@ -233,15 +233,15 @@ config ARCH_SUSPEND_POSSIBLE config PPC_DCR_NATIVE bool - default n + default y config PPC_DCR_MMIO bool - default n + default y config PPC_DCR bool - depends on PPC_DCR_NATIVE || PPC_DCR_MMIO + depends on PPC_DCR_NATIVE && PPC_DCR_MMIO default y config PPC_OF_PLATFORM_PCIdrivers/edac/ppc4xx_edac.c +4
-4@@ -246,8 +246,8 @@ static const char * const ppc4xx_plb_masters[9] = {static inline u32 mfsdram (const dcr_host_t *dcr_host,unsigned int idcr_n) { -return __mfdcri (dcr_host->base +SDRAM_DCR_ADDR_OFFSET , - dcr_host->base +SDRAM_DCR_DATA_OFFSET , +return __mfdcri (dcr_host->host.native.base +SDRAM_DCR_ADDR_OFFSET , + dcr_host->host.native.base +SDRAM_DCR_DATA_OFFSET , idcr_n); }@@ -263,8 +263,8 @@ mfsdram(const dcr_host_t *dcr_host, unsigned int idcr_n)static inline void mtsdram (const dcr_host_t *dcr_host,unsigned int idcr_n,u32 value) { -return __mtdcri (dcr_host->base +SDRAM_DCR_ADDR_OFFSET , - dcr_host->base +SDRAM_DCR_DATA_OFFSET , +return __mtdcri (dcr_host->host.native.base +SDRAM_DCR_ADDR_OFFSET , + dcr_host->host.native.base +SDRAM_DCR_DATA_OFFSET , idcr_n, value); }Signature · 1 line
1.9.1
Signature · 5 lines
Regards/Gruss,
Boris.
Sent from a fat crate under my desk. Formatting is fine.
--Michael Ellerman
reviewerQuoted 19 lines · Pranith Kumar
Fix the following build error:
drivers/edac/ppc4xx_edac.c: In function 'mfsdram':drivers/edac/ppc4xx_edac.c:249: error: implicit declaration of function '__mfdcri'drivers/edac/ppc4xx_edac.c: In function 'mtsdram':drivers/edac/ppc4xx_edac.c:266: error: implicit declaration of function '__mtdcri'drivers/edac/ppc4xx_edac.c:269: warning: 'return' with a value, in function returning voiddrivers/edac/ppc4xx_edac.c: In function 'ppc4xx_edac_init_csrows':drivers/edac/ppc4xx_edac.c:924: warning: initialization from incompatible pointer typedrivers/edac/ppc4xx_edac.c:977: error: request for member 'dimm' in something not a structure or uniondrivers/edac/ppc4xx_edac.c: In function 'ppc4xx_edac_map_dcrs':drivers/edac/ppc4xx_edac.c:1209: warning: passing argument 1 of 'dcr_map_mmio' discards qualifiers from pointer target type
Quoted 3 lines
This driver depends on
PPC_DCR_NATIVEto be set for the relevant headers to be included. Also if PPC_DCR_MMIO=n the build fails. So makePPC_DCRdepend on both these options.
Um, NAK I think. The whole point is that some platforms implement DCR natively and some via MMIO, and that's meant to be hidden by the DCR API.
If the driver is directly calling DCR native routines then it should depend on that.
cheers