grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2] Fix __clzsi2 logic


From: Tuan Phan
Subject: [PATCH v2] Fix __clzsi2 logic
Date: Mon, 3 Oct 2022 11:29:21 -0700

Fix the incorrect return value of __clzsi2 function.

Fixes: e795b90 ("RISC-V: Add libgcc helpers for clz")
Signed-off-by: Tuan Phan <tphan@ventanamicro.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
---
V2: Drop redundant brackets
Signed-off-by: Tuan Phan <tphan@ventanamicro.com>
---
 grub-core/kern/compiler-rt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/grub-core/kern/compiler-rt.c b/grub-core/kern/compiler-rt.c
index 2057c2e0c..738bb8420 100644
--- a/grub-core/kern/compiler-rt.c
+++ b/grub-core/kern/compiler-rt.c
@@ -431,7 +431,7 @@ __clzsi2 (grub_uint32_t val)
 
   for (; j; j >>= 1)
     {
-      if ((temp = val) >> j)
+      if (temp = (val >> j))
         {
           if (j == 1)
             {
-- 
2.25.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]