]> git.pld-linux.org Git - packages/kernel.git/blob - kernel-gcc31.patch
- more strict values parser
[packages/kernel.git] / kernel-gcc31.patch
1 diff -ur linux-/include/asm-i386/bitops.h linux/include/asm-i386/bitops.h
2 --- linux-/include/asm-i386/bitops.h    Thu Nov 22 20:46:18 2001
3 +++ linux/include/asm-i386/bitops.h     Tue Mar  5 21:08:15 2002
4 @@ -316,6 +316,8 @@
5         return (offset + set + res);
6  }
7  
8 +#include <linux/bitops.h>
9 +
10  /**
11   * ffz - find first zero in word.
12   * @word: The word to search
13 @@ -447,13 +447,19 @@
14   */
15  static __inline__ int ffs(int x)
16  {
17 -       int r;
18 -
19 -       __asm__("bsfl %1,%0\n\t"
20 -               "jnz 1f\n\t"
21 -               "movl $-1,%0\n"
22 -               "1:" : "=r" (r) : "rm" (x));
23 -       return r+1;
24 +       /* The generic_ffs function is used to avoid the asm when the
25 +          argument is a constant.  */
26 +       if (__builtin_constant_p (x)) {
27 +               return generic_ffs (x);
28 +       } else {
29 +               int r;
30 +               
31 +               __asm__("bsfl %1,%0\n\t"
32 +                       "jnz 1f\n\t"
33 +                       "movl $-1,%0\n"
34 +                       "1:" : "=r" (r) : "rm" (x));
35 +               return r+1;
36 +       }
37  }
38  
39  /**
This page took 0.030657 seconds and 3 git commands to generate.