Thread (22 messages) flat view 22 messages, 3 authors, 2024-04-24
STALE881d LANDED

Revision v2 of 2 in this series; landed in mainline as 5e5e51422cd1 on 2024-04-08.

Revisions (2)
  1. v1 [diff vs current]
  2. v2 current

[PATCH V2 04/19] math64: Tidy mul_u64_u32_shr()

From: Adrian Hunter <adrian.hunter@intel.com>
Date: 2024-03-25 06:41:05
Also in: linux-s390, lkml
Subsystem: the rest · Maintainer: Linus Torvalds

Put together declaration and initialization of local variables.

Suggested-by: Thomas Gleixner <redacted>
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
 include/linux/math64.h | 6 +-----
 1 file changed, 1 insertion(+), 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 */
-- 
2.34.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help