lib/int_sqrt: adjust comments
authorPeter Zijlstra <[email protected]>
Fri, 17 Nov 2017 23:28:12 +0000 (15:28 -0800)
committerLinus Torvalds <[email protected]>
Sat, 18 Nov 2017 00:10:01 +0000 (16:10 -0800)
Our current int_sqrt() is not rough nor any approximation; it calculates
the exact value of: floor(sqrt()).  Document this.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Acked-by: Linus Torvalds <[email protected]>
Cc: Anshul Garg <[email protected]>
Cc: Davidlohr Bueso <[email protected]>
Cc: David Miller <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Joe Perches <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Cc: Michael Davidson <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Will Deacon <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
lib/int_sqrt.c

index 67bb300b5b46735995658d0b5e355aee79b16183..e2d329099bf7483d2f09f48ade59e834cd6b7555 100644 (file)
 #include <linux/bitops.h>
 
 /**
- * int_sqrt - rough approximation to sqrt
+ * int_sqrt - computes the integer square root
  * @x: integer of which to calculate the sqrt
  *
- * A very rough approximation to the sqrt() function.
+ * Computes: floor(sqrt(x))
  */
 unsigned long int_sqrt(unsigned long x)
 {