diff options
Diffstat (limited to 'newlib/libc/misc/ffs.c')
-rw-r--r-- | newlib/libc/misc/ffs.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/newlib/libc/misc/ffs.c b/newlib/libc/misc/ffs.c index 7fc38c8d8..ba5700920 100644 --- a/newlib/libc/misc/ffs.c +++ b/newlib/libc/misc/ffs.c @@ -29,18 +29,8 @@ No supporting OS subroutines are required. */ #include <strings.h> int -_DEFUN(ffs, (word), - int word) +ffs(int i) { - int i; - if (!word) - return 0; - - i = 0; - for (;;) - { - if (((1 << i++) & word) != 0) - return i; - } + return (__builtin_ffs(i)); } |