lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20090601215034.7352ddca.akpm@linux-foundation.org>
Date:	Mon, 1 Jun 2009 21:50:34 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Florian Fainelli <florian@...nwrt.org>
Cc:	linux-kernel@...r.kernel.org, Takashi Iwai <tiwai@...e.de>,
	linux-mips@...ux-mips.org, Ralf Baechle <ralf@...ux-mips.org>,
	Ingo Molnar <mingo@...e.hu>
Subject: Re: [PATCH 1/9] kernel: export sound/core/pcm_timer.c gcd
 implementation

On Mon, 1 Jun 2009 13:57:09 +0200 Florian Fainelli <florian@...nwrt.org> wrote:

> This patch exports the gcd implementation from
> sound/core/pcm_timer.c into include/linux/kernel.h.
> AR7 uses it in its clock routines.
> 
> ...
>
> diff --git a/include/linux/kernel.h b/include/linux/kernel.h
> index 883cd44..878a27a 100644
> --- a/include/linux/kernel.h
> +++ b/include/linux/kernel.h
> @@ -147,6 +147,22 @@ extern int _cond_resched(void);
>  		(__x < 0) ? -__x : __x;		\
>  	})
>  
> +/* Greatest common divisor */
> +static inline unsigned long gcd(unsigned long a, unsigned long b)
> +{
> +        unsigned long r;
> +        if (a < b) {
> +                r = a;
> +                a = b;
> +                b = r;
> +        }
> +        while ((r = a % b) != 0) {
> +                a = b;
> +                b = r;
> +        }
> +        return b;
> +}

a) the name's a bit sucky.   Is there some convention for this name?

b) It looks too large to be inlined.  lib/gdc.c?

b) there's an implementation of gcd() in
   net/netfilter/ipvs/ip_vs_wrr.c.  I expect that this patch broke the
   build.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ