From patchwork Tue Nov 10 04:18:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stewart Smith X-Patchwork-Id: 542162 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 0C3F414017E for ; Tue, 10 Nov 2015 15:22:28 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id C9B8D1A0C4E for ; Tue, 10 Nov 2015 15:22:27 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.150]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id B5DB81A0479 for ; Tue, 10 Nov 2015 15:20:43 +1100 (AEDT) Received: from localhost by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 9 Nov 2015 21:20:41 -0700 Received: from d03dlp01.boulder.ibm.com (9.17.202.177) by e32.co.us.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 9 Nov 2015 21:20:40 -0700 X-IBM-Helo: d03dlp01.boulder.ibm.com X-IBM-MailFrom: stewart@linux.vnet.ibm.com X-IBM-RcptTo: skiboot@lists.ozlabs.org Received: from b03cxnp08028.gho.boulder.ibm.com (b03cxnp08028.gho.boulder.ibm.com [9.17.130.20]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id E88491FF0041 for ; Mon, 9 Nov 2015 21:08:51 -0700 (MST) Received: from d03av05.boulder.ibm.com (d03av05.boulder.ibm.com [9.17.195.85]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id tAA4JDdX8978830 for ; Mon, 9 Nov 2015 21:19:13 -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 tAA4Kefs004586 for ; Mon, 9 Nov 2015 21:20:40 -0700 Received: from oc8180480414.ibm.com ([9.81.198.226]) by d03av05.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with SMTP id tAA4KT73003943; Mon, 9 Nov 2015 21:20:39 -0700 Received: from ka1.ozlabs.ibm.com (localhost [127.0.0.1]) by oc8180480414.ibm.com (Postfix) with ESMTP id C02CA5770; Tue, 10 Nov 2015 15:20:15 +1100 (AEDT) From: Stewart Smith To: skiboot@lists.ozlabs.org Date: Tue, 10 Nov 2015 15:18:25 +1100 Message-Id: <1447129110-21600-32-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-0005-0000-0000-000019B088EA Subject: [Skiboot] [PATCH 31/36] sparse: fix endian conversions in hw/occ.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" Since skiboot is all BE, this doesn't make a difference in code generated. It does silence the following sparse warnings though: hw/occ.c:354:38: warning: incorrect type in assignment (different base types) hw/occ.c:354:38: expected restricted beint64_t [usertype] type hw/occ.c:354:38: got int hw/occ.c:370:46: warning: incorrect type in assignment (different base types) hw/occ.c:370:46: expected restricted beint64_t [addressable] [assigned] [usertype] type hw/occ.c:370:46: got int hw/occ.c:371:46: warning: incorrect type in assignment (different base types) hw/occ.c:371:46: expected restricted beint64_t [addressable] [assigned] [usertype] chip hw/occ.c:371:46: got unsigned int [unsigned] [usertype] id hw/occ.c:372:57: warning: incorrect type in assignment (different base types) hw/occ.c:372:57: expected restricted beint64_t [addressable] [assigned] [usertype] throttle_status hw/occ.c:372:57: got unsigned char [unsigned] [usertype] throttle hw/occ.c:477:49: warning: incorrect type in initializer (different base types) hw/occ.c:477:49: expected restricted beint64_t [usertype] type hw/occ.c:477:49: got int Signed-off-by: Stewart Smith --- hw/occ.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/occ.c b/hw/occ.c index 710d8d400091..9c696db68a96 100644 --- a/hw/occ.c +++ b/hw/occ.c @@ -351,7 +351,7 @@ static void occ_throttle_poll(void *data __unused) * Queue OCC_THROTTLE with throttle status as 0 to * indicate all OCCs are active after a reset. */ - occ_msg.type = OCC_THROTTLE; + occ_msg.type = cpu_to_be64(OCC_THROTTLE); occ_msg.chip = 0; occ_msg.throttle_status = 0; rc = _opal_queue_msg(OPAL_MSG_OCC, NULL, NULL, 3, @@ -367,9 +367,9 @@ static void occ_throttle_poll(void *data __unused) if ((occ_data->valid == 1) && (chip->throttle != occ_data->throttle) && (occ_data->throttle <= OCC_MAX_THROTTLE_STATUS)) { - occ_msg.type = OCC_THROTTLE; - occ_msg.chip = chip->id; - occ_msg.throttle_status = occ_data->throttle; + occ_msg.type = cpu_to_be64(OCC_THROTTLE); + occ_msg.chip = cpu_to_be64(chip->id); + occ_msg.throttle_status = cpu_to_be64(occ_data->throttle); rc = _opal_queue_msg(OPAL_MSG_OCC, NULL, occ_msg_consumed, 3, (uint64_t *)&occ_msg); @@ -474,7 +474,7 @@ static void __occ_do_load(u8 scope, u32 dbob_id __unused, u32 seq_id) prlog(PR_INFO, "OCC: Load: Fallback to preloaded image\n"); rc = 0; } else if (!rc) { - struct opal_occ_msg occ_msg = { OCC_LOAD, 0, 0 }; + struct opal_occ_msg occ_msg = { CPU_TO_BE64(OCC_LOAD), 0, 0 }; rc = _opal_queue_msg(OPAL_MSG_OCC, NULL, NULL, 3, (uint64_t *)&occ_msg);