https://github.com/torvalds/linux
Revision c660439ba90aaaa056f68a5b0fc79f6b9e0506f5 authored by Ravikiran G Thirumalai on 22 December 2005, 22:21:34 UTC, committed by Linus Torvalds on 24 December 2005, 20:30:22 UTC
Fixes a compiler error in node_to_first_cpu, __ffs expects unsigned long as
a parameter; instead cpumask_t was being passed.  The macro
node_to_first_cpu was not yet used in x86_64 and ia64 arches, and so we never
hit this.  This patch replaces __ffs with first_cpu macro, similar to other
arches.

Signed-off-by: Alok N Kataria <alokk@calsoftinc.com>
Signed-off-by: Ravikiran G Thirumalai <kiran@scalex86.org>
Signed-off-by: Shai Fultheim <shai@scalex86.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent 1224b37
Raw File
Tip revision: c660439ba90aaaa056f68a5b0fc79f6b9e0506f5 authored by Ravikiran G Thirumalai on 22 December 2005, 22:21:34 UTC
[PATCH] x86_64/ia64 : Fix compilation error for node_to_first_cpu
Tip revision: c660439
int_sqrt.c

#include <linux/kernel.h>
#include <linux/module.h>

/**
 * int_sqrt - rough approximation to sqrt
 * @x: integer of which to calculate the sqrt
 *
 * A very rough approximation to the sqrt() function.
 */
unsigned long int_sqrt(unsigned long x)
{
	unsigned long op, res, one;

	op = x;
	res = 0;

	one = 1 << 30;
	while (one > op)
		one >>= 2;

	while (one != 0) {
		if (op >= res + one) {
			op = op - (res + one);
			res = res +  2 * one;
		}
		res /= 2;
		one /= 4;
	}
	return res;
}
EXPORT_SYMBOL(int_sqrt);
back to top