Re: [PATCH 1/7] AR7: core support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 3 Sep 2007, Thiemo Seufer wrote:
> Matteo Croce wrote:
> > +static int gcd(int x, int y)
> > +{
> > +	if (x > y)
> > +		return (x % y) ? gcd(y, x % y) : y;
> > +	return (y % x) ? gcd(x, y % x) : x;
> > +}

Ugh, recursion...

> > +static inline int ABS(int x)
> > +{
> > +	return (x >= 0) ? x : -x;
> > +}
> 
> Isn't that already available in the generic kernel code?

abs() is in <linux/kernel.h>

gcd() is in net/ipv4/ipvs/ip_vs_wrr.c (case a > b only) and
sound/core/pcm-timer.c (both).

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux