From mboxrd@z Thu Jan 1 00:00:00 1970 From: Krzysztof Kozlowski Subject: Re: [RFT 02/13] alpha: Constify ioreadX() iomem argument (as in generic implementation) Date: Wed, 8 Jan 2020 10:07:32 +0100 Message-ID: <20200108090732.GA10145@pi3> References: <1578415992-24054-1-git-send-email-krzk@kernel.org> <1578415992-24054-3-git-send-email-krzk@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+gla-linux-snps-arc=m.gmane.org@lists.infradead.org To: Geert Uytterhoeven Cc: Rich Felker , Jiri Slaby , "Michael S. Tsirkin" , David Airlie , Benjamin Herrenschmidt , Jason Wang , DRI Development , virtualization@lists.linux-foundation.org, "James E.J. Bottomley" , netdev , Paul Mackerras , Linux-Arch , Dave Jiang , Yoshinori Sato , Michael Ellerman , Helge Deller , Linux-sh list , Alexey Brodkin , Ben Skeggs , nouveau@lists.freedesktop.org, Dave Airlie , Matt Turner , arcml List-Id: linux-arch.vger.kernel.org On Wed, Jan 08, 2020 at 09:10:06AM +0100, Geert Uytterhoeven wrote: > Hi Krzysztof, > > On Tue, Jan 7, 2020 at 5:53 PM Krzysztof Kozlowski wrote: > > 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 > > > --- a/arch/alpha/include/asm/io.h > > +++ b/arch/alpha/include/asm/io.h > > @@ -151,9 +151,9 @@ static inline void generic_##NAME(TYPE b, QUAL void __iomem *addr) \ > > alpha_mv.mv_##NAME(b, addr); \ > > } > > > > -REMAP1(unsigned int, ioread8, /**/) > > -REMAP1(unsigned int, ioread16, /**/) > > -REMAP1(unsigned int, ioread32, /**/) > > +REMAP1(unsigned int, ioread8, const) > > +REMAP1(unsigned int, ioread16, const) > > +REMAP1(unsigned int, ioread32, const) > > If these would become "const volatile", there would no longer be a need > for the last parameter of the REMAP1() macro. > > > REMAP1(u8, readb, const volatile) > > REMAP1(u16, readw, const volatile) > > REMAP1(u32, readl, const volatile) > > Same for REMAP2() macro below, for iowrite*(). Good point, thanks! Best regards, Krzysztof From mboxrd@z Thu Jan 1 00:00:00 1970 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=-4.0 required=3.0 tests=MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=no 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 4F545C00523 for ; Wed, 8 Jan 2020 09:09:42 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 097FA20705 for ; Wed, 8 Jan 2020 09:09:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 097FA20705 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 47t3NM4m98zDqMW for ; Wed, 8 Jan 2020 20:09:39 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=209.85.208.67; helo=mail-ed1-f67.google.com; envelope-from=k.kozlowski.k@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=fail (p=none dis=none) header.from=kernel.org Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 47t3L43ZxFzDqNs for ; Wed, 8 Jan 2020 20:07:39 +1100 (AEDT) Received: by mail-ed1-f67.google.com with SMTP id cy15so1957210edb.4 for ; Wed, 08 Jan 2020 01:07:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=0jRYcccy+K8+wcIcmevpt3CSwH1FRXDhvGLKKsO8/R8=; b=gBQkbGxfR0LmYNI/fs8mPbMXiJ3r9SSBMUBdKwiBOasStrAEIYIAB+7o1M6qItEwut JmQN0Ee0YW3d2YDAutf1MjP+V5VDuDVyAZJaXtrJbYSu+w5ewFk6grF8JZwAFRDBohCL GXtOd2FyOzN3uvijIVbD23E8tdZvXQf1ND2C9/ITqm4PAwKPdPyzf7o5sIJFFwFvpOGR NGozXGxOZBEXdrEkd9HeXmVdFACVCk/z4MABKlpMKZSQOcJlaW/nYbxgJOnrir7XEbt6 yYscSHG3MIiWGrQeU1osSCLp3pm2K/Z0tFKrB57UZ7a9v7j+PM3hf6Vt7VZCNHMjfl0W bSmQ== X-Gm-Message-State: APjAAAV/DQn3GsmsvCUyawhY61/KYac8JUZlHQncWMWeH/YxkndWzX8q pRQrMYkCix5TYgtZg9OLIOY= X-Google-Smtp-Source: APXvYqx7lojzs5eJ7tjc2OaNpqjg4Ds4/tRmp0l0ATPp14XCcF7ovHyFxsvNMuPIHycIcD1wSckgnw== X-Received: by 2002:a17:906:404:: with SMTP id d4mr3768395eja.326.1578474456276; Wed, 08 Jan 2020 01:07:36 -0800 (PST) Received: from pi3 ([194.230.155.149]) by smtp.googlemail.com with ESMTPSA id j3sm53121edb.50.2020.01.08.01.07.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2020 01:07:35 -0800 (PST) Date: Wed, 8 Jan 2020 10:07:32 +0100 From: Krzysztof Kozlowski To: Geert Uytterhoeven Subject: Re: [RFT 02/13] alpha: Constify ioreadX() iomem argument (as in generic implementation) Message-ID: <20200108090732.GA10145@pi3> References: <1578415992-24054-1-git-send-email-krzk@kernel.org> <1578415992-24054-3-git-send-email-krzk@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rich Felker , Jiri Slaby , "Michael S. Tsirkin" , David Airlie , Jason Wang , DRI Development , virtualization@lists.linux-foundation.org, "James E.J. Bottomley" , netdev , Paul Mackerras , Linux-Arch , Dave Jiang , Yoshinori Sato , Helge Deller , Linux-sh list , Alexey Brodkin , Ben Skeggs , nouveau@lists.freedesktop.org, Dave Airlie , Matt Turner , arcml , Nick Kossifidis , Allen Hubbe , Arnd Bergmann , alpha , Ivan Kokshaysky , Thomas Gleixner , Mauro Carvalho Chehab , Kalle Valo , Richard Henderson , Parisc List , Vineet Gupta , linux-wireless , Linux Kernel Mailing List , Luis Chamberlain , Daniel Vetter , Jon Mason , linux-ntb@googlegroups.com, Andrew Morton , Linux Media Mailing List , linuxppc-dev , "David S. Miller" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Wed, Jan 08, 2020 at 09:10:06AM +0100, Geert Uytterhoeven wrote: > Hi Krzysztof, > > On Tue, Jan 7, 2020 at 5:53 PM Krzysztof Kozlowski wrote: > > 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 > > > --- a/arch/alpha/include/asm/io.h > > +++ b/arch/alpha/include/asm/io.h > > @@ -151,9 +151,9 @@ static inline void generic_##NAME(TYPE b, QUAL void __iomem *addr) \ > > alpha_mv.mv_##NAME(b, addr); \ > > } > > > > -REMAP1(unsigned int, ioread8, /**/) > > -REMAP1(unsigned int, ioread16, /**/) > > -REMAP1(unsigned int, ioread32, /**/) > > +REMAP1(unsigned int, ioread8, const) > > +REMAP1(unsigned int, ioread16, const) > > +REMAP1(unsigned int, ioread32, const) > > If these would become "const volatile", there would no longer be a need > for the last parameter of the REMAP1() macro. > > > REMAP1(u8, readb, const volatile) > > REMAP1(u16, readw, const volatile) > > REMAP1(u32, readl, const volatile) > > Same for REMAP2() macro below, for iowrite*(). Good point, thanks! Best regards, Krzysztof From mboxrd@z Thu Jan 1 00:00:00 1970 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=-4.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=no 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 65B7AC00523 for ; Wed, 8 Jan 2020 09:07:42 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 36E7220705 for ; Wed, 8 Jan 2020 09:07:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="rmbuUGbS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 36E7220705 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-snps-arc-bounces+linux-snps-arc=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KaMSGQVMylMxugpvPmeYTFZghEBSjPNh3u2svKC3Yeo=; b=rmbuUGbS/iBmlu wEV2rSRuhnlzizQ3tUm8rO0S7cqs7Pp57HEH2IoZFXfB7RlnCxtsshI/0CM7aaRoFCqr4M5sLnc15 1mfwqHfufoyM6K5qDXg1s8uQO3gvEydme7nHSm6kHnAS+ZeRq6S+psrCUlRnkW8+hTpwOj3Ca1kQO Ae99sKXQYrPTpaoZiMv8kSbPgwqeH8JtZsY5fYvADYnWOiQnPtNXbW8RRUjMpGK/dTIyqNpSCW6RC hOb37fl2kP9pjXnFVDzCSJBDvs12//Ilre4e+YuYhE138UUL3VDX5u30lU5STi/lpRB6H3VXAzwE1 R9roHBZOVqkVcfOLXn6Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ip7JV-0005ZU-7O; Wed, 08 Jan 2020 09:07:41 +0000 Received: from mail-ed1-f66.google.com ([209.85.208.66]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ip7JS-0005W1-M8 for linux-snps-arc@lists.infradead.org; Wed, 08 Jan 2020 09:07:39 +0000 Received: by mail-ed1-f66.google.com with SMTP id i16so1948872edr.5 for ; Wed, 08 Jan 2020 01:07:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=0jRYcccy+K8+wcIcmevpt3CSwH1FRXDhvGLKKsO8/R8=; b=qXg+kZWUltnOu3VlRGkv8BQWJZW3TGsnc+6L6VxScazdDalxT+Qckber3P8tdELhbr 2F9oDSdzZ0RnNdLsKvHirZXUXOdE/TAgvh84sQoDLqmgB+KFdYI7XpEOCBsymplbSPSN K3hneU6jzgkMmVi+fKs7pCpCGzkS3weh+QMLvQoa1mVIzrD298M8EBY6r4ALjN5+gvH1 eZdN1qBOnQM13o9b/4nsEcEbv6C1Qh3DPCnmjAtO4K7tiXZmsF6+RgHsrZC3PPk6axcd vhOJPYPN9nMwMexu2olg91ARxQZiXcEY5KORsvRAGmb9UUt5eVXDlhqCxDw7uYAkgDzC oCuA== X-Gm-Message-State: APjAAAXfeMr38StRl31n+fc5pr/QRMd5EMpuwQtej2ilobwZ7CKt6ahr Q/X6JWc6fj+TLlnnSa+pOW4= X-Google-Smtp-Source: APXvYqx7lojzs5eJ7tjc2OaNpqjg4Ds4/tRmp0l0ATPp14XCcF7ovHyFxsvNMuPIHycIcD1wSckgnw== X-Received: by 2002:a17:906:404:: with SMTP id d4mr3768395eja.326.1578474456276; Wed, 08 Jan 2020 01:07:36 -0800 (PST) Received: from pi3 ([194.230.155.149]) by smtp.googlemail.com with ESMTPSA id j3sm53121edb.50.2020.01.08.01.07.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2020 01:07:35 -0800 (PST) Date: Wed, 8 Jan 2020 10:07:32 +0100 From: Krzysztof Kozlowski To: Geert Uytterhoeven Subject: Re: [RFT 02/13] alpha: Constify ioreadX() iomem argument (as in generic implementation) Message-ID: <20200108090732.GA10145@pi3> References: <1578415992-24054-1-git-send-email-krzk@kernel.org> <1578415992-24054-3-git-send-email-krzk@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200108_010738_728669_54219427 X-CRM114-Status: GOOD ( 15.67 ) X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rich Felker , Jiri Slaby , "Michael S. Tsirkin" , David Airlie , Benjamin Herrenschmidt , Jason Wang , DRI Development , virtualization@lists.linux-foundation.org, "James E.J. Bottomley" , netdev , Paul Mackerras , Linux-Arch , Dave Jiang , Yoshinori Sato , Michael Ellerman , Helge Deller , Linux-sh list , Alexey Brodkin , Ben Skeggs , nouveau@lists.freedesktop.org, Dave Airlie , Matt Turner , arcml , Nick Kossifidis , Allen Hubbe , Arnd Bergmann , alpha , Ivan Kokshaysky , Thomas Gleixner , Mauro Carvalho Chehab , Kalle Valo , Richard Henderson , Parisc List , Vineet Gupta , linux-wireless , Linux Kernel Mailing List , Luis Chamberlain , Daniel Vetter , Jon Mason , linux-ntb@googlegroups.com, Andrew Morton , Linux Media Mailing List , linuxppc-dev , "David S. Miller" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+linux-snps-arc=archiver.kernel.org@lists.infradead.org On Wed, Jan 08, 2020 at 09:10:06AM +0100, Geert Uytterhoeven wrote: > Hi Krzysztof, > > On Tue, Jan 7, 2020 at 5:53 PM Krzysztof Kozlowski wrote: > > 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 > > > --- a/arch/alpha/include/asm/io.h > > +++ b/arch/alpha/include/asm/io.h > > @@ -151,9 +151,9 @@ static inline void generic_##NAME(TYPE b, QUAL void __iomem *addr) \ > > alpha_mv.mv_##NAME(b, addr); \ > > } > > > > -REMAP1(unsigned int, ioread8, /**/) > > -REMAP1(unsigned int, ioread16, /**/) > > -REMAP1(unsigned int, ioread32, /**/) > > +REMAP1(unsigned int, ioread8, const) > > +REMAP1(unsigned int, ioread16, const) > > +REMAP1(unsigned int, ioread32, const) > > If these would become "const volatile", there would no longer be a need > for the last parameter of the REMAP1() macro. > > > REMAP1(u8, readb, const volatile) > > REMAP1(u16, readw, const volatile) > > REMAP1(u32, readl, const volatile) > > Same for REMAP2() macro below, for iowrite*(). Good point, thanks! Best regards, Krzysztof _______________________________________________ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc From mboxrd@z Thu Jan 1 00:00:00 1970 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=-4.0 required=3.0 tests=MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=no 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 43928C00523 for ; Wed, 8 Jan 2020 09:07:39 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 211D920705 for ; Wed, 8 Jan 2020 09:07:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 211D920705 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 96D3F6E87A; Wed, 8 Jan 2020 09:07:38 +0000 (UTC) Received: from mail-ed1-f66.google.com (mail-ed1-f66.google.com [209.85.208.66]) by gabe.freedesktop.org (Postfix) with ESMTPS id A54136E87A; Wed, 8 Jan 2020 09:07:37 +0000 (UTC) Received: by mail-ed1-f66.google.com with SMTP id b8so1943155edx.7; Wed, 08 Jan 2020 01:07:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=0jRYcccy+K8+wcIcmevpt3CSwH1FRXDhvGLKKsO8/R8=; b=iGnKyN2HO/d7JQUhFLLJxcAY7syd5m4vIFKbjimQQZJtL0dAGwMxD7CoowT+qKB/cT TKI/MVlMhxKfTpka2qHkCvsovdrPgXHGBGPM6rgdUJ0zTww1BX7ps8upHe9j787FeP3q y3lLyCmekyDSWeqD7P2hmfXIyu3tHJBGTDMN9cZbFJiKeKIxOLmKgs7xcj1RL7C+V4Jd wIsfQJSEjHDysO8mwSYcIKtw9/BSbwLSwk44H4AeEJyGwbLRlHTWakjio+H1EoISisqX cnpzek4SDIdmFbNXgyV0QNUO2xUgKj3hkN/CXjNLS3G390lTOSFR6fTNqMfzOJ4dF3CK J8Hw== X-Gm-Message-State: APjAAAXzIhrH9DaNOMLuNNp9bj4Yq9Xvc//GYPMymZ6Q4naSfnkFImT2 pMUdzPUSTfMIN+3tx2GC73A= X-Google-Smtp-Source: APXvYqx7lojzs5eJ7tjc2OaNpqjg4Ds4/tRmp0l0ATPp14XCcF7ovHyFxsvNMuPIHycIcD1wSckgnw== X-Received: by 2002:a17:906:404:: with SMTP id d4mr3768395eja.326.1578474456276; Wed, 08 Jan 2020 01:07:36 -0800 (PST) Received: from pi3 ([194.230.155.149]) by smtp.googlemail.com with ESMTPSA id j3sm53121edb.50.2020.01.08.01.07.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2020 01:07:35 -0800 (PST) Date: Wed, 8 Jan 2020 10:07:32 +0100 From: Krzysztof Kozlowski To: Geert Uytterhoeven Subject: Re: [RFT 02/13] alpha: Constify ioreadX() iomem argument (as in generic implementation) Message-ID: <20200108090732.GA10145@pi3> References: <1578415992-24054-1-git-send-email-krzk@kernel.org> <1578415992-24054-3-git-send-email-krzk@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rich Felker , Jiri Slaby , "Michael S. Tsirkin" , David Airlie , Jason Wang , DRI Development , virtualization@lists.linux-foundation.org, "James E.J. Bottomley" , netdev , Paul Mackerras , Linux-Arch , Dave Jiang , Yoshinori Sato , Michael Ellerman , Helge Deller , Linux-sh list , Alexey Brodkin , Ben Skeggs , nouveau@lists.freedesktop.org, Dave Airlie , Matt Turner , arcml , Nick Kossifidis , Allen Hubbe , Arnd Bergmann , alpha , Ivan Kokshaysky , Thomas Gleixner , Mauro Carvalho Chehab , Kalle Valo , Richard Henderson , Parisc List , Vineet Gupta , linux-wireless , Linux Kernel Mailing List , Luis Chamberlain , Jon Mason , linux-ntb@googlegroups.com, Andrew Morton , Linux Media Mailing List , linuxppc-dev , "David S. Miller" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Wed, Jan 08, 2020 at 09:10:06AM +0100, Geert Uytterhoeven wrote: > Hi Krzysztof, > > On Tue, Jan 7, 2020 at 5:53 PM Krzysztof Kozlowski wrote: > > 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 > > > --- a/arch/alpha/include/asm/io.h > > +++ b/arch/alpha/include/asm/io.h > > @@ -151,9 +151,9 @@ static inline void generic_##NAME(TYPE b, QUAL void __iomem *addr) \ > > alpha_mv.mv_##NAME(b, addr); \ > > } > > > > -REMAP1(unsigned int, ioread8, /**/) > > -REMAP1(unsigned int, ioread16, /**/) > > -REMAP1(unsigned int, ioread32, /**/) > > +REMAP1(unsigned int, ioread8, const) > > +REMAP1(unsigned int, ioread16, const) > > +REMAP1(unsigned int, ioread32, const) > > If these would become "const volatile", there would no longer be a need > for the last parameter of the REMAP1() macro. > > > REMAP1(u8, readb, const volatile) > > REMAP1(u16, readw, const volatile) > > REMAP1(u32, readl, const volatile) > > Same for REMAP2() macro below, for iowrite*(). Good point, thanks! Best regards, Krzysztof _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com. [209.85.208.67]) by gmr-mx.google.com with ESMTPS id v16si102558lfd.2.2020.01.08.01.07.36 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Jan 2020 01:07:36 -0800 (PST) Received: by mail-ed1-f67.google.com with SMTP id c26so1935916eds.8 for ; Wed, 08 Jan 2020 01:07:36 -0800 (PST) Return-Path: Date: Wed, 8 Jan 2020 10:07:32 +0100 From: Krzysztof Kozlowski Subject: Re: [RFT 02/13] alpha: Constify ioreadX() iomem argument (as in generic implementation) Message-ID: <20200108090732.GA10145@pi3> References: <1578415992-24054-1-git-send-email-krzk@kernel.org> <1578415992-24054-3-git-send-email-krzk@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: To: Geert Uytterhoeven Cc: 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 , alpha , Linux Kernel Mailing List , arcml , Parisc List , linuxppc-dev , Linux-sh list , DRI Development , nouveau@lists.freedesktop.org, Linux Media Mailing List , linux-wireless , netdev , linux-ntb@googlegroups.com, virtualization@lists.linux-foundation.org, Linux-Arch List-ID: On Wed, Jan 08, 2020 at 09:10:06AM +0100, Geert Uytterhoeven wrote: > Hi Krzysztof, > > On Tue, Jan 7, 2020 at 5:53 PM Krzysztof Kozlowski wrote: > > 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 > > > --- a/arch/alpha/include/asm/io.h > > +++ b/arch/alpha/include/asm/io.h > > @@ -151,9 +151,9 @@ static inline void generic_##NAME(TYPE b, QUAL void __iomem *addr) \ > > alpha_mv.mv_##NAME(b, addr); \ > > } > > > > -REMAP1(unsigned int, ioread8, /**/) > > -REMAP1(unsigned int, ioread16, /**/) > > -REMAP1(unsigned int, ioread32, /**/) > > +REMAP1(unsigned int, ioread8, const) > > +REMAP1(unsigned int, ioread16, const) > > +REMAP1(unsigned int, ioread32, const) > > If these would become "const volatile", there would no longer be a need > for the last parameter of the REMAP1() macro. > > > REMAP1(u8, readb, const volatile) > > REMAP1(u16, readw, const volatile) > > REMAP1(u32, readl, const volatile) > > Same for REMAP2() macro below, for iowrite*(). Good point, thanks! Best regards, Krzysztof