summaryrefslogtreecommitdiff
path: root/include/linux/math64.h
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2024-03-25 08:40:08 +0200
committerThomas Gleixner <tglx@linutronix.de>2024-04-08 15:03:06 +0200
commit5e5e51422cd189bc1b627f619f0f99324e6e4de9 (patch)
treef3f62abd4634a1dbef75cdf62601f974ef0828f2 /include/linux/math64.h
parent0c68458b0a5878d735572b4f4d91219a1db7c784 (diff)
math64: Tidy up mul_u64_u32_shr()
Put together declaration and initialization of local variables. Suggested-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/20240325064023.2997-5-adrian.hunter@intel.com
Diffstat (limited to 'include/linux/math64.h')
-rw-r--r--include/linux/math64.h6
1 files changed, 1 insertions, 5 deletions
diff --git a/include/linux/math64.h b/include/linux/math64.h
index bf74478926d4..fd13622b2056 100644
--- a/include/linux/math64.h
+++ b/include/linux/math64.h
@@ -179,16 +179,12 @@ static __always_inline u64 mul_u64_u64_shr(u64 a, u64 mul, unsigned int shift)
#ifndef mul_u64_u32_shr
static __always_inline u64 mul_u64_u32_shr(u64 a, u32 mul, unsigned int shift)
{
- u32 ah, al;
+ u32 ah = a >> 32, al = a;
u64 ret;
- al = a;
- ah = a >> 32;
-
ret = mul_u32_u32(al, mul) >> shift;
if (ah)
ret += mul_u32_u32(ah, mul) << (32 - shift);
-
return ret;
}
#endif /* mul_u64_u32_shr */