From 9f6158946987a5ce3f16da097d18f240a89db417 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Tue, 14 May 2019 15:43:08 -0700 Subject: lib/math: move int_pow() from pwm_bl.c for wider use The integer exponentiation is used in few places and might be used in the future by other call sites. Move it to wider use. Link: http://lkml.kernel.org/r/20190323172531.80025-2-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Cc: Daniel Thompson Cc: Lee Jones Cc: Ray Jui Cc: Thierry Reding Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/video/backlight/pwm_bl.c | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index 53b8ceea9bde..fb45f866b923 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -155,21 +155,6 @@ static const struct backlight_ops pwm_backlight_ops = { #ifdef CONFIG_OF #define PWM_LUMINANCE_SCALE 10000 /* luminance scale */ -/* An integer based power function */ -static u64 int_pow(u64 base, int exp) -{ - u64 result = 1; - - while (exp) { - if (exp & 1) - result *= base; - exp >>= 1; - base *= base; - } - - return result; -} - /* * CIE lightness to PWM conversion. * -- cgit v1.2.3-59-g8ed1b