Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ntb: intel: constify ioreadX() iomem argument (as in generic implementation)

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@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Dave Jiang <dave.jiang@intel.com>
Cc: Allen Hubbe <allenbh@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Helge Deller <deller@gmx.de>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Jon Mason <jdmason@kudzu.us>
Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Rich Felker <dalias@libc.org>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Link: http://lkml.kernel.org/r/20200709072837.5869-4-krzk@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Krzysztof Kozlowski and committed by
Linus Torvalds
58184e95 5ca6ad7d

+3 -3
+1 -1
drivers/ntb/hw/intel/ntb_hw_gen1.c
··· 1205 1205 ndev->peer_reg->spad); 1206 1206 } 1207 1207 1208 - static u64 xeon_db_ioread(void __iomem *mmio) 1208 + static u64 xeon_db_ioread(const void __iomem *mmio) 1209 1209 { 1210 1210 return (u64)ioread16(mmio); 1211 1211 }
+1 -1
drivers/ntb/hw/intel/ntb_hw_gen3.h
··· 91 91 #define GEN3_DB_TOTAL_SHIFT 33 92 92 #define GEN3_SPAD_COUNT 16 93 93 94 - static inline u64 gen3_db_ioread(void __iomem *mmio) 94 + static inline u64 gen3_db_ioread(const void __iomem *mmio) 95 95 { 96 96 return ioread64(mmio); 97 97 }
+1 -1
drivers/ntb/hw/intel/ntb_hw_intel.h
··· 103 103 struct intel_ntb_reg { 104 104 int (*poll_link)(struct intel_ntb_dev *ndev); 105 105 int (*link_is_up)(struct intel_ntb_dev *ndev); 106 - u64 (*db_ioread)(void __iomem *mmio); 106 + u64 (*db_ioread)(const void __iomem *mmio); 107 107 void (*db_iowrite)(u64 db_bits, void __iomem *mmio); 108 108 unsigned long ntb_ctl; 109 109 resource_size_t db_size;