projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
checkpatch: warn on #defines ending in semicolon
[firefly-linux-kernel-4.4.55.git]
/
lib
/
gcd.c
diff --git
a/lib/gcd.c
b/lib/gcd.c
index cce4f3cd14b36f1511b7372a5c8a8106b9495437..3657f129d7b8c5db0bee11a94a97d5d4bf251b52 100644
(file)
--- a/
lib/gcd.c
+++ b/
lib/gcd.c
@@
-9,6
+9,9
@@
unsigned long gcd(unsigned long a, unsigned long b)
if (a < b)
swap(a, b);
+
+ if (!b)
+ return a;
while ((r = a % b) != 0) {
a = b;
b = r;