Re: [PATCH 3/6] powerpc: add memory map support to Freescale RapidIO block
From: Li Yang <hidden>
Date: 2009-05-21 10:43:33
Also in:
lkml, netdev
From: Li Yang <hidden>
Date: 2009-05-21 10:43:33
Also in:
lkml, netdev
On Wed, May 13, 2009 at 6:05 AM, Andrew Morton [off-list ref] wrote:
On Tue, 12 May 2009 16:36:00 +0800 Li Yang [off-list ref] wrote:quoted
+ =C2=A0 =C2=A0 align =3D (size < 0x1000) ? 0x1000 : 1 << (__ilog2(size =
- 1) + 1);
quoted
+ + =C2=A0 =C2=A0 /* Align the size */ + =C2=A0 =C2=A0 if ((lstart + size) > (_ALIGN_DOWN(lstart, align) + alig=
n)) {__ilog2() and _ALIGN_DOWN() are powerpc-specific functions. =C2=A0It woul=
d
be preferable to use more general helpers if possible. =C2=A0ALIGN() and =
ilog2()
might suit here.
Will change to use ilog2(). _ALIGN_DOWN() gets a lower aligned address while ALIGN() gets a higher address. It seems that we don't have a general helper to do the same. - Leo