Re: [PATCH 2/5] powerpc: Replace _ALIGN_DOWN() by ALIGN_DOWN()
From: Segher Boessenkool <hidden>
Date: 2020-04-21 15:56:02
Also in:
alsa-devel, dri-devel, kvm, linux-fbdev, lkml
From: Segher Boessenkool <hidden>
Date: 2020-04-21 15:56:02
Also in:
alsa-devel, dri-devel, kvm, linux-fbdev, lkml
Hi! On Tue, Apr 21, 2020 at 01:04:05AM +0000, Joel Stanley wrote:
On Mon, 20 Apr 2020 at 18:38, Christophe Leroy [off-list ref] wrote:quoted
_ALIGN_DOWN() is specific to powerpc ALIGN_DOWN() is generic and does the same Replace _ALIGN_DOWN() by ALIGN_DOWN()This one is a bit less obvious. It becomes (leaving the typeof's alone for clarity): -((addr)&(~((typeof(addr))(size)-1))) +((((addr) - ((size) - 1)) + ((typeof(addr))(size) - 1)) & ~((typeof(addr))(size)-1)) Which I assume the compiler will sort out?
[ This is line-wrapped, something in your mailer? Took me a bit to figure out the - and + are diff -u things :-) ] In the common case where size is a constant integer power of two, the compiler will have no problem with this. But why do so complicated? Why are the casts there, btw? Segher