From patchwork Mon Oct 28 12:10:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 177908 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3305543ill; Mon, 28 Oct 2019 05:13:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqxyY8CLmXGVbvy8niwVvBBeft9EWqj1Em+GLFYa51VBx+sFy4oKxcgR6op/iji8arngZ8LY X-Received: by 2002:a17:906:22c8:: with SMTP id q8mr16128571eja.19.1572264811494; Mon, 28 Oct 2019 05:13:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572264811; cv=none; d=google.com; s=arc-20160816; b=ElN6gHRYwgoXVI3TOulSAL5rmg1AUE1toRRQ2sb9/9FdlHvOP9ED9EJjrZ6lI0ITTH 4YPoNF89M2o3GCmM4DIRM/urm8+wOBRBtptIGA9Hmu+SICpzi2YMjrbmIS8f8fRhje9Y ELDhAdTmrmsGy7FThddIzXEeg6D6gh3A4zf25ni/PC4t17tMp3Tjj4lT/D2XEDUmShj6 Dn477QqSCXpszMUIg65xVOKR3BmTFy112aPOVIUcD/BGJgf/M/aLRrFze61WCsilqK4m UKre4TfHZ9ht35G+PMFanEAskypB6TkT43HAX4ZImUAB6jFJMuRF1Zw3URuHETHwsemF Tnbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=1NOYylUOkHzzGL4Uue6Mxpnd2d3WCuxLQ7Rjp8YOuII=; b=yAPuoUMMcJMo+51l+QSJCHMmmpo8IyOK1SUFsFgRaKdduCp5Z1y3UxCNQWrWi5ExL2 yAfOBslarwTOdaRh6EVwAKVL26bP5nDsRhnDXtciVLK+JUOdYKN5RQS39Qt7FKKzktfX Slr/tjETvQR0ZdYogzXkvvMDc+ze/4z1D9DjxpVwTfeN+2X+TVrtvOfVQMd3bXF0f4up Pq28WKMpFOl9Xz9bqVwJSQ5GYyUKcitZolBRDAOUrdSoYLpYzTyeJ60CKEWmrOo9wNp9 +YvPm6vfcBZakMZ3eX7NLjLOYUj3+kOJ6BPwYq/ZqOy8DD5yo+7X0trTP/YbMTKHbNyS 9skQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b50si7315256ede.28.2019.10.28.05.13.31; Mon, 28 Oct 2019 05:13:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728654AbfJ1MN0 (ORCPT + 26 others); Mon, 28 Oct 2019 08:13:26 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:37048 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728536AbfJ1MNT (ORCPT ); Mon, 28 Oct 2019 08:13:19 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id DA576D0D9DB9D6B6062C; Mon, 28 Oct 2019 20:13:14 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.439.0; Mon, 28 Oct 2019 20:13:06 +0800 From: John Garry To: CC: , , , , , John Garry Subject: [PATCH v2 3/5] bus: hisi_lpc: Clean some types Date: Mon, 28 Oct 2019 20:10:03 +0800 Message-ID: <1572264605-172363-4-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1572264605-172363-1-git-send-email-john.garry@huawei.com> References: <1572264605-172363-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sparse complains of these: drivers/bus/hisi_lpc.c:82:38: warning: incorrect type in argument 1 (different address spaces) drivers/bus/hisi_lpc.c:82:38: expected void const volatile [noderef] *addr drivers/bus/hisi_lpc.c:82:38: got unsigned char * drivers/bus/hisi_lpc.c:131:35: warning: incorrect type in argument 1 (different address spaces) drivers/bus/hisi_lpc.c:131:35: expected unsigned char *mbase drivers/bus/hisi_lpc.c:131:35: got void [noderef] *membase drivers/bus/hisi_lpc.c:186:35: warning: incorrect type in argument 1 (different address spaces) drivers/bus/hisi_lpc.c:186:35: expected unsigned char *mbase drivers/bus/hisi_lpc.c:186:35: got void [noderef] *membase drivers/bus/hisi_lpc.c:228:16: warning: cast to restricted __le32 drivers/bus/hisi_lpc.c:251:13: warning: incorrect type in assignment (different base types) drivers/bus/hisi_lpc.c:251:13: expected unsigned int [unsigned] [usertype] val drivers/bus/hisi_lpc.c:251:13: got restricted __le32 [usertype] Clean them up. Signed-off-by: John Garry --- drivers/bus/hisi_lpc.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) -- 2.17.1 diff --git a/drivers/bus/hisi_lpc.c b/drivers/bus/hisi_lpc.c index 20c957185af2..8101df901830 100644 --- a/drivers/bus/hisi_lpc.c +++ b/drivers/bus/hisi_lpc.c @@ -74,7 +74,7 @@ struct hisi_lpc_dev { /* About 10us. This is specific for single IO operations, such as inb */ #define LPC_PEROP_WAITCNT 100 -static int wait_lpc_idle(unsigned char *mbase, unsigned int waitcnt) +static int wait_lpc_idle(void __iomem *mbase, unsigned int waitcnt) { u32 status; @@ -209,7 +209,7 @@ static u32 hisi_lpc_comm_in(void *hostdata, unsigned long pio, size_t dwidth) struct hisi_lpc_dev *lpcdev = hostdata; struct lpc_cycle_para iopara; unsigned long addr; - u32 rd_data = 0; + __le32 rd_data = 0; int ret; if (!lpcdev || !dwidth || dwidth > LPC_MAX_DWIDTH) @@ -244,13 +244,12 @@ static void hisi_lpc_comm_out(void *hostdata, unsigned long pio, struct lpc_cycle_para iopara; const unsigned char *buf; unsigned long addr; + __le32 _val = cpu_to_le32(val); if (!lpcdev || !dwidth || dwidth > LPC_MAX_DWIDTH) return; - val = cpu_to_le32(val); - - buf = (const unsigned char *)&val; + buf = (const unsigned char *)&_val; addr = hisi_lpc_pio_to_addr(lpcdev, pio); iopara.opflags = FG_INCRADDR_LPC;