[Skiboot] [PATCH 12/36] sparse: fix incorrect type warnings in hdata/fsp.c

Stewart Smith stewart at linux.vnet.ibm.com
Tue Nov 10 15:18:06 AEDT 2015

No changes in resulting code as skiboot is BE, but does silence
the sparse warnings.

hdata/fsp.c:67:9: warning: incorrect type in initializer (different base types)
hdata/fsp.c:67:9:    expected unsigned int
hdata/fsp.c:67:9:    got restricted beint16_t const [usertype] hw_version
hdata/fsp.c:68:9: warning: incorrect type in initializer (different base types)
hdata/fsp.c:68:9:    expected unsigned int
hdata/fsp.c:68:9:    got restricted beint16_t const [usertype] sw_version
hdata/fsp.c:103:46: warning: incorrect type in argument 1 (different base types)
hdata/fsp.c:103:46:    expected unsigned int [unsigned] [usertype] proc_chip_id
hdata/fsp.c:103:46:    got restricted beint32_t const [usertype] proc_chip_id

Signed-off-by: Stewart Smith <stewart at linux.vnet.ibm.com>
 hdata/fsp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/hdata/fsp.c b/hdata/fsp.c
index 595e1f8b1795..9ea5137acd8e 100644
--- a/hdata/fsp.c
+++ b/hdata/fsp.c
@@ -64,8 +64,8 @@ static struct dt_node *fsp_create_node(const void *spss, int i,
 		dt_add_property_cells(node, "reg-offset", 0xb0011000);
-	dt_add_property_cells(node, "hw-version", sp_impl->hw_version);
-	dt_add_property_cells(node, "sw-version", sp_impl->sw_version);
+	dt_add_property_cells(node, "hw-version", be16_to_cpu(sp_impl->hw_version));
+	dt_add_property_cells(node, "sw-version", be16_to_cpu(sp_impl->sw_version));
 	if (be16_to_cpu(sp_impl->func_flags) & SPSS_SP_IMPL_FLAGS_PRIMARY)
 		dt_add_property(node, "primary", NULL, 0);
@@ -100,7 +100,7 @@ static uint32_t fsp_create_link(const struct spss_iopath *iopath, int index,
 	prlog(PR_DEBUG, "FSP #%d: IO PATH %d is %s PSI Link, GXHB at %llx\n",
 	      fsp_index, index, ststr, (long long)iopath->psi.gxhb_base);
-	chip_id = pcid_to_chip_id(iopath->psi.proc_chip_id);
+	chip_id = pcid_to_chip_id(be32_to_cpu(iopath->psi.proc_chip_id));
 	node = dt_find_compatible_node_on_chip(dt_root, NULL, "ibm,psihb-x",
 	if (!node) {

More information about the Skiboot mailing list