"linux-os (Dick Johnson)" <[EMAIL PROTECTED]> writes:
> Executing this script.
>
> cat #include
>
> #define IS_ALIGNED(x,a) (((x) % ((typeof(x))(a))) == 0)
> #define _IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0)
>
> int main()
> {
> int i;
>
On Tue, 20 Nov 2007, Richard B. Johnson wrote:
> On Tue, 20 Nov 2007, Herbert Xu wrote:
>
>> Hi:
>>
>> [KERNEL]: Avoid divide in IS_ALIGN
>>
>> I was happy to discover the brand new IS_ALIGN macro and quickly
>> used it in my code. To my dismay I foun
On Tue, 20 Nov 2007, Herbert Xu wrote:
> Hi:
>
> [KERNEL]: Avoid divide in IS_ALIGN
>
> I was happy to discover the brand new IS_ALIGN macro and quickly
> used it in my code. To my dismay I found that the generated code
> used division to perform the test.
>
> This
On Tue, 20 Nov 2007 10:17:15 -0800
Joe Perches <[EMAIL PROTECTED]> wrote:
> On Tue, 2007-11-20 at 21:56 +0800, Herbert Xu wrote:
> > [KERNEL]: Avoid divide in IS_ALIGN
> > I was happy to discover the brand new IS_ALIGN macro and quickly
> > used it in my code. To
On Tue, 2007-11-20 at 21:56 +0800, Herbert Xu wrote:
> [KERNEL]: Avoid divide in IS_ALIGN
> I was happy to discover the brand new IS_ALIGN macro and quickly
> used it in my code. To my dismay I found that the generated code
> used division to perform the test.
> This patch fixes
Hi:
[KERNEL]: Avoid divide in IS_ALIGN
I was happy to discover the brand new IS_ALIGN macro and quickly
used it in my code. To my dismay I found that the generated code
used division to perform the test.
This patch fixes it by changing the % test to an &. This avoids
the division.
Signed
6 matches
Mail list logo