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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EFB15C433FE for ; Fri, 30 Sep 2022 01:34:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229893AbiI3Beq (ORCPT ); Thu, 29 Sep 2022 21:34:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbiI3Bel (ORCPT ); Thu, 29 Sep 2022 21:34:41 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1488EA197 for ; Thu, 29 Sep 2022 18:34:37 -0700 (PDT) Received: from kwepemi500008.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Mdt495RgTzpSwb; Fri, 30 Sep 2022 09:31:37 +0800 (CST) Received: from [10.67.109.254] (10.67.109.254) by kwepemi500008.china.huawei.com (7.221.188.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 30 Sep 2022 09:34:35 +0800 Message-ID: <8ca0a577-67b1-a51e-2657-5a55e395d4d3@huawei.com> Date: Fri, 30 Sep 2022 09:34:34 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: [PATCH -next] powerpc/mpic_msgr: fix cast removes address space of expression warnings To: , , , , , , References: <20220901085416.204378-1-ruanjinjie@huawei.com> Content-Language: en-US From: Ruan Jinjie In-Reply-To: <20220901085416.204378-1-ruanjinjie@huawei.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.109.254] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemi500008.china.huawei.com (7.221.188.139) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ping. On 2022/9/1 16:54, ruanjinjie wrote: > When build Linux kernel, encounter the following warnings: > > ./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 assignment (different address spaces) > > 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. > > Signed-off-by: ruanjinjie > --- > arch/powerpc/sysdev/mpic_msgr.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/powerpc/sysdev/mpic_msgr.c b/arch/powerpc/sysdev/mpic_msgr.c > index 698fefaaa6dd..cbb0d24f15ba 100644 > --- a/arch/powerpc/sysdev/mpic_msgr.c > +++ b/arch/powerpc/sysdev/mpic_msgr.c > @@ -227,7 +227,7 @@ static int mpic_msgr_probe(struct platform_device *dev) > > reg_number = block_number * MPIC_MSGR_REGISTERS_PER_BLOCK + i; > msgr->base = msgr_block_addr + i * MPIC_MSGR_STRIDE; > - msgr->mer = (u32 *)((u8 *)msgr->base + MPIC_MSGR_MER_OFFSET); > + msgr->mer = (u32 __iomem *)((u8 __iomem *)msgr->base + MPIC_MSGR_MER_OFFSET); > msgr->in_use = MSGR_FREE; > msgr->num = i; > raw_spin_lock_init(&msgr->lock);