From patchwork Tue Nov 10 04:18:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stewart Smith X-Patchwork-Id: 542157 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id CAB2B14017E for ; Tue, 10 Nov 2015 15:22:02 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id B16941A03CA for ; Tue, 10 Nov 2015 15:22:02 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from e18.ny.us.ibm.com (e18.ny.us.ibm.com [129.33.205.208]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 767D41A027B for ; Tue, 10 Nov 2015 15:20:37 +1100 (AEDT) Received: from localhost by e18.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 9 Nov 2015 23:20:34 -0500 Received: from d01dlp02.pok.ibm.com (9.56.250.167) by e18.ny.us.ibm.com (146.89.104.205) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 9 Nov 2015 23:20:32 -0500 X-IBM-Helo: d01dlp02.pok.ibm.com X-IBM-MailFrom: stewart@linux.vnet.ibm.com X-IBM-RcptTo: skiboot@lists.ozlabs.org Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id 0A4C56E8054 for ; Mon, 9 Nov 2015 23:08:42 -0500 (EST) Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id tAA4KVnh59113658 for ; Tue, 10 Nov 2015 04:20:31 GMT Received: from d01av03.pok.ibm.com (localhost [127.0.0.1]) by d01av03.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id tAA4KUph020770 for ; Mon, 9 Nov 2015 23:20:31 -0500 Received: from oc8180480414.ibm.com ([9.81.198.226]) by d01av03.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with SMTP id tAA4KJYu019962; Mon, 9 Nov 2015 23:20:29 -0500 Received: from ka1.ozlabs.ibm.com (localhost [127.0.0.1]) by oc8180480414.ibm.com (Postfix) with ESMTP id 48E555768; Tue, 10 Nov 2015 15:20:11 +1100 (AEDT) From: Stewart Smith To: skiboot@lists.ozlabs.org Date: Tue, 10 Nov 2015 15:18:17 +1100 Message-Id: <1447129110-21600-24-git-send-email-stewart@linux.vnet.ibm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1447129110-21600-1-git-send-email-stewart@linux.vnet.ibm.com> References: <1447129110-21600-1-git-send-email-stewart@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15111004-0045-0000-0000-00000245F4F3 Subject: [Skiboot] [PATCH 23/36] sparse: fix beintXX_t degrades to integer warnings in hdata/iohub.c X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" No generated code change due to skiboot being BE hdata/iohub.c:49:9: warning: restricted beint64_t degrades to integer hdata/iohub.c:49:9: warning: restricted beint64_t degrades to integer hdata/iohub.c:49:9: warning: restricted beint64_t degrades to integer hdata/iohub.c:49:9: warning: restricted beint64_t degrades to integer hdata/iohub.c:51:9: warning: restricted beint64_t degrades to integer hdata/iohub.c:51:9: warning: restricted beint64_t degrades to integer hdata/iohub.c:51:9: warning: restricted beint64_t degrades to integer hdata/iohub.c:51:9: warning: restricted beint64_t degrades to integer hdata/iohub.c:209:16: warning: restricted beint32_t degrades to integer hdata/iohub.c:356:19: warning: restricted beint32_t degrades to integer hdata/iohub.c:490:19: warning: restricted beint32_t degrades to integer hdata/iohub.c:536:21: warning: restricted beint64_t degrades to integer hdata/iohub.c:554:9: warning: restricted beint32_t degrades to integer hdata/iohub.c:554:9: warning: restricted beint32_t degrades to integer Signed-off-by: Stewart Smith --- hdata/iohub.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/hdata/iohub.c b/hdata/iohub.c index 1c69f630fd38..42b1fafec56b 100644 --- a/hdata/iohub.c +++ b/hdata/iohub.c @@ -47,9 +47,9 @@ static void io_add_common(struct dt_node *hn, const struct cechub_io_hub *hub) */ dt_add_property(hn, "ranges", NULL, 0); dt_add_property_cells(hn, "ibm,gx-bar-1", - hi32(hub->gx_ctrl_bar1), lo32(hub->gx_ctrl_bar1)); + hi32(be64_to_cpu(hub->gx_ctrl_bar1)), lo32(be64_to_cpu(hub->gx_ctrl_bar1))); dt_add_property_cells(hn, "ibm,gx-bar-2", - hi32(hub->gx_ctrl_bar2), lo32(hub->gx_ctrl_bar2)); + hi32(be64_to_cpu(hub->gx_ctrl_bar2)), lo32(be64_to_cpu(hub->gx_ctrl_bar2))); /* Add presence detect if valid */ if (hub->flags & CECHUB_HUB_FLAG_FAB_BR0_PDT) @@ -206,8 +206,8 @@ static struct dt_node *io_add_p7ioc(const struct cechub_io_hub *hub, be64_to_cpu(hub->gx_ctrl_bar4)); /* We only know about memory map 1 */ - if (hub->mem_map_vers != 1) { - prerror("P7IOC: Unknown memory map %d\n", hub->mem_map_vers); + if (be32_to_cpu(hub->mem_map_vers) != 1) { + prerror("P7IOC: Unknown memory map %d\n", be32_to_cpu(hub->mem_map_vers)); /* We try to continue anyway ... */ } @@ -353,7 +353,7 @@ static void io_add_p8_cec_vpd(const struct HDIF_common_hdr *sp_iohubs) prlog(PR_WARNING, "CEC: IOKID count is 0 !\n"); return; } - if (iokids->count > 1) { + if (be32_to_cpu(iokids->count) > 1) { prlog(PR_WARNING, "CEC: WARNING ! More than 1 IO KID !!! (%d)\n", iokids->count); /* Ignoring the additional ones */ @@ -487,7 +487,7 @@ static struct dt_node *io_add_hea(const struct cechub_io_hub *hub, prerror("HEA: IOKID count is 0 !\n"); return NULL; } - if (iokids->count > 1) { + if (be32_to_cpu(iokids->count) > 1) { prlog(PR_WARNING, "HEA: WARNING ! More than 1 IO KID !!! (%d)\n", iokids->count); } @@ -533,7 +533,7 @@ static struct dt_node *io_add_hea(const struct cechub_io_hub *hub, } /* Assume base address is BAR3 + 0x4000000000 */ - reg[0] = hub->gx_ctrl_bar3 + 0x4000000000; + reg[0] = be64_to_cpu(hub->gx_ctrl_bar3) + 0x4000000000; reg[1] = 0xc0000000; prlog(PR_DEBUG, "CEC: * Adding HEA to P5IOC2, assuming GBA=0x%llx\n", @@ -552,7 +552,7 @@ static struct dt_node *io_add_hea(const struct cechub_io_hub *hub, /* BUID is base + 0x30 */ dt_add_property(np, "interrupt-controller", NULL, 0); dt_add_property_cells(np, "interrupt-base", - ((hub->buid_ext << 9) | 0x30) << 4); + ((be32_to_cpu(hub->buid_ext) << 9) | 0x30) << 4); dt_add_property_cells(np, "interrupt-max-count", 128); /* Always 2 port groups */