From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1239DC433F5 for ; Fri, 30 Sep 2022 07:26:21 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Mf1xS2THSz3cdM for ; Fri, 30 Sep 2022 17:26:20 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=eG0A5f5S; dkim-atps=neutral Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Mf1wr39Njz3bnY for ; Fri, 30 Sep 2022 17:25:48 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=eG0A5f5S; dkim-atps=neutral Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4Mf1wm6SD8z4x1V; Fri, 30 Sep 2022 17:25:44 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1664522747; bh=vldn3sCX6fLDQTDH63JsyZiUXyqsjpGMojYXIgEPshU=; h=From:To:Subject:In-Reply-To:References:Date:From; b=eG0A5f5SymRiSEQGqQ5aIP0vjmM5RtTOlCpAEM55fviuoC5HLicGq8JkNhJhEzoRt O9pInta3f1O79v8QsJkinR/VhUq5hCWO6nKtxdktUw0UVZHfU1LEwT4G6AOyIIM/aY wZzW9/ky/Qh84lH2yqxXCSoUgjZNWCpieKH4yOplyS6aEcvFz90O2bCi1TkAukuqo8 ngKyrscdFJ6kuI2TvxV5rXT2vr0/ZEhcjX4XHzLgEyjXrD5w/r/NO25gVal0bFDMv6 zMkWkClrQURX+e1M3axJFoJxnV1zaFKoLZv82357MZDMiHKaC2qt6vQaWcnnXEmUXq rKkYiLAi5DgaA== From: Michael Ellerman To: Christophe Leroy , ruanjinjie , "npiggin@gmail.com" , "joel@jms.id.au" , "Julia.Lawall@inria.fr" , "linuxppc-dev@lists.ozlabs.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH -next] powerpc/mpic_msgr: fix cast removes address space of expression warnings In-Reply-To: <4d3b7f83-498e-deb2-ce2a-c17d4b22a078@csgroup.eu> References: <20220901085416.204378-1-ruanjinjie@huawei.com> <4d3b7f83-498e-deb2-ce2a-c17d4b22a078@csgroup.eu> Date: Fri, 30 Sep 2022 17:25:39 +1000 Message-ID: <87sfk9pbm4.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Christophe Leroy writes: > Le 01/09/2022 =C3=A0 10:54, ruanjinjie a =C3=A9crit=C2=A0: >> [Vous ne recevez pas souvent de courriers de ruanjinjie@huawei.com. D=C3= =A9couvrez pourquoi ceci est important =C3=A0 https://aka.ms/LearnAboutSend= erIdentification ] >>=20 >> When build Linux kernel, encounter the following warnings: >>=20 >> ./arch/powerpc/sysdev/mpic_msgr.c:230:38: warning: cast removes address = space '__iomem' of expression >> ./arch/powerpc/sysdev/mpic_msgr.c:230:27: warning: incorrect type in ass= ignment (different address spaces) >>=20 >> The data type of msgr->mer and msgr->base are 'u32 __iomem *', but >> converted to 'u32 *' and 'u8 *' directly and cause above warnings, now >> recover their data types to fix these warnings. > > I think the best would be to change MPIC_MSGR_MER_OFFSET to 0x40 and=20 > then drop the casts completely: > > msgr->mer =3D msgr->base + MPIC_MSGR_MER_OFFSET; Or: #define MPIC_MSGR_MER_OFFSET (0x100 / sizeof(u32)) To document that it's 0x100 bytes, but the the offset is in units of u32. cheers