From patchwork Thu Jan 21 03:51:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stewart Smith X-Patchwork-Id: 571035 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 2B85014010F for ; Thu, 21 Jan 2016 14:52:51 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 11C231A18F3 for ; Thu, 21 Jan 2016 14:52:51 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.149]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 7A4921A1913 for ; Thu, 21 Jan 2016 14:52:01 +1100 (AEDT) Received: from localhost by e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 20 Jan 2016 20:51:59 -0700 Received: from d03dlp03.boulder.ibm.com (9.17.202.179) by e31.co.us.ibm.com (192.168.1.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 20 Jan 2016 20:51:44 -0700 X-IBM-Helo: d03dlp03.boulder.ibm.com X-IBM-MailFrom: stewart@linux.vnet.ibm.com X-IBM-RcptTo: skiboot@lists.ozlabs.org Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id 172D019D8041 for ; Wed, 20 Jan 2016 20:39:45 -0700 (MST) Received: from d03av05.boulder.ibm.com (d03av05.boulder.ibm.com [9.17.195.85]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u0L3piK222151204 for ; Wed, 20 Jan 2016 20:51:44 -0700 Received: from d03av05.boulder.ibm.com (localhost [127.0.0.1]) by d03av05.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u0L3pgcm019261 for ; Wed, 20 Jan 2016 20:51:43 -0700 Received: from birb.localdomain (birb.au.ibm.com [9.185.120.228] (may be forged)) by d03av05.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u0L3paF2018969; Wed, 20 Jan 2016 20:51:42 -0700 Received: from ka1.ozlabs.ibm.com (localhost.localdomain [127.0.0.1]) by birb.localdomain (Postfix) with ESMTP id 021D522B7D03; Thu, 21 Jan 2016 14:51:25 +1100 (AEDT) From: Stewart Smith To: skiboot@lists.ozlabs.org Date: Thu, 21 Jan 2016 14:51:15 +1100 Message-Id: <1453348281-16085-9-git-send-email-stewart@linux.vnet.ibm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1453348281-16085-1-git-send-email-stewart@linux.vnet.ibm.com> References: <1453348281-16085-1-git-send-email-stewart@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16012103-8236-0000-0000-0000155FEA97 Subject: [Skiboot] [PATCH stable 08/14] sparse: fix endian conversions 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" commit d6e3293cb1d794bf118aab334bb250ed12236956 upstream Since skiboot is all BE and hdat is BE, this changes nothing except for silencing the sparse warnings hdata/iohub.c:35:9: warning: incorrect type in initializer (different base types) hdata/iohub.c:35:9: expected unsigned int hdata/iohub.c:35:9: got restricted beint32_t const [usertype] buid_ext hdata/iohub.c:36:9: warning: incorrect type in argument 1 (different base types) hdata/iohub.c:36:9: expected unsigned int [unsigned] [usertype] proc_chip_id hdata/iohub.c:36:9: got restricted beint32_t const [usertype] proc_chip_id hdata/iohub.c:36:9: warning: incorrect type in argument 1 (different base types) hdata/iohub.c:36:9: expected unsigned int [unsigned] [usertype] proc_chip_id hdata/iohub.c:36:9: got restricted beint32_t const [usertype] proc_chip_id hdata/iohub.c:38:9: warning: incorrect type in initializer (different base types) hdata/iohub.c:38:9: expected unsigned int hdata/iohub.c:38:9: got restricted beint32_t const [usertype] gx_index hdata/iohub.c:39:9: warning: incorrect type in initializer (different base types) hdata/iohub.c:39:9: expected unsigned int hdata/iohub.c:39:9: got restricted beint32_t const [usertype] ec_level hdata/iohub.c:114:63: warning: incorrect type in argument 1 (different base types) hdata/iohub.c:114:63: expected unsigned short [unsigned] [usertype] slca_index hdata/iohub.c:114:63: got restricted beint16_t const [usertype] slca_index hdata/iohub.c:634:17: warning: incorrect type in argument 1 (different base types) hdata/iohub.c:634:17: expected restricted beint32_t [usertype] be_val hdata/iohub.c:634:17: got restricted beint16_t const [usertype] hub_num hdata/iohub.c:708:22: warning: incorrect type in assignment (different base types) hdata/iohub.c:708:22: expected unsigned int [unsigned] type hdata/iohub.c:708:22: got restricted beint32_t const [usertype] card_type Signed-off-by: Stewart Smith --- hdata/iohub.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hdata/iohub.c b/hdata/iohub.c index 44ebded17e57..7dae74cf674e 100644 --- a/hdata/iohub.c +++ b/hdata/iohub.c @@ -33,11 +33,11 @@ static void io_add_common(struct dt_node *hn, const struct cechub_io_hub *hub) { dt_add_property_cells(hn, "#address-cells", 2); dt_add_property_cells(hn, "#size-cells", 2); - dt_add_property_cells(hn, "ibm,buid-ext", hub->buid_ext); + dt_add_property_cells(hn, "ibm,buid-ext", be32_to_cpu(hub->buid_ext)); dt_add_property_cells(hn, "ibm,chip-id", - pcid_to_chip_id(hub->proc_chip_id)); - dt_add_property_cells(hn, "ibm,gx-index", hub->gx_index); - dt_add_property_cells(hn, "revision", hub->ec_level); + pcid_to_chip_id(be32_to_cpu(hub->proc_chip_id))); + dt_add_property_cells(hn, "ibm,gx-index", be32_to_cpu(hub->gx_index)); + dt_add_property_cells(hn, "revision", be32_to_cpu(hub->ec_level)); /* Instead of exposing the GX BARs as separate ranges as we *should* * do in an ideal world, we just create a pass-through ranges and @@ -112,7 +112,7 @@ static void io_get_loc_code(const void *sp_iohubs, struct dt_node *hn, const cha memset(loc_code, 0, sizeof(loc_code)); /* Find LOC Code from SLCA Index */ - slca_loc_code = slca_get_loc_code_index(fru_id->slca_index); + slca_loc_code = slca_get_loc_code_index(be16_to_cpu(fru_id->slca_index)); if (slca_loc_code) { strncpy(loc_code, slca_loc_code, LOC_CODE_SIZE); if (!dt_has_node_property(hn, prop_name, NULL)) { @@ -635,7 +635,7 @@ static void io_parse_fru(const void *sp_iohubs) prlog(PR_DEBUG, "CEC: PChip: %d HUB ID: %04x [EC=0x%x]" " Hub#=%d)\n", be32_to_cpu(hub->proc_chip_id), hub_id, - be32_to_cpu(hub->ec_level), be32_to_cpu(hub->hub_num)); + be32_to_cpu(hub->ec_level), be16_to_cpu(hub->hub_num)); switch(hub_id) { case CECHUB_HUB_P7IOC: @@ -706,7 +706,7 @@ void io_parse(void) prerror("CEC: IO-HUB FRU %d, bad ID data\n", i); continue; } - type = fru_id_data->card_type; + type = be32_to_cpu(fru_id_data->card_type); prlog(PR_INFO, "CEC: HUB FRU %d is %s\n", i, type > 4 ? "Unknown" : typestr[type]);