. pci driver now returns devices, even when they have been pci_reserve()d
[minix3.git] / lib / other / ffs.c
blobbae6947a8ad5824e1b1b3f9412d69cf4ed4bde7c
1 #include <lib.h>
2 /* ffs(3)
4 * Author: Terrence W. Holm Sep. 1988
5 */
6 _PROTOTYPE( int ffs, (int word));
8 int ffs(word)
9 int word;
11 int i;
13 if (word == 0) return(0);
15 for (i = 1;; ++i, word >>= 1)
16 if (word & 1) return(i);