public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Vladimir Oltean <vladimir.oltean@nxp.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	Sasha Levin <sashal@kernel.org>,
	linux-arch@vger.kernel.org
Subject: [PATCH AUTOSEL 6.2 18/20] asm-generic/io.h: suppress endianness warnings for readq() and writeq()
Date: Wed, 12 Apr 2023 22:35:56 -0400	[thread overview]
Message-ID: <20230413023601.74410-18-sashal@kernel.org> (raw)
In-Reply-To: <20230413023601.74410-1-sashal@kernel.org>

From: Vladimir Oltean <vladimir.oltean@nxp.com>

[ 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@app.fastmail.com/
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 include/asm-generic/io.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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_);
 }
-- 
2.39.2


  parent reply	other threads:[~2023-04-13  2:38 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-13  2:35 [PATCH AUTOSEL 6.2 01/20] ASOC: Intel: sof_sdw: add quirk for Intel 'Rooks County' NUC M15 Sasha Levin
2023-04-13  2:35 ` [PATCH AUTOSEL 6.2 02/20] ASoC: Intel: soc-acpi: add table " Sasha Levin
2023-04-13  2:35 ` [PATCH AUTOSEL 6.2 03/20] ASoC: soc-pcm: fix hw->formats cleared by soc_pcm_hw_init() for dpcm Sasha Levin
2023-04-13  2:35 ` [PATCH AUTOSEL 6.2 04/20] x86/hyperv: Block root partition functionality in a Confidential VM Sasha Levin
2023-04-13  2:35 ` [PATCH AUTOSEL 6.2 05/20] ASoC: amd: yc: Add DMI entries to support Victus by HP Laptop 16-e1xxx (8A22) Sasha Levin
2023-04-13  2:35 ` [PATCH AUTOSEL 6.2 06/20] iio: adc: palmas_gpadc: fix NULL dereference on rmmod Sasha Levin
2023-04-13  2:35 ` [PATCH AUTOSEL 6.2 07/20] ASoC: Intel: bytcr_rt5640: Add quirk for the Acer Iconia One 7 B1-750 Sasha Levin
2023-04-13  2:35 ` [PATCH AUTOSEL 6.2 08/20] pwm: Zero-initialize the pwm_state passed to driver's .get_state() Sasha Levin
2023-04-13  2:35 ` [PATCH AUTOSEL 6.2 09/20] ASoC: da7213.c: add missing pm_runtime_disable() Sasha Levin
2023-04-13  2:35 ` [PATCH AUTOSEL 6.2 10/20] net: wwan: t7xx: do not compile with -Werror Sasha Levin
2023-04-13  2:35 ` [PATCH AUTOSEL 6.2 11/20] wifi: mt76: mt7921: Fix use-after-free in fw features query Sasha Levin
2023-04-13  2:35 ` [PATCH AUTOSEL 6.2 12/20] selftests mount: Fix mount_setattr_test builds failed Sasha Levin
2023-04-13  2:35 ` [PATCH AUTOSEL 6.2 13/20] scsi: mpi3mr: Handle soft reset in progress fault code (0xF002) Sasha Levin
2023-04-13  2:35 ` [PATCH AUTOSEL 6.2 14/20] net: sfp: add quirk enabling 2500Base-x for HG MXPD-483II Sasha Levin
2023-04-13  2:35 ` [PATCH AUTOSEL 6.2 15/20] platform/x86: thinkpad_acpi: Add missing T14s Gen1 type to s2idle quirk list Sasha Levin
2023-04-13  2:35 ` [PATCH AUTOSEL 6.2 16/20] wifi: ath11k: reduce the MHI timeout to 20s Sasha Levin
2023-04-13  2:35 ` [PATCH AUTOSEL 6.2 17/20] tracing: Error if a trace event has an array for a __field() Sasha Levin
2023-04-13  2:35 ` Sasha Levin [this message]
2023-04-13  2:35 ` [PATCH AUTOSEL 6.2 19/20] asm-generic/io.h: suppress endianness warnings for relaxed accessors Sasha Levin
2023-04-13  2:35 ` [PATCH AUTOSEL 6.2 20/20] x86/cpu: Add model number for Intel Arrow Lake processor Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230413023601.74410-18-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=arnd@arndb.de \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=vladimir.oltean@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox