lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87sfk9pbm4.fsf@mpe.ellerman.id.au>
Date:   Fri, 30 Sep 2022 17:25:39 +1000
From:   Michael Ellerman <mpe@...erman.id.au>
To:     Christophe Leroy <christophe.leroy@...roup.eu>,
        ruanjinjie <ruanjinjie@...wei.com>,
        "npiggin@...il.com" <npiggin@...il.com>,
        "joel@....id.au" <joel@....id.au>,
        "Julia.Lawall@...ia.fr" <Julia.Lawall@...ia.fr>,
        "linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -next] powerpc/mpic_msgr: fix cast removes address space
 of expression warnings

Christophe Leroy <christophe.leroy@...roup.eu> writes:
> Le 01/09/2022 à 10:54, ruanjinjie a écrit :
>> [Vous ne recevez pas souvent de courriers de ruanjinjie@...wei.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ