From: Michael Ellerman <mpe@ellerman.id.au>
To: Christophe Leroy <christophe.leroy@csgroup.eu>,
ruanjinjie <ruanjinjie@huawei.com>,
"npiggin@gmail.com" <npiggin@gmail.com>,
"joel@jms.id.au" <joel@jms.id.au>,
"Julia.Lawall@inria.fr" <Julia.Lawall@inria.fr>,
"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH -next] powerpc/mpic_msgr: fix cast removes address space of expression warnings
Date: Fri, 30 Sep 2022 17:25:39 +1000 [thread overview]
Message-ID: <87sfk9pbm4.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <4d3b7f83-498e-deb2-ce2a-c17d4b22a078@csgroup.eu>
Christophe Leroy <christophe.leroy@csgroup.eu> writes:
> Le 01/09/2022 à 10:54, ruanjinjie a écrit :
>> [Vous ne recevez pas souvent de courriers de ruanjinjie@huawei.com. Découvrez pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ]
>>
>> 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.
>
> I think the best would be to change MPIC_MSGR_MER_OFFSET to 0x40 and
> then drop the casts completely:
>
> msgr->mer = 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
prev parent reply other threads:[~2022-09-30 7:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-01 8:54 [PATCH -next] powerpc/mpic_msgr: fix cast removes address space of expression warnings ruanjinjie
2022-09-30 1:34 ` Ruan Jinjie
2022-09-30 6:09 ` Christophe Leroy
2022-09-30 6:37 ` Ruan Jinjie
2022-09-30 7:25 ` Michael Ellerman [this message]
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=87sfk9pbm4.fsf@mpe.ellerman.id.au \
--to=mpe@ellerman.id.au \
--cc=Julia.Lawall@inria.fr \
--cc=christophe.leroy@csgroup.eu \
--cc=joel@jms.id.au \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=npiggin@gmail.com \
--cc=ruanjinjie@huawei.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