[PATCH 5/5] lib/math: remove int_pow()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



No users left.

Signed-off-by: Rasmus Villemoes <linux@xxxxxxxxxxxxxxxxxx>
---
 Documentation/core-api/kernel-api.rst |  3 ---
 include/linux/kernel.h                |  1 -
 lib/math/Makefile                     |  2 +-
 lib/math/int_pow.c                    | 32 ---------------------------
 4 files changed, 1 insertion(+), 37 deletions(-)
 delete mode 100644 lib/math/int_pow.c

diff --git a/Documentation/core-api/kernel-api.rst b/Documentation/core-api/kernel-api.rst
index 08af5caf036d..5f9cf47581b3 100644
--- a/Documentation/core-api/kernel-api.rst
+++ b/Documentation/core-api/kernel-api.rst
@@ -144,9 +144,6 @@ Base 2 log and power Functions
 Integer power Functions
 -----------------------
 
-.. kernel-doc:: lib/math/int_pow.c
-   :export:
-
 .. kernel-doc:: lib/math/int_sqrt.c
    :export:
 
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 4fa360a13c1e..afe7c2cc81aa 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -487,7 +487,6 @@ extern int __kernel_text_address(unsigned long addr);
 extern int kernel_text_address(unsigned long addr);
 extern int func_ptr_is_kernel_text(void *ptr);
 
-u64 int_pow(u64 base, unsigned int exp);
 unsigned long int_sqrt(unsigned long);
 
 #if BITS_PER_LONG < 64
diff --git a/lib/math/Makefile b/lib/math/Makefile
index be6909e943bd..3e5db680a404 100644
--- a/lib/math/Makefile
+++ b/lib/math/Makefile
@@ -1,5 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0-only
-obj-y += div64.o gcd.o lcm.o int_pow.o int_sqrt.o reciprocal_div.o
+obj-y += div64.o gcd.o lcm.o int_sqrt.o reciprocal_div.o
 
 obj-$(CONFIG_CORDIC)		+= cordic.o
 obj-$(CONFIG_PRIME_NUMBERS)	+= prime_numbers.o
diff --git a/lib/math/int_pow.c b/lib/math/int_pow.c
deleted file mode 100644
index 622fc1ab3c74..000000000000
--- a/lib/math/int_pow.c
+++ /dev/null
@@ -1,32 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * An integer based power function
- *
- * Derived from drivers/video/backlight/pwm_bl.c
- */
-
-#include <linux/export.h>
-#include <linux/kernel.h>
-#include <linux/types.h>
-
-/**
- * int_pow - computes the exponentiation of the given base and exponent
- * @base: base which will be raised to the given power
- * @exp: power to be raised to
- *
- * Computes: pow(base, exp), i.e. @base raised to the @exp power
- */
-u64 int_pow(u64 base, unsigned int exp)
-{
-	u64 result = 1;
-
-	while (exp) {
-		if (exp & 1)
-			result *= base;
-		exp >>= 1;
-		base *= base;
-	}
-
-	return result;
-}
-EXPORT_SYMBOL_GPL(int_pow);
-- 
2.20.1




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux