Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6159905rwl; Tue, 4 Apr 2023 08:36:47 -0700 (PDT) X-Google-Smtp-Source: AKy350bv6KbmvbYve47jQtqc92lzLjXnqhhFJTWJg07zZjqailLUwP0y6Eg7AihuZRTpR+VA0grJ X-Received: by 2002:a17:902:e294:b0:1a1:8edc:c5f8 with SMTP id o20-20020a170902e29400b001a18edcc5f8mr2419237plc.56.1680622606919; Tue, 04 Apr 2023 08:36:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680622606; cv=none; d=google.com; s=arc-20160816; b=BtAGxOHzVklOSFplcBUsSmYGPMo+IWgsI1Qp/bSckbD43Er9t4psAHmqAp5DQ2qD+6 Mm7rtzIsIwZ53QoYP9DtAqZDnfukuWTMwDBmbNfvZenbFZaFyVY3U8WpoaCP4uA1d47k cw4c3z1uQLoY+7VXtP8t4D+N7g87kBrj57y+xkbXadEVlHFqA0xulj+8FQgo5rKG1cJy F0c3piWEHLuIlBoRTw2fHsmc5dKRmge5YlvLK7OPgqUCdFIOND78zsjqYzkexzvrdxTx wCmmNiz0TILpLCMi+NWLnNPNVNv2kmo825PUTpp4uv7E+fmlyI/ZQPt2/Hu/qYzNO6rG JBoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=9gzOTfsfAZueYDByh8+01A/b5cP1WPhi6uJcVONdFPU=; b=wmMjIZSFertmUP8yGUfR4ggtlGPluvp4ReC4KHCLIiksy0uoyVfa0965q+kbuQjjpY rB6eMJ7BtskyUe2AeGoEooswKHy26gkQ/dmQfMmTmHy4hQCX780kCJcebWqSv6hGzHbh 6g2g2eTSKLDAbnnZVKfFZv8ZOEgMaKKb0BEPVl21dymPNuEwj/srPaEB3iJh/EYQZ71N cCcD1YIrv0n4Nr3Ipig/XC7GTwedzidEeIlllm5rrfgW6WdwueXq5yqFVzoVkUFs/QsP CZ+THugSW7I3ZLlRVoavwMVqsgEAYvl+BXXD1+3VMcU7lN6cXdgIRQpAG5cksBRIcO8x mU+g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x4-20020a17090a9dc400b0023b3729bcbfsi10411728pjv.6.2023.04.04.08.36.34; Tue, 04 Apr 2023 08:36:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235671AbjDDPfU (ORCPT + 99 others); Tue, 4 Apr 2023 11:35:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235640AbjDDPfT (ORCPT ); Tue, 4 Apr 2023 11:35:19 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBCC83C04; Tue, 4 Apr 2023 08:35:16 -0700 (PDT) Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4PrWyq6t9tz67QSs; Tue, 4 Apr 2023 23:34:27 +0800 (CST) Received: from localhost (10.122.247.231) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 4 Apr 2023 16:35:14 +0100 Date: Tue, 4 Apr 2023 16:35:13 +0100 From: Jonathan Cameron To: Vladimir Oltean CC: Arnd Bergmann , , Subject: Re: [PATCH 1/2] asm-generic/io.h: suppress endianness warnings for readq() and writeq() Message-ID: <20230404163513.00003b9f@huawei.com> In-Reply-To: <20230109131153.991322-1-vladimir.oltean@nxp.com> References: <20230109131153.991322-1-vladimir.oltean@nxp.com> Organization: Huawei Technologies R&D (UK) Ltd. X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.29; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.122.247.231] X-ClientProxiedBy: lhrpeml100006.china.huawei.com (7.191.160.224) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 9 Jan 2023 15:11:52 +0200 Vladimir Oltean wrote: > 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 > Signed-off-by: Vladimir Oltean Found this when about to send an equivalent patch. Not seeing this in linux-next yet and would be good to clean the resulting warnings up. Reviewed-by: Jonathan Cameron > --- > 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 4c44a29b5e8e..d78c3056c98f 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_); > }