repo.or.cz
/
minix3.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
. pci driver now returns devices, even when they have been pci_reserve()d
[minix3.git]
/
lib
/
other
/
ffs.c
blob
bae6947a8ad5824e1b1b3f9412d69cf4ed4bde7c
1
#include <lib.h>
2
/* ffs(3)
3
*
4
* Author: Terrence W. Holm Sep. 1988
5
*/
6
_PROTOTYPE
(
int
ffs
, (
int
word
));
7
8
int
ffs
(
word
)
9
int
word
;
10
{
11
int
i
;
12
13
if
(
word
==
0
)
return
(
0
);
14
15
for
(
i
=
1
;; ++
i
,
word
>>=
1
)
16
if
(
word
&
1
)
return
(
i
);
17
}