mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
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/[email protected] Signed-off-by: Andy Shevchenko <[email protected]> Cc: Daniel Thompson <[email protected]> Cc: Lee Jones <[email protected]> Cc: Ray Jui <[email protected]> Cc: Thierry Reding <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
2c64e9cb0b
commit
9f61589469
4 changed files with 34 additions and 16 deletions
|
|
@ -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.
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in a new issue