repo.or.cz
/
linux-2.6.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
memcg: always create memsw files if CONFIG_CGROUP_MEM_RES_CTLR_SWAP
[linux-2.6.git]
/
lib
/
gcd.c
blob
cce4f3cd14b36f1511b7372a5c8a8106b9495437
1
#include <linux/kernel.h>
2
#include <linux/gcd.h>
3
#include <linux/export.h>
4
5
/* Greatest common divisor */
6
unsigned long
gcd
(
unsigned long
a
,
unsigned long
b
)
7
{
8
unsigned long
r
;
9
10
if
(
a
<
b
)
11
swap
(
a
,
b
);
12
while
((
r
=
a
%
b
) !=
0
) {
13
a
=
b
;
14
b
=
r
;
15
}
16
return
b
;
17
}
18
EXPORT_SYMBOL_GPL
(
gcd
);