Received: by 10.223.164.202 with SMTP id h10csp101905wrb; Wed, 29 Nov 2017 17:57:17 -0800 (PST) X-Google-Smtp-Source: AGs4zMaT89laq3awDMcQ+qPVcqOEHKGwi+dlfcjVCinRLs3nXz+7/OkdO1wHteYoaWLl/6hvCgQJ X-Received: by 10.98.31.142 with SMTP id l14mr4988495pfj.62.1512007037144; Wed, 29 Nov 2017 17:57:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512007037; cv=none; d=google.com; s=arc-20160816; b=A7AqqhSC8IX7QRyKkP49Te7MsiTn/EihNnZVj8XKXnSFkpM7ngH2Oa4yLeE8CZQYr5 c7wfVYBygl/QXKVwsHyZ5mT0gbaCl22JPjAwS5wgFYw6d5H1kRpVle6UY69mDrmXDeu9 bm6cAi14UL5iUSr2Lr0qcjP0D6yQOMqaK+/pvZ53teEAaDa3GT15w8sLRljqjZn9O4Fd xdMMrca8E1CWaBj6Pkwfc+oq8i/Rk8SZI7AYDaGutPzFTzBphgkw8d6ePosJTfLBdplv sZ1Kd15tgdVktpy7tDYvnqAc7k5/hY9L+bd8u8p8jwMKq/3qfT9IQLJ/JpoJdSvMvWJ0 xHKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=wB11Ev8eW9RB3nLFS3Wf4p4HvCizUCKRcNMQS2qNxfU=; b=NrtUR6RgApoGJlG1mJwdm3KqykWL8Q9r+tVQlXsWvYDYDCs5eDXvoIOfflokqwWl9m jALZLPdQXKaa4d77t22gt+lA3wZEdXONzaARVsGZaMd54E5v1WACa6NDOSN6afq8jJTT WkDoYdeM4ghzCEIaoET7GhF/Jr4Pwb/ff8xytW5QloQbG55cH7SVN+qV3ox3gzuQAcOb RxOuxVVyouw++0F6dG1PFsxgbydf9lLSv/igeIjm0R2Y0kunPE+kOsiF21iBq/ASzcMS iKV/z5toxghq3Qgo/CS9FdmQMSsAJSCdx3aysZXdIfJNAKb71Rg3xtGPo+va9VRIy/5l HSsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lixom-net.20150623.gappssmtp.com header.s=20150623 header.b=eMepD3Ld; 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 g5si2128226pgq.725.2017.11.29.17.57.03; Wed, 29 Nov 2017 17:57:17 -0800 (PST) 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; dkim=pass header.i=@lixom-net.20150623.gappssmtp.com header.s=20150623 header.b=eMepD3Ld; 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 S1753542AbdK3Bzr (ORCPT + 99 others); Wed, 29 Nov 2017 20:55:47 -0500 Received: from mail-pl0-f68.google.com ([209.85.160.68]:34383 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753125AbdK3Bzp (ORCPT ); Wed, 29 Nov 2017 20:55:45 -0500 Received: by mail-pl0-f68.google.com with SMTP id d21so3270336pll.1 for ; Wed, 29 Nov 2017 17:55:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lixom-net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=wB11Ev8eW9RB3nLFS3Wf4p4HvCizUCKRcNMQS2qNxfU=; b=eMepD3LdkQIQrIH4Fov0USutuwRMajlp2MbPISwYUpup2rw0oapKfbAm8bXnpQMKfs UYRpGAVCCb5mwQ5D1FL8P5f4jiSJjudelK9KW5LG+Qva/jBElEIjKuTLbMnlNUAlbolS 1uHIPcAQ83A/Ewmqhu66pjn4gT5DZk6L74oFxQXOyKOjjLODeIqo6hc528SHfqTe+6LV vQc9tRjd7S8DNiEyisAJadMfX7MPEBQmbv7ViElBc5bStcOA+XIb53fR4u0F3b16CSVS 7u8Le54E4BNlbN0SMsUMxvhBJNcumgpIPvLRUUuHZzja7NIJ6A9d6MlBaBl6FYNzjPDE BkjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=wB11Ev8eW9RB3nLFS3Wf4p4HvCizUCKRcNMQS2qNxfU=; b=R2PXgE3GegwAJPtzZKCj0MBXdETQHG4l3x4exH8H5UeeC6PBTyF/WDqX1YPq0YpZaX xDniuEdNCWVPd1l1OGONyWMYzA5g+Cn4YwzSeNIZm/1W2ATXfhi6pklTjTfm/wzFOt5S eLeyhrPaHacIHHtwahc8RxM4NyUnOlxwa7QumDhDa0iRg/jk+7o264g2ZfiwoYoUgqNK m2TePSFVHIJOnzTql7XkcMCdrmcgCaC82SV8FlwOjCckoP0iekVhnyUW7nUBPoE/YeaG 2+V8O+l3ML8lCPjGZ74DTgAjDA6g/tt4/dUH+utTbwOSPpfnrJ4LM9RTguFaeKkfor8x ydjg== X-Gm-Message-State: AJaThX6Apd8DMIo6FBVgZ8MQU4jq+vvqoI98yNWgmQ9qpLXkL8BLv8XS b7vVtoiUsQYX9TzDFvf7AVnc4A== X-Received: by 10.84.218.72 with SMTP id f8mr897651plm.143.1512006944804; Wed, 29 Nov 2017 17:55:44 -0800 (PST) Received: from brutus.lixom.net (173-13-129-225-sfba.hfc.comcastbusiness.net. [173.13.129.225]) by smtp.gmail.com with ESMTPSA id l80sm5178177pfb.124.2017.11.29.17.55.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Nov 2017 17:55:43 -0800 (PST) From: Olof Johansson To: Palmer Dabbelt Cc: Albert Ou , patches@groups.riscv.org, linux-kernel@vger.kernel.org, Olof Johansson Subject: [PATCH 03/10] RISC-V: io.h: type fixes for warnings Date: Wed, 29 Nov 2017 17:55:14 -0800 Message-Id: <20171130015521.1289-4-olof@lixom.net> X-Mailer: git-send-email 2.8.6 In-Reply-To: <20171130015521.1289-1-olof@lixom.net> References: <20171130015521.1289-1-olof@lixom.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org include for __iomem definition. Also, add volatile to iounmap() like other architectures have it to avoid "discarding volatile" warnings from some drivers. Finally, explicitly promote the base address for INB/OUTB functions to avoid some old legacy drivers complaining about int-to-ptr promotions. The drivers are unlikely to work but they're included in allmodconfig so the warnings are noisy. Fixes, among other warnings, these with allmodconfig: ../arch/riscv/include/asm/io.h:24:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token extern void __iomem *ioremap(phys_addr_t offset, unsigned long size); sound/pci/echoaudio/echoaudio.c: In function 'snd_echo_free': sound/pci/echoaudio/echoaudio.c:1879:10: warning: passing argument 1 of 'iounmap' discards 'volatile' qualifier from pointer target type [-Wdiscarded-qualifiers] Signed-off-by: Olof Johansson --- arch/riscv/include/asm/io.h | 16 +++++++++------- arch/riscv/mm/ioremap.c | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/arch/riscv/include/asm/io.h b/arch/riscv/include/asm/io.h index c1f32cf..2a5c7c3 100644 --- a/arch/riscv/include/asm/io.h +++ b/arch/riscv/include/asm/io.h @@ -19,6 +19,8 @@ #ifndef _ASM_RISCV_IO_H #define _ASM_RISCV_IO_H +#include + #ifdef CONFIG_MMU extern void __iomem *ioremap(phys_addr_t offset, unsigned long size); @@ -32,7 +34,7 @@ extern void __iomem *ioremap(phys_addr_t offset, unsigned long size); #define ioremap_wc(addr, size) ioremap((addr), (size)) #define ioremap_wt(addr, size) ioremap((addr), (size)) -extern void iounmap(void __iomem *addr); +extern void iounmap(volatile void __iomem *addr); #endif /* CONFIG_MMU */ @@ -266,9 +268,9 @@ __io_reads_ins(reads, u32, l, __io_br(), __io_ar()) __io_reads_ins(ins, u8, b, __io_pbr(), __io_par()) __io_reads_ins(ins, u16, w, __io_pbr(), __io_par()) __io_reads_ins(ins, u32, l, __io_pbr(), __io_par()) -#define insb(addr, buffer, count) __insb((void __iomem *)addr, buffer, count) -#define insw(addr, buffer, count) __insw((void __iomem *)addr, buffer, count) -#define insl(addr, buffer, count) __insl((void __iomem *)addr, buffer, count) +#define insb(addr, buffer, count) __insb((void __iomem *)(long)addr, buffer, count) +#define insw(addr, buffer, count) __insw((void __iomem *)(long)addr, buffer, count) +#define insl(addr, buffer, count) __insl((void __iomem *)(long)addr, buffer, count) __io_writes_outs(writes, u8, b, __io_bw(), __io_aw()) __io_writes_outs(writes, u16, w, __io_bw(), __io_aw()) @@ -280,9 +282,9 @@ __io_writes_outs(writes, u32, l, __io_bw(), __io_aw()) __io_writes_outs(outs, u8, b, __io_pbw(), __io_paw()) __io_writes_outs(outs, u16, w, __io_pbw(), __io_paw()) __io_writes_outs(outs, u32, l, __io_pbw(), __io_paw()) -#define outsb(addr, buffer, count) __outsb((void __iomem *)addr, buffer, count) -#define outsw(addr, buffer, count) __outsw((void __iomem *)addr, buffer, count) -#define outsl(addr, buffer, count) __outsl((void __iomem *)addr, buffer, count) +#define outsb(addr, buffer, count) __outsb((void __iomem *)(long)addr, buffer, count) +#define outsw(addr, buffer, count) __outsw((void __iomem *)(long)addr, buffer, count) +#define outsl(addr, buffer, count) __outsl((void __iomem *)(long)addr, buffer, count) #ifdef CONFIG_64BIT __io_reads_ins(reads, u64, q, __io_br(), __io_ar()) diff --git a/arch/riscv/mm/ioremap.c b/arch/riscv/mm/ioremap.c index e99194a4..70ef272 100644 --- a/arch/riscv/mm/ioremap.c +++ b/arch/riscv/mm/ioremap.c @@ -85,7 +85,7 @@ EXPORT_SYMBOL(ioremap); * * Caller must ensure there is only one unmapping for the same pointer. */ -void iounmap(void __iomem *addr) +void iounmap(volatile void __iomem *addr) { vunmap((void *)((unsigned long)addr & PAGE_MASK)); } -- 2.8.6 From 1584733591270948090@xxx Wed Nov 22 03:02:04 +0000 2017 X-GM-THRID: 1584731315408560617 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread