Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

authored by

Adrian Hunter and committed by
Thomas Gleixner
5e5e5142 0c68458b

+1 -5
+1 -5
include/linux/math64.h
··· 179 179 #ifndef mul_u64_u32_shr 180 180 static __always_inline u64 mul_u64_u32_shr(u64 a, u32 mul, unsigned int shift) 181 181 { 182 - u32 ah, al; 182 + u32 ah = a >> 32, al = a; 183 183 u64 ret; 184 - 185 - al = a; 186 - ah = a >> 32; 187 184 188 185 ret = mul_u32_u32(al, mul) >> shift; 189 186 if (ah) 190 187 ret += mul_u32_u32(ah, mul) << (32 - shift); 191 - 192 188 return ret; 193 189 } 194 190 #endif /* mul_u64_u32_shr */