cregit-Linux how code gets into the kernel

Release 4.13 lib/int_sqrt.c

Directory: lib
/*
 * Copyright (C) 2013 Davidlohr Bueso <davidlohr.bueso@hp.com>
 *
 *  Based on the shift-and-subtract algorithm for computing integer
 *  square root from Guy L. Steele.
 */

#include <linux/kernel.h>
#include <linux/export.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 b, m, y = 0; if (x <= 1) return x; m = 1UL << (BITS_PER_LONG - 2); while (m != 0) { b = y + m; y >>= 1; if (x >= b) { x -= b; y += m; } m >>= 2; } return y; }

Contributors

PersonTokensPropCommitsCommitProp
Andrew Morton3847.50%133.33%
Davidlohr Bueso A3645.00%133.33%
Peter Williams67.50%133.33%
Total80100.00%3100.00%

EXPORT_SYMBOL(int_sqrt);

Overall Contributors

PersonTokensPropCommitsCommitProp
Andrew Morton4952.69%125.00%
Davidlohr Bueso A3739.78%125.00%
Peter Williams66.45%125.00%
Paul Gortmaker11.08%125.00%
Total93100.00%4100.00%
Directory: lib
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.