]> git.karo-electronics.de Git - karo-tx-linux.git/commit
lib/gcd.c: prevent possible div by 0
authorDavidlohr Bueso <dave@gnu.org>
Thu, 13 Sep 2012 01:01:12 +0000 (11:01 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 18 Sep 2012 06:04:38 +0000 (16:04 +1000)
commitbee7f26e2d43328f280b469622d0537631c4c18c
tree0dcd3ae103f557fe54679e76afff7452142e7bbe
parent7098c4c7096443a33d082beae5e5c4773744a4a6
lib/gcd.c: prevent possible div by 0

Account for all properties when a and/or b are 0:
gcd(0, 0) = 0
gcd(a, 0) = a
gcd(0, b) = b

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/gcd.c