]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
ntb: intel: constify ioreadX() iomem argument (as in generic implementation)
authorKrzysztof Kozlowski <krzk@kernel.org>
Sat, 15 Aug 2020 00:32:15 +0000 (17:32 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 15 Aug 2020 02:56:57 +0000 (19:56 -0700)
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>
drivers/ntb/hw/intel/ntb_hw_gen1.c
drivers/ntb/hw/intel/ntb_hw_gen3.h
drivers/ntb/hw/intel/ntb_hw_intel.h

index 423f9b8fbbcf5e741dfc004d181188d16fcb9b26..3185efeab487ba6f93dc3d699b6abf68536e203b 100644 (file)
@@ -1205,7 +1205,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);
 }
index 2bc5d83560455e33d3884f92ae31e543bc66c63f..dea93989942d5a5a30adb4b121162a467078c050 100644 (file)
@@ -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);
 }
index d61fcd91714bbc0dd28a284275f8dde2d746c1cf..05e2335c9596b28f0c7bba8ada2c42d0675739b6 100644 (file)
@@ -103,7 +103,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;