[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <64659f77-f807-7c8e-7595-731056c73bf4@intel.com>
Date: Wed, 8 Jan 2020 13:29:08 -0700
From: Dave Jiang <dave.jiang@...el.com>
To: Krzysztof Kozlowski <krzk@...nel.org>,
Richard Henderson <rth@...ddle.net>,
Ivan Kokshaysky <ink@...assic.park.msu.ru>,
Matt Turner <mattst88@...il.com>,
Alexey Brodkin <abrodkin@...opsys.com>,
Vineet Gupta <vgupta@...opsys.com>,
"James E.J. Bottomley" <James.Bottomley@...senPartnership.com>,
Helge Deller <deller@....de>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>,
Michael Ellerman <mpe@...erman.id.au>,
Yoshinori Sato <ysato@...rs.sourceforge.jp>,
Rich Felker <dalias@...c.org>,
Dave Airlie <airlied@...hat.com>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
Ben Skeggs <bskeggs@...hat.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Jiri Slaby <jirislaby@...il.com>,
Nick Kossifidis <mickflemm@...il.com>,
Luis Chamberlain <mcgrof@...nel.org>,
Kalle Valo <kvalo@...eaurora.org>,
"David S. Miller" <davem@...emloft.net>,
Jon Mason <jdmason@...zu.us>, Allen Hubbe <allenbh@...il.com>,
"Michael S. Tsirkin" <mst@...hat.com>,
Jason Wang <jasowang@...hat.com>,
Arnd Bergmann <arnd@...db.de>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Thomas Gleixner <tglx@...utronix.de>,
linux-alpha@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-snps-arc@...ts.infradead.org, linux-parisc@...r.kernel.org,
linuxppc-dev@...ts.ozlabs.org, linux-sh@...r.kernel.org,
dri-devel@...ts.freedesktop.org, nouveau@...ts.freedesktop.org,
linux-media@...r.kernel.org, linux-wireless@...r.kernel.org,
netdev@...r.kernel.org, linux-ntb@...glegroups.com,
virtualization@...ts.linux-foundation.org,
linux-arch@...r.kernel.org
Subject: Re: [PATCH v2 3/9] ntb: intel: Constify ioreadX() iomem argument (as
in generic implementation)
On 1/8/20 1:05 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 <krzk@...nel.org>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@...der.be>
Acked-by: Dave Jiang <dave.jiang@...el.com>
>
> ---
>
> Changes since v1:
> 1. Add Geert's review.
> ---
> drivers/ntb/hw/intel/ntb_hw_gen1.c | 2 +-
> drivers/ntb/hw/intel/ntb_hw_gen3.h | 2 +-
> drivers/ntb/hw/intel/ntb_hw_intel.h | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/ntb/hw/intel/ntb_hw_gen1.c b/drivers/ntb/hw/intel/ntb_hw_gen1.c
> index bb57ec239029..9202502a9787 100644
> --- a/drivers/ntb/hw/intel/ntb_hw_gen1.c
> +++ b/drivers/ntb/hw/intel/ntb_hw_gen1.c
> @@ -1202,7 +1202,7 @@ int intel_ntb_peer_spad_write(struct ntb_dev *ntb, int pidx, int sidx,
> ndev->peer_reg->spad);
> }
>
> -static u64 xeon_db_ioread(void __iomem *mmio)
> +static u64 xeon_db_ioread(const void __iomem *mmio)
> {
> return (u64)ioread16(mmio);
> }
> diff --git a/drivers/ntb/hw/intel/ntb_hw_gen3.h b/drivers/ntb/hw/intel/ntb_hw_gen3.h
> index 75fb86ca27bb..d1455f24ec99 100644
> --- a/drivers/ntb/hw/intel/ntb_hw_gen3.h
> +++ b/drivers/ntb/hw/intel/ntb_hw_gen3.h
> @@ -91,7 +91,7 @@
> #define GEN3_DB_TOTAL_SHIFT 33
> #define GEN3_SPAD_COUNT 16
>
> -static inline u64 gen3_db_ioread(void __iomem *mmio)
> +static inline u64 gen3_db_ioread(const void __iomem *mmio)
> {
> return ioread64(mmio);
> }
> diff --git a/drivers/ntb/hw/intel/ntb_hw_intel.h b/drivers/ntb/hw/intel/ntb_hw_intel.h
> index e071e28bca3f..3c0a5a2da241 100644
> --- a/drivers/ntb/hw/intel/ntb_hw_intel.h
> +++ b/drivers/ntb/hw/intel/ntb_hw_intel.h
> @@ -102,7 +102,7 @@ struct intel_ntb_dev;
> struct intel_ntb_reg {
> int (*poll_link)(struct intel_ntb_dev *ndev);
> int (*link_is_up)(struct intel_ntb_dev *ndev);
> - u64 (*db_ioread)(void __iomem *mmio);
> + u64 (*db_ioread)(const void __iomem *mmio);
> void (*db_iowrite)(u64 db_bits, void __iomem *mmio);
> unsigned long ntb_ctl;
> resource_size_t db_size;
>
Powered by blists - more mailing lists