From patchwork Fri Dec 8 16:06:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 10102877 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3F31B60329 for ; Fri, 8 Dec 2017 16:06:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1185B28D4E for ; Fri, 8 Dec 2017 16:06:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0688628DD3; Fri, 8 Dec 2017 16:06:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D4D328D4E for ; Fri, 8 Dec 2017 16:06:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754040AbdLHQGx (ORCPT ); Fri, 8 Dec 2017 11:06:53 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:47433 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753830AbdLHQGw (ORCPT ); Fri, 8 Dec 2017 11:06:52 -0500 Received: by mail.free-electrons.com (Postfix, from userid 110) id 2B2EE20934; Fri, 8 Dec 2017 17:06:51 +0100 (CET) Received: from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id F1A2C2073B; Fri, 8 Dec 2017 17:06:40 +0100 (CET) From: Thomas Petazzoni To: Yoshinori Sato , Rich Felker Cc: linux-sh@vger.kernel.org, Geert Uytterhoeven , Sergei Shtylyov , Thomas Petazzoni Subject: [PATCH] drivers/sh: clk: drop "const" qualifier in I/O read wrappers Date: Fri, 8 Dec 2017 17:06:40 +0100 Message-Id: <20171208160640.13125-1-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 2.14.3 MIME-Version: 1.0 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The r8/r16/r32 wrappers around ioread8/ioread16/ioread32 take "const void __iomem *" pointers, but ioread8/ioread16/ioread32 as defined in don't take const pointers. This causes a warning when building cpg.c: CC net/ipv4/inet_fragment.o drivers/sh/clk/cpg.c: In function ‘r8’: drivers/sh/clk/cpg.c:41:17: warning: passing argument 1 of ‘ioread8’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] return ioread8(addr); ^~~~ In file included from arch/sh/include/asm/io.h:21:0, from include/linux/io.h:25, from drivers/sh/clk/cpg.c:14: include/asm-generic/iomap.h:29:21: note: expected ‘void *’ but argument is of type ‘const void *’ extern unsigned int ioread8(void __iomem *); ^~~~~~~ drivers/sh/clk/cpg.c: In function ‘r16’: drivers/sh/clk/cpg.c:46:18: warning: passing argument 1 of ‘ioread16’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] return ioread16(addr); ^~~~ In file included from arch/sh/include/asm/io.h:21:0, from include/linux/io.h:25, from drivers/sh/clk/cpg.c:14: include/asm-generic/iomap.h:30:21: note: expected ‘void *’ but argument is of type ‘const void *’ extern unsigned int ioread16(void __iomem *); ^~~~~~~~ drivers/sh/clk/cpg.c: In function ‘r32’: drivers/sh/clk/cpg.c:51:18: warning: passing argument 1 of ‘ioread32’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] return ioread32(addr); ^~~~ In file included from arch/sh/include/asm/io.h:21:0, from include/linux/io.h:25, from drivers/sh/clk/cpg.c:14: include/asm-generic/iomap.h:32:21: note: expected ‘void *’ but argument is of type ‘const void *’ extern unsigned int ioread32(void __iomem *); To fix this, we simply drop the const qualifiers in the definitions of r8/r16/r32. Changing the prototypes of ioread8/ioread16/ioread32 would be a much bigger adventure. Signed-off-by: Thomas Petazzoni --- drivers/sh/clk/cpg.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/sh/clk/cpg.c b/drivers/sh/clk/cpg.c index 7442bc130055..87de622a0767 100644 --- a/drivers/sh/clk/cpg.c +++ b/drivers/sh/clk/cpg.c @@ -36,17 +36,17 @@ static void sh_clk_write(int value, struct clk *clk) iowrite32(value, clk->mapped_reg); } -static unsigned int r8(const void __iomem *addr) +static unsigned int r8(void __iomem *addr) { return ioread8(addr); } -static unsigned int r16(const void __iomem *addr) +static unsigned int r16(void __iomem *addr) { return ioread16(addr); } -static unsigned int r32(const void __iomem *addr) +static unsigned int r32(void __iomem *addr) { return ioread32(addr); } @@ -55,7 +55,7 @@ static int sh_clk_mstp_enable(struct clk *clk) { sh_clk_write(sh_clk_read(clk) & ~(1 << clk->enable_bit), clk); if (clk->status_reg) { - unsigned int (*read)(const void __iomem *addr); + unsigned int (*read)(void __iomem *addr); int i; void __iomem *mapped_status = (phys_addr_t)clk->status_reg - (phys_addr_t)clk->enable_reg + clk->mapped_reg;