From patchwork Tue Jan 7 16:52:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 216724 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7D2BC33C9E for ; Tue, 7 Jan 2020 16:53:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 850F92073D for ; Tue, 7 Jan 2020 16:53:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578416023; bh=PNN7dlJTmEky+NUaaDTzRSu4j6j/ysVCFrpoVxYBApA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=BP7oAGniQ8RWSso6+1KINfQH8T9rmtyV3ba0obKbr3iYQ3ogylVjO9Sl+uIrAoH7f QA0e+fLXRNHhSTUnRor4fHISIixtlfS1lkjQBxmhI+t+9Dkx681+BgtoYAR36h/iqC pSzDN5yi4ArauHT15Jsiik5z1zjUPQutGOqf1l/8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728495AbgAGQxk (ORCPT ); Tue, 7 Jan 2020 11:53:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:40244 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728386AbgAGQxk (ORCPT ); Tue, 7 Jan 2020 11:53:40 -0500 Received: from PC-kkoz.proceq.com (unknown [213.160.61.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AA79D222D9; Tue, 7 Jan 2020 16:53:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578416018; bh=PNN7dlJTmEky+NUaaDTzRSu4j6j/ysVCFrpoVxYBApA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QRU7+8aH01DNd/5WdDLDp7Pbj60ipcsUgpLo+cZ8VajAsfo0Qt4VKM1JujozBqIWl PD+jRlIZn3zE1Vtrsv6uBO54zPRMt8wf0ceqLBjexJiGttZEEvsbe7LzFEiIBPNV76 pazcEjfjZTeBefPXrZ9ULjqekbqneHZyMwsgOJHM= From: Krzysztof Kozlowski To: Richard Henderson , Ivan Kokshaysky , Matt Turner , Alexey Brodkin , Vineet Gupta , "James E.J. Bottomley" , Helge Deller , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Yoshinori Sato , Rich Felker , Dave Airlie , David Airlie , Daniel Vetter , Ben Skeggs , Mauro Carvalho Chehab , Jiri Slaby , Nick Kossifidis , Luis Chamberlain , Kalle Valo , "David S. Miller" , Dave Jiang , Jon Mason , Allen Hubbe , "Michael S. Tsirkin" , Jason Wang , Arnd Bergmann , Andrew Morton , Thomas Gleixner , Geert Uytterhoeven , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-media@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-ntb@googlegroups.com, virtualization@lists.linux-foundation.org, linux-arch@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [RFT 01/13] iomap: Constify ioreadX() iomem argument (as in generic implementation) Date: Tue, 7 Jan 2020 17:52:58 +0100 Message-Id: <1578415992-24054-2-git-send-email-krzk@kernel.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1578415992-24054-1-git-send-email-krzk@kernel.org> References: <1578415992-24054-1-git-send-email-krzk@kernel.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The ioreadX() helpers have inconsistent interface. On some architectures void *__iomem address argument is a pointer to const, on some not. Implementations of ioreadX() do not modify the memory under the address so they can be converted to a "const" version for const-safety and consistency among architectures. Suggested-by: Geert Uytterhoeven Signed-off-by: Krzysztof Kozlowski --- include/asm-generic/iomap.h | 22 +++++++++++----------- include/linux/io-64-nonatomic-hi-lo.h | 4 ++-- include/linux/io-64-nonatomic-lo-hi.h | 4 ++-- lib/iomap.c | 18 +++++++++--------- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/include/asm-generic/iomap.h b/include/asm-generic/iomap.h index 9d28a5e82f73..986e894bef49 100644 --- a/include/asm-generic/iomap.h +++ b/include/asm-generic/iomap.h @@ -26,14 +26,14 @@ * in the low address range. Architectures for which this is not * true can't use this generic implementation. */ -extern unsigned int ioread8(void __iomem *); -extern unsigned int ioread16(void __iomem *); -extern unsigned int ioread16be(void __iomem *); -extern unsigned int ioread32(void __iomem *); -extern unsigned int ioread32be(void __iomem *); +extern unsigned int ioread8(const void __iomem *); +extern unsigned int ioread16(const void __iomem *); +extern unsigned int ioread16be(const void __iomem *); +extern unsigned int ioread32(const void __iomem *); +extern unsigned int ioread32be(const void __iomem *); #ifdef CONFIG_64BIT -extern u64 ioread64(void __iomem *); -extern u64 ioread64be(void __iomem *); +extern u64 ioread64(const void __iomem *); +extern u64 ioread64be(const void __iomem *); #endif #ifdef readq @@ -41,10 +41,10 @@ extern u64 ioread64be(void __iomem *); #define ioread64_hi_lo ioread64_hi_lo #define ioread64be_lo_hi ioread64be_lo_hi #define ioread64be_hi_lo ioread64be_hi_lo -extern u64 ioread64_lo_hi(void __iomem *addr); -extern u64 ioread64_hi_lo(void __iomem *addr); -extern u64 ioread64be_lo_hi(void __iomem *addr); -extern u64 ioread64be_hi_lo(void __iomem *addr); +extern u64 ioread64_lo_hi(const void __iomem *addr); +extern u64 ioread64_hi_lo(const void __iomem *addr); +extern u64 ioread64be_lo_hi(const void __iomem *addr); +extern u64 ioread64be_hi_lo(const void __iomem *addr); #endif extern void iowrite8(u8, void __iomem *); diff --git a/include/linux/io-64-nonatomic-hi-lo.h b/include/linux/io-64-nonatomic-hi-lo.h index ae21b72cce85..f32522bb3aa5 100644 --- a/include/linux/io-64-nonatomic-hi-lo.h +++ b/include/linux/io-64-nonatomic-hi-lo.h @@ -57,7 +57,7 @@ static inline void hi_lo_writeq_relaxed(__u64 val, volatile void __iomem *addr) #ifndef ioread64_hi_lo #define ioread64_hi_lo ioread64_hi_lo -static inline u64 ioread64_hi_lo(void __iomem *addr) +static inline u64 ioread64_hi_lo(const void __iomem *addr) { u32 low, high; @@ -79,7 +79,7 @@ static inline void iowrite64_hi_lo(u64 val, void __iomem *addr) #ifndef ioread64be_hi_lo #define ioread64be_hi_lo ioread64be_hi_lo -static inline u64 ioread64be_hi_lo(void __iomem *addr) +static inline u64 ioread64be_hi_lo(const void __iomem *addr) { u32 low, high; diff --git a/include/linux/io-64-nonatomic-lo-hi.h b/include/linux/io-64-nonatomic-lo-hi.h index faaa842dbdb9..448a21435dba 100644 --- a/include/linux/io-64-nonatomic-lo-hi.h +++ b/include/linux/io-64-nonatomic-lo-hi.h @@ -57,7 +57,7 @@ static inline void lo_hi_writeq_relaxed(__u64 val, volatile void __iomem *addr) #ifndef ioread64_lo_hi #define ioread64_lo_hi ioread64_lo_hi -static inline u64 ioread64_lo_hi(void __iomem *addr) +static inline u64 ioread64_lo_hi(const void __iomem *addr) { u32 low, high; @@ -79,7 +79,7 @@ static inline void iowrite64_lo_hi(u64 val, void __iomem *addr) #ifndef ioread64be_lo_hi #define ioread64be_lo_hi ioread64be_lo_hi -static inline u64 ioread64be_lo_hi(void __iomem *addr) +static inline u64 ioread64be_lo_hi(const void __iomem *addr) { u32 low, high; diff --git a/lib/iomap.c b/lib/iomap.c index e909ab71e995..3b10c0ab2cee 100644 --- a/lib/iomap.c +++ b/lib/iomap.c @@ -70,27 +70,27 @@ static void bad_io_access(unsigned long port, const char *access) #define mmio_read64be(addr) swab64(readq(addr)) #endif -unsigned int ioread8(void __iomem *addr) +unsigned int ioread8(const void __iomem *addr) { IO_COND(addr, return inb(port), return readb(addr)); return 0xff; } -unsigned int ioread16(void __iomem *addr) +unsigned int ioread16(const void __iomem *addr) { IO_COND(addr, return inw(port), return readw(addr)); return 0xffff; } -unsigned int ioread16be(void __iomem *addr) +unsigned int ioread16be(const void __iomem *addr) { IO_COND(addr, return pio_read16be(port), return mmio_read16be(addr)); return 0xffff; } -unsigned int ioread32(void __iomem *addr) +unsigned int ioread32(const void __iomem *addr) { IO_COND(addr, return inl(port), return readl(addr)); return 0xffffffff; } -unsigned int ioread32be(void __iomem *addr) +unsigned int ioread32be(const void __iomem *addr) { IO_COND(addr, return pio_read32be(port), return mmio_read32be(addr)); return 0xffffffff; @@ -142,26 +142,26 @@ static u64 pio_read64be_hi_lo(unsigned long port) return lo | (hi << 32); } -u64 ioread64_lo_hi(void __iomem *addr) +u64 ioread64_lo_hi(const void __iomem *addr) { IO_COND(addr, return pio_read64_lo_hi(port), return readq(addr)); return 0xffffffffffffffffULL; } -u64 ioread64_hi_lo(void __iomem *addr) +u64 ioread64_hi_lo(const void __iomem *addr) { IO_COND(addr, return pio_read64_hi_lo(port), return readq(addr)); return 0xffffffffffffffffULL; } -u64 ioread64be_lo_hi(void __iomem *addr) +u64 ioread64be_lo_hi(const void __iomem *addr) { IO_COND(addr, return pio_read64be_lo_hi(port), return mmio_read64be(addr)); return 0xffffffffffffffffULL; } -u64 ioread64be_hi_lo(void __iomem *addr) +u64 ioread64be_hi_lo(const void __iomem *addr) { IO_COND(addr, return pio_read64be_hi_lo(port), return mmio_read64be(addr)); From patchwork Tue Jan 7 16:53:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 216723 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A72FC33C9B for ; Tue, 7 Jan 2020 16:54:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 31921214D8 for ; Tue, 7 Jan 2020 16:54:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578416043; bh=2INYl/WHNT/C7GiSViCA3JtOV1QGzxyGNL6AjXT7Bk0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ovTbDLgGNfodDYpjt+Pp2LLL5dITuwQ2GMWQGlr+4+s/DohLPE/5KFeWqXpEW8dRd SSYN7/UQeHr/OwnvuwSifx+2UbeMTz4rIfgZB0BWyBGWMskZSbT9GssFwUckBJ71mD nHc2ldSNWNBcl5XODJOiNC+1HB320HE7srofVZms= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728543AbgAGQx7 (ORCPT ); Tue, 7 Jan 2020 11:53:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:40876 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728384AbgAGQx6 (ORCPT ); Tue, 7 Jan 2020 11:53:58 -0500 Received: from PC-kkoz.proceq.com (unknown [213.160.61.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E220F24676; Tue, 7 Jan 2020 16:53:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578416037; bh=2INYl/WHNT/C7GiSViCA3JtOV1QGzxyGNL6AjXT7Bk0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gq3wyr2NgXEtKO+rZ9d3tlUDQp9mNuBH1xznjDTPdiazHUzQTTcuCslpJ4TO8EZn7 +R/czV2lgpqBaWY/CPIEd0znmynBhYmhbPvx0+xlduzJJwVMMP5AWcH6D3uGBFkDps 6C6+d1A7zhCNjUy72ijuDhrxWSGbGa5zQUNCUUOM= From: Krzysztof Kozlowski To: Richard Henderson , Ivan Kokshaysky , Matt Turner , Alexey Brodkin , Vineet Gupta , "James E.J. Bottomley" , Helge Deller , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Yoshinori Sato , Rich Felker , Dave Airlie , David Airlie , Daniel Vetter , Ben Skeggs , Mauro Carvalho Chehab , Jiri Slaby , Nick Kossifidis , Luis Chamberlain , Kalle Valo , "David S. Miller" , Dave Jiang , Jon Mason , Allen Hubbe , "Michael S. Tsirkin" , Jason Wang , Arnd Bergmann , Andrew Morton , Thomas Gleixner , Geert Uytterhoeven , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-media@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-ntb@googlegroups.com, virtualization@lists.linux-foundation.org, linux-arch@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [RFT 02/13] sh: Constify ioreadX() iomem argument (as in generic implementation) Date: Tue, 7 Jan 2020 17:53:00 +0100 Message-Id: <1578415992-24054-4-git-send-email-krzk@kernel.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1578415992-24054-1-git-send-email-krzk@kernel.org> References: <1578415992-24054-1-git-send-email-krzk@kernel.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The ioreadX() helpers have inconsistent interface. On some architectures void *__iomem address argument is a pointer to const, on some not. Implementations of ioreadX() do not modify the memory under the address so they can be converted to a "const" version for const-safety and consistency among architectures. Suggested-by: Geert Uytterhoeven Signed-off-by: Krzysztof Kozlowski --- arch/sh/kernel/iomap.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/sh/kernel/iomap.c b/arch/sh/kernel/iomap.c index ef9e2c97cbb7..bd5e212c6ea6 100644 --- a/arch/sh/kernel/iomap.c +++ b/arch/sh/kernel/iomap.c @@ -8,31 +8,31 @@ #include #include -unsigned int ioread8(void __iomem *addr) +unsigned int ioread8(const void __iomem *addr) { return readb(addr); } EXPORT_SYMBOL(ioread8); -unsigned int ioread16(void __iomem *addr) +unsigned int ioread16(const void __iomem *addr) { return readw(addr); } EXPORT_SYMBOL(ioread16); -unsigned int ioread16be(void __iomem *addr) +unsigned int ioread16be(const void __iomem *addr) { return be16_to_cpu(__raw_readw(addr)); } EXPORT_SYMBOL(ioread16be); -unsigned int ioread32(void __iomem *addr) +unsigned int ioread32(const void __iomem *addr) { return readl(addr); } EXPORT_SYMBOL(ioread32); -unsigned int ioread32be(void __iomem *addr) +unsigned int ioread32be(const void __iomem *addr) { return be32_to_cpu(__raw_readl(addr)); } From patchwork Tue Jan 7 16:53:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 216722 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7679EC33C9B for ; Tue, 7 Jan 2020 16:54:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4C417214D8 for ; Tue, 7 Jan 2020 16:54:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578416058; bh=mMrPdoW2NnN8sMcsihZhEQMDfMhuUP76fLnSnvAwL0c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=V/+kmABHiAyEk7MmEH/gpGdVMdRmZ50IfVv9XYO9HFZU2SDvsDT/uJEQBgHPcUQTJ zWZdol0zMPrkACO8Vsv+zE1XEVklVrY6Po5w8UShkU/AtLcYLA2NMb2Cu6lTpbCjpj txTDUeFh5ytT9NAW3IZluAbd9iFUbiogMRiRPLBI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728588AbgAGQyS (ORCPT ); Tue, 7 Jan 2020 11:54:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:41466 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728211AbgAGQyQ (ORCPT ); Tue, 7 Jan 2020 11:54:16 -0500 Received: from PC-kkoz.proceq.com (unknown [213.160.61.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9EA3D2073D; Tue, 7 Jan 2020 16:54:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578416055; bh=mMrPdoW2NnN8sMcsihZhEQMDfMhuUP76fLnSnvAwL0c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=odHfTW+8cECxrYMq2Vzsa1+MKLAZiRwwPcHqMedegEH2ouS5fNOOsZosd+u7hLcZ4 QNKLbLmuuOjhzd/v960g/wOhOG2WSBDznaoWxDMCOcpWJ/yDVkCRCTto4GhoN7BX6h 5kN4DEtsp6J8/QPmZeuorAYXPtPAgJBp4d4jOups= From: Krzysztof Kozlowski To: Richard Henderson , Ivan Kokshaysky , Matt Turner , Alexey Brodkin , Vineet Gupta , "James E.J. Bottomley" , Helge Deller , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Yoshinori Sato , Rich Felker , Dave Airlie , David Airlie , Daniel Vetter , Ben Skeggs , Mauro Carvalho Chehab , Jiri Slaby , Nick Kossifidis , Luis Chamberlain , Kalle Valo , "David S. Miller" , Dave Jiang , Jon Mason , Allen Hubbe , "Michael S. Tsirkin" , Jason Wang , Arnd Bergmann , Andrew Morton , Thomas Gleixner , Geert Uytterhoeven , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-media@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-ntb@googlegroups.com, virtualization@lists.linux-foundation.org, linux-arch@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [RFT 03/13] sh: Constify ioreadX() iomem argument (as in generic implementation) Date: Tue, 7 Jan 2020 17:53:02 +0100 Message-Id: <1578415992-24054-6-git-send-email-krzk@kernel.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1578415992-24054-1-git-send-email-krzk@kernel.org> References: <1578415992-24054-1-git-send-email-krzk@kernel.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The ioreadX() helpers have inconsistent interface. On some architectures void *__iomem address argument is a pointer to const, on some not. Implementations of ioreadX() do not modify the memory under the address so they can be converted to a "const" version for const-safety and consistency among architectures. Signed-off-by: Krzysztof Kozlowski --- arch/sh/kernel/iomap.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/sh/kernel/iomap.c b/arch/sh/kernel/iomap.c index ef9e2c97cbb7..bd5e212c6ea6 100644 --- a/arch/sh/kernel/iomap.c +++ b/arch/sh/kernel/iomap.c @@ -8,31 +8,31 @@ #include #include -unsigned int ioread8(void __iomem *addr) +unsigned int ioread8(const void __iomem *addr) { return readb(addr); } EXPORT_SYMBOL(ioread8); -unsigned int ioread16(void __iomem *addr) +unsigned int ioread16(const void __iomem *addr) { return readw(addr); } EXPORT_SYMBOL(ioread16); -unsigned int ioread16be(void __iomem *addr) +unsigned int ioread16be(const void __iomem *addr) { return be16_to_cpu(__raw_readw(addr)); } EXPORT_SYMBOL(ioread16be); -unsigned int ioread32(void __iomem *addr) +unsigned int ioread32(const void __iomem *addr) { return readl(addr); } EXPORT_SYMBOL(ioread32); -unsigned int ioread32be(void __iomem *addr) +unsigned int ioread32be(const void __iomem *addr) { return be32_to_cpu(__raw_readl(addr)); } From patchwork Tue Jan 7 16:53:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 216721 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F355C33C8C for ; Tue, 7 Jan 2020 16:54:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 25C4C222D9 for ; Tue, 7 Jan 2020 16:54:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578416079; bh=kcx/rxr2RLwdfnh8NHNbRoC/CMRusZFBrn/JE86e3Ww=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ExjIubYXTeOFDNJ5yakFyxDVZJ/EcohRgwPdmzpgoqI9XFlDEdWJQtHwgZusw87fB QY88juYvO6MJKnEes1rCRmpMNlcOEEqNSTKwTOZStop6iqes5VXf31k6ecLKJ14l93 2zHuq8ua/3W7P+Fe2/8BtZVUFoBZP85uCVijM2Fk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728642AbgAGQye (ORCPT ); Tue, 7 Jan 2020 11:54:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:42024 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728614AbgAGQyd (ORCPT ); Tue, 7 Jan 2020 11:54:33 -0500 Received: from PC-kkoz.proceq.com (unknown [213.160.61.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6B861214D8; Tue, 7 Jan 2020 16:54:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578416071; bh=kcx/rxr2RLwdfnh8NHNbRoC/CMRusZFBrn/JE86e3Ww=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nPI0cC7rOnafhOVC5bp7UTE2mQoTZDbOxMxBpCNT2a6rIVaeFzV7mtVVZ9F+98p+x Hk2gcfTOOvUk0qIzZk1BSRAhziD0R33MmnQ7l6nqXeVJ0q41DUIG7bmLWej2I0aWHz EJm+d+oMYMPHrJxueaaDZOqmBnz1RIpoH7U6LrGs= From: Krzysztof Kozlowski To: Richard Henderson , Ivan Kokshaysky , Matt Turner , Alexey Brodkin , Vineet Gupta , "James E.J. Bottomley" , Helge Deller , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Yoshinori Sato , Rich Felker , Dave Airlie , David Airlie , Daniel Vetter , Ben Skeggs , Mauro Carvalho Chehab , Jiri Slaby , Nick Kossifidis , Luis Chamberlain , Kalle Valo , "David S. Miller" , Dave Jiang , Jon Mason , Allen Hubbe , "Michael S. Tsirkin" , Jason Wang , Arnd Bergmann , Andrew Morton , Thomas Gleixner , Geert Uytterhoeven , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-media@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-ntb@googlegroups.com, virtualization@lists.linux-foundation.org, linux-arch@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [RFT 05/13] powerpc: Constify ioreadX() iomem argument (as in generic implementation) Date: Tue, 7 Jan 2020 17:53:04 +0100 Message-Id: <1578415992-24054-8-git-send-email-krzk@kernel.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1578415992-24054-1-git-send-email-krzk@kernel.org> References: <1578415992-24054-1-git-send-email-krzk@kernel.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The ioreadX() helpers have inconsistent interface. On some architectures void *__iomem address argument is a pointer to const, on some not. Implementations of ioreadX() do not modify the memory under the address so they can be converted to a "const" version for const-safety and consistency among architectures. Signed-off-by: Krzysztof Kozlowski --- arch/powerpc/kernel/iomap.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/arch/powerpc/kernel/iomap.c b/arch/powerpc/kernel/iomap.c index 5ac84efc6ede..de8da1c3496f 100644 --- a/arch/powerpc/kernel/iomap.c +++ b/arch/powerpc/kernel/iomap.c @@ -15,23 +15,23 @@ * Here comes the ppc64 implementation of the IOMAP * interfaces. */ -unsigned int ioread8(void __iomem *addr) +unsigned int ioread8(const void __iomem *addr) { return readb(addr); } -unsigned int ioread16(void __iomem *addr) +unsigned int ioread16(const void __iomem *addr) { return readw(addr); } -unsigned int ioread16be(void __iomem *addr) +unsigned int ioread16be(const void __iomem *addr) { return readw_be(addr); } -unsigned int ioread32(void __iomem *addr) +unsigned int ioread32(const void __iomem *addr) { return readl(addr); } -unsigned int ioread32be(void __iomem *addr) +unsigned int ioread32be(const void __iomem *addr) { return readl_be(addr); } @@ -41,27 +41,27 @@ EXPORT_SYMBOL(ioread16be); EXPORT_SYMBOL(ioread32); EXPORT_SYMBOL(ioread32be); #ifdef __powerpc64__ -u64 ioread64(void __iomem *addr) +u64 ioread64(const void __iomem *addr) { return readq(addr); } -u64 ioread64_lo_hi(void __iomem *addr) +u64 ioread64_lo_hi(const void __iomem *addr) { return readq(addr); } -u64 ioread64_hi_lo(void __iomem *addr) +u64 ioread64_hi_lo(const void __iomem *addr) { return readq(addr); } -u64 ioread64be(void __iomem *addr) +u64 ioread64be(const void __iomem *addr) { return readq_be(addr); } -u64 ioread64be_lo_hi(void __iomem *addr) +u64 ioread64be_lo_hi(const void __iomem *addr) { return readq_be(addr); } -u64 ioread64be_hi_lo(void __iomem *addr) +u64 ioread64be_hi_lo(const void __iomem *addr) { return readq_be(addr); } From patchwork Tue Jan 7 16:53:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 216720 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C459C3F68F for ; Tue, 7 Jan 2020 16:54:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D7A6324679 for ; Tue, 7 Jan 2020 16:54:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578416095; bh=kYrH24ncGNFFYQLQ9wHiRAtooGLl8xeKtAWqiO+vhmI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=mEP9IEsA80Vfx+19XD6eXp22i8YXqxjpbyRpPhJTn14vessa20yRktyoYlkQpqCkO r61O9Mu19PKIkS3WwpUnQT4iMBY4d5JETBq8Ok56PSxJSdrGCPshBJkFM2X1BG9DS1 DWHztXEYgMHkKGGw30jrQ+DxA5UKvaJLXH39OAxI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728684AbgAGQyw (ORCPT ); Tue, 7 Jan 2020 11:54:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:42646 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728391AbgAGQyv (ORCPT ); Tue, 7 Jan 2020 11:54:51 -0500 Received: from PC-kkoz.proceq.com (unknown [213.160.61.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 95E1224677; Tue, 7 Jan 2020 16:54:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578416090; bh=kYrH24ncGNFFYQLQ9wHiRAtooGLl8xeKtAWqiO+vhmI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ktJ602nrKO22v0uNZz36NC/2TQ72yN6ijh2qShGKTyM6sP8S4sHzrYeq95duxemBM F0Hlx7sC2SFMxEUl0tafeD+qmflFDYmaI7aUvp442eXhKcmauRa4vF7iN/d/RiSgKl +G0tMhwntosCt0ljDnAplFNWUVM/SIIt7orUHcV0= From: Krzysztof Kozlowski To: Richard Henderson , Ivan Kokshaysky , Matt Turner , Alexey Brodkin , Vineet Gupta , "James E.J. Bottomley" , Helge Deller , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Yoshinori Sato , Rich Felker , Dave Airlie , David Airlie , Daniel Vetter , Ben Skeggs , Mauro Carvalho Chehab , Jiri Slaby , Nick Kossifidis , Luis Chamberlain , Kalle Valo , "David S. Miller" , Dave Jiang , Jon Mason , Allen Hubbe , "Michael S. Tsirkin" , Jason Wang , Arnd Bergmann , Andrew Morton , Thomas Gleixner , Geert Uytterhoeven , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-media@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-ntb@googlegroups.com, virtualization@lists.linux-foundation.org, linux-arch@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [RFT 07/13] drm/mgag200: Constify ioreadX() iomem argument (as in generic implementation) Date: Tue, 7 Jan 2020 17:53:06 +0100 Message-Id: <1578415992-24054-10-git-send-email-krzk@kernel.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1578415992-24054-1-git-send-email-krzk@kernel.org> References: <1578415992-24054-1-git-send-email-krzk@kernel.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The ioreadX() helpers have inconsistent interface. On some architectures void *__iomem address argument is a pointer to const, on some not. Implementations of ioreadX() do not modify the memory under the address so they can be converted to a "const" version for const-safety and consistency among architectures. Signed-off-by: Krzysztof Kozlowski --- drivers/gpu/drm/mgag200/mgag200_drv.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/mgag200/mgag200_drv.h b/drivers/gpu/drm/mgag200/mgag200_drv.h index aa32aad222c2..6512b3af4fb7 100644 --- a/drivers/gpu/drm/mgag200/mgag200_drv.h +++ b/drivers/gpu/drm/mgag200/mgag200_drv.h @@ -34,9 +34,9 @@ #define MGAG200FB_CONN_LIMIT 1 -#define RREG8(reg) ioread8(((void __iomem *)mdev->rmmio) + (reg)) +#define RREG8(reg) ioread8(((const void __iomem *)mdev->rmmio) + (reg)) #define WREG8(reg, v) iowrite8(v, ((void __iomem *)mdev->rmmio) + (reg)) -#define RREG32(reg) ioread32(((void __iomem *)mdev->rmmio) + (reg)) +#define RREG32(reg) ioread32(((const void __iomem *)mdev->rmmio) + (reg)) #define WREG32(reg, v) iowrite32(v, ((void __iomem *)mdev->rmmio) + (reg)) #define ATTR_INDEX 0x1fc0 From patchwork Tue Jan 7 16:53:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 216719 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AF730C33C9B for ; Tue, 7 Jan 2020 16:55:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8615021744 for ; Tue, 7 Jan 2020 16:55:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578416113; bh=MC0/fBBQZWISkssJQ3ftJ0jgVHrJkdjW/7yjCdKM/PA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=oPDU18oAf0t/L0Sh9ofnX053Xq2nzVKFJNthOCwOnNqtz1tmlrQXF5i/LyQ7LFddD sOL/RyUVoP6jUawjIpUZuv9OXxFsqhzbHry0Kewu3n6TUhsb/JwP17HJa2cIgLKNac dUYiIQuLexQZefFt1Pb2l4LkxwuRnG3wgj1WZcWE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728724AbgAGQzK (ORCPT ); Tue, 7 Jan 2020 11:55:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:43242 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728397AbgAGQzJ (ORCPT ); Tue, 7 Jan 2020 11:55:09 -0500 Received: from PC-kkoz.proceq.com (unknown [213.160.61.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C767F2467D; Tue, 7 Jan 2020 16:54:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578416108; bh=MC0/fBBQZWISkssJQ3ftJ0jgVHrJkdjW/7yjCdKM/PA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Dvt+VbDPltA0lHPjSuQfwSM0Nd7tqQxxSsTv3S1SfffgfHhybHwd8a+EUHLiKIH+o JZ8wcoMN9XNT6JC+7vIELwX97TOgTAWZP4h0a2WWwY8iZu3vyVNHxgCXxKvfsf1BLn K6XnKPbtjtYYIWRyO0QKbfknQAuj9KrHeyr4g67s= From: Krzysztof Kozlowski To: Richard Henderson , Ivan Kokshaysky , Matt Turner , Alexey Brodkin , Vineet Gupta , "James E.J. Bottomley" , Helge Deller , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Yoshinori Sato , Rich Felker , Dave Airlie , David Airlie , Daniel Vetter , Ben Skeggs , Mauro Carvalho Chehab , Jiri Slaby , Nick Kossifidis , Luis Chamberlain , Kalle Valo , "David S. Miller" , Dave Jiang , Jon Mason , Allen Hubbe , "Michael S. Tsirkin" , Jason Wang , Arnd Bergmann , Andrew Morton , Thomas Gleixner , Geert Uytterhoeven , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-media@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-ntb@googlegroups.com, virtualization@lists.linux-foundation.org, linux-arch@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [RFT 09/13] media: fsl-viu: Constify ioreadX() iomem argument (as in generic implementation) Date: Tue, 7 Jan 2020 17:53:08 +0100 Message-Id: <1578415992-24054-12-git-send-email-krzk@kernel.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1578415992-24054-1-git-send-email-krzk@kernel.org> References: <1578415992-24054-1-git-send-email-krzk@kernel.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The ioreadX() helpers have inconsistent interface. On some architectures void *__iomem address argument is a pointer to const, on some not. Implementations of ioreadX() do not modify the memory under the address so they can be converted to a "const" version for const-safety and consistency among architectures. Signed-off-by: Krzysztof Kozlowski --- drivers/media/platform/fsl-viu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/fsl-viu.c b/drivers/media/platform/fsl-viu.c index 81a8faedbba6..991d9dc82749 100644 --- a/drivers/media/platform/fsl-viu.c +++ b/drivers/media/platform/fsl-viu.c @@ -34,7 +34,7 @@ /* Allow building this driver with COMPILE_TEST */ #if !defined(CONFIG_PPC) && !defined(CONFIG_MICROBLAZE) #define out_be32(v, a) iowrite32be(a, (void __iomem *)v) -#define in_be32(a) ioread32be((void __iomem *)a) +#define in_be32(a) ioread32be((const void __iomem *)a) #endif #define BUFFER_TIMEOUT msecs_to_jiffies(500) /* 0.5 seconds */ From patchwork Tue Jan 7 16:53:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 216718 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F12AC33C8C for ; Tue, 7 Jan 2020 16:55:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 556D82467E for ; Tue, 7 Jan 2020 16:55:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578416131; bh=yZ1alr9A2nUZ2Hv+vTN9H+etC5HSYvMyPLdn1mrb4CQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=mDaoCUpr6w2XStXx3VsJlDtvnhTNNgTdVvzdUtAQRNkNjdRquwF9zKqtGbKlkw8Mo UnoTOvToGijeTricCb/P/KypsSzjLb3S9UgGIwm6H7jNg8yeWrYGeu6HAH8+y52DQx EcTOrb4NBW834aHZlm8kr1QQ4CGfMnLok7Of0LJY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728759AbgAGQz1 (ORCPT ); Tue, 7 Jan 2020 11:55:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:43742 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728391AbgAGQz0 (ORCPT ); Tue, 7 Jan 2020 11:55:26 -0500 Received: from PC-kkoz.proceq.com (unknown [213.160.61.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C24FD2467C; Tue, 7 Jan 2020 16:55:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578416125; bh=yZ1alr9A2nUZ2Hv+vTN9H+etC5HSYvMyPLdn1mrb4CQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FdNtYmqfn+ySYXxZ76v0NIWq0zhHwvOM8yur5NsMwL9rYxXUQqdTfG2PKQgr9eiCm rnS6aCKPmbyo4SkOUcjWvVrhQO2ADV8gPXWHOKs+SB96U4jGlc/Wlzx/YljEz2Jxiz 1Y1+Nx/AbkFdwy5Y7GzCUfFm5PLKFNq3NfsB+LJo= From: Krzysztof Kozlowski To: Richard Henderson , Ivan Kokshaysky , Matt Turner , Alexey Brodkin , Vineet Gupta , "James E.J. Bottomley" , Helge Deller , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Yoshinori Sato , Rich Felker , Dave Airlie , David Airlie , Daniel Vetter , Ben Skeggs , Mauro Carvalho Chehab , Jiri Slaby , Nick Kossifidis , Luis Chamberlain , Kalle Valo , "David S. Miller" , Dave Jiang , Jon Mason , Allen Hubbe , "Michael S. Tsirkin" , Jason Wang , Arnd Bergmann , Andrew Morton , Thomas Gleixner , Geert Uytterhoeven , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-media@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-ntb@googlegroups.com, virtualization@lists.linux-foundation.org, linux-arch@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [RFT 11/13] net: wireless: rtl818x: Constify ioreadX() iomem argument (as in generic implementation) Date: Tue, 7 Jan 2020 17:53:10 +0100 Message-Id: <1578415992-24054-14-git-send-email-krzk@kernel.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1578415992-24054-1-git-send-email-krzk@kernel.org> References: <1578415992-24054-1-git-send-email-krzk@kernel.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The ioreadX() helpers have inconsistent interface. On some architectures void *__iomem address argument is a pointer to const, on some not. Implementations of ioreadX() do not modify the memory under the address so they can be converted to a "const" version for const-safety and consistency among architectures. Signed-off-by: Krzysztof Kozlowski --- drivers/net/wireless/realtek/rtl818x/rtl8180/rtl8180.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/realtek/rtl818x/rtl8180/rtl8180.h b/drivers/net/wireless/realtek/rtl818x/rtl8180/rtl8180.h index 7948a2da195a..2ff00800d45b 100644 --- a/drivers/net/wireless/realtek/rtl818x/rtl8180/rtl8180.h +++ b/drivers/net/wireless/realtek/rtl818x/rtl8180/rtl8180.h @@ -150,17 +150,17 @@ void rtl8180_write_phy(struct ieee80211_hw *dev, u8 addr, u32 data); void rtl8180_set_anaparam(struct rtl8180_priv *priv, u32 anaparam); void rtl8180_set_anaparam2(struct rtl8180_priv *priv, u32 anaparam2); -static inline u8 rtl818x_ioread8(struct rtl8180_priv *priv, u8 __iomem *addr) +static inline u8 rtl818x_ioread8(struct rtl8180_priv *priv, const u8 __iomem *addr) { return ioread8(addr); } -static inline u16 rtl818x_ioread16(struct rtl8180_priv *priv, __le16 __iomem *addr) +static inline u16 rtl818x_ioread16(struct rtl8180_priv *priv, const __le16 __iomem *addr) { return ioread16(addr); } -static inline u32 rtl818x_ioread32(struct rtl8180_priv *priv, __le32 __iomem *addr) +static inline u32 rtl818x_ioread32(struct rtl8180_priv *priv, const __le32 __iomem *addr) { return ioread32(addr); } From patchwork Tue Jan 7 16:53:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 216717 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61138C33C8C for ; Tue, 7 Jan 2020 16:55:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3757A206DB for ; Tue, 7 Jan 2020 16:55:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578416149; bh=zdByYEGMS3ESVQ5qOHN1kIYsWdU38BLlIlo+0ZPdrE4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=kbuTL+dYLQ6cv8SkDSkgVXlnx/B/8ufr16zQkKyB6FhFaAiMTkYXA08asB1KAUfPv 8uuwowycATYskRNGJNY7FRsq5C0kyV01DEtLAOu4kJSY7AH4KCTqsAuOHrT8o4zi9k fFPjLQHbWgXtqixS9aLgmFpxNIZd9XiMMI93WWHg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728794AbgAGQzo (ORCPT ); Tue, 7 Jan 2020 11:55:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:44234 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728391AbgAGQzn (ORCPT ); Tue, 7 Jan 2020 11:55:43 -0500 Received: from PC-kkoz.proceq.com (unknown [213.160.61.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4236B2467F; Tue, 7 Jan 2020 16:55:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578416142; bh=zdByYEGMS3ESVQ5qOHN1kIYsWdU38BLlIlo+0ZPdrE4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B9XX5z37aO9kO6TkoMZBWRljecz6mxaLsnUJweo1Opz89I73sTah4aguq2M+qbAtk jJqm5ERlXNfIDH66LmWHTiUD9ISWyzlIjrcT5hLgLk+5mFBneKkY4HBIjWPl8jboDN drdv6nwNwT+gPU/NfUpzBRq4v5bgiFQUyIlD1qE4= From: Krzysztof Kozlowski To: Richard Henderson , Ivan Kokshaysky , Matt Turner , Alexey Brodkin , Vineet Gupta , "James E.J. Bottomley" , Helge Deller , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Yoshinori Sato , Rich Felker , Dave Airlie , David Airlie , Daniel Vetter , Ben Skeggs , Mauro Carvalho Chehab , Jiri Slaby , Nick Kossifidis , Luis Chamberlain , Kalle Valo , "David S. Miller" , Dave Jiang , Jon Mason , Allen Hubbe , "Michael S. Tsirkin" , Jason Wang , Arnd Bergmann , Andrew Morton , Thomas Gleixner , Geert Uytterhoeven , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-media@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-ntb@googlegroups.com, virtualization@lists.linux-foundation.org, linux-arch@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [RFT 13/13] virtio: pci: Constify ioreadX() iomem argument (as in generic implementation) Date: Tue, 7 Jan 2020 17:53:12 +0100 Message-Id: <1578415992-24054-16-git-send-email-krzk@kernel.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1578415992-24054-1-git-send-email-krzk@kernel.org> References: <1578415992-24054-1-git-send-email-krzk@kernel.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The ioreadX() helpers have inconsistent interface. On some architectures void *__iomem address argument is a pointer to const, on some not. Implementations of ioreadX() do not modify the memory under the address so they can be converted to a "const" version for const-safety and consistency among architectures. Signed-off-by: Krzysztof Kozlowski --- drivers/virtio/virtio_pci_modern.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/virtio/virtio_pci_modern.c b/drivers/virtio/virtio_pci_modern.c index 7abcc50838b8..fc58db4ab6c3 100644 --- a/drivers/virtio/virtio_pci_modern.c +++ b/drivers/virtio/virtio_pci_modern.c @@ -26,16 +26,16 @@ * method, i.e. 32-bit accesses for 32-bit fields, 16-bit accesses * for 16-bit fields and 8-bit accesses for 8-bit fields. */ -static inline u8 vp_ioread8(u8 __iomem *addr) +static inline u8 vp_ioread8(const u8 __iomem *addr) { return ioread8(addr); } -static inline u16 vp_ioread16 (__le16 __iomem *addr) +static inline u16 vp_ioread16 (const __le16 __iomem *addr) { return ioread16(addr); } -static inline u32 vp_ioread32(__le32 __iomem *addr) +static inline u32 vp_ioread32(const __le32 __iomem *addr) { return ioread32(addr); }