Commit e813a614 authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Linus Torvalds

lib/int_sqrt: adjust comments

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/20171020164645.001652117@infradead.orgSigned-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Cc: Anshul Garg <aksgarg1989@gmail.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: David Miller <davem@davemloft.net>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Joe Perches <joe@perches.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Matthew Wilcox <mawilcox@microsoft.com>
Cc: Michael Davidson <md@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent f8ae107e
...@@ -11,10 +11,10 @@ ...@@ -11,10 +11,10 @@
#include <linux/bitops.h> #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 * @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) unsigned long int_sqrt(unsigned long x)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment