Patch "asm-generic/io.h: suppress endianness warnings for readq() and writeq()" has been added to the 6.2-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    asm-generic/io.h: suppress endianness warnings for readq() and writeq()

to the 6.2-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     asm-generic-io.h-suppress-endianness-warnings-for-re.patch
and it can be found in the queue-6.2 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 261846f72d74f9dde2a1621107f0420cc1015629
Author: Vladimir Oltean <vladimir.oltean@xxxxxxx>
Date:   Mon Jan 9 15:11:52 2023 +0200

    asm-generic/io.h: suppress endianness warnings for readq() and writeq()
    
    [ Upstream commit d564fa1ff19e893e2971d66e5c8f49dc1cdc8ffc ]
    
    Commit c1d55d50139b ("asm-generic/io.h: Fix sparse warnings on
    big-endian architectures") missed fixing the 64-bit accessors.
    
    Arnd explains in the attached link why the casts are necessary, even if
    __raw_readq() and __raw_writeq() do not take endian-specific types.
    
    Link: https://lore.kernel.org/lkml/9105d6fc-880b-4734-857d-e3d30b87ccf6@xxxxxxxxxxxxxxxx/
    Suggested-by: Arnd Bergmann <arnd@xxxxxxxx>
    Signed-off-by: Vladimir Oltean <vladimir.oltean@xxxxxxx>
    Reviewed-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>
    Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
index 4c44a29b5e8ef..d78c3056c98f9 100644
--- a/include/asm-generic/io.h
+++ b/include/asm-generic/io.h
@@ -236,7 +236,7 @@ static inline u64 readq(const volatile void __iomem *addr)
 
 	log_read_mmio(64, addr, _THIS_IP_, _RET_IP_);
 	__io_br();
-	val = __le64_to_cpu(__raw_readq(addr));
+	val = __le64_to_cpu((__le64 __force)__raw_readq(addr));
 	__io_ar(val);
 	log_post_read_mmio(val, 64, addr, _THIS_IP_, _RET_IP_);
 	return val;
@@ -287,7 +287,7 @@ static inline void writeq(u64 value, volatile void __iomem *addr)
 {
 	log_write_mmio(value, 64, addr, _THIS_IP_, _RET_IP_);
 	__io_bw();
-	__raw_writeq(__cpu_to_le64(value), addr);
+	__raw_writeq((u64 __force)__cpu_to_le64(value), addr);
 	__io_aw();
 	log_post_write_mmio(value, 64, addr, _THIS_IP_, _RET_IP_);
 }



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux