All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tuan Phan <tphan@ventanamicro.com>
Cc: grub-devel@gnu.org, Tuan Phan <tphan@ventanamicro.com>
Subject: [PATCH] Fix __clzsi2 logic
Date: Thu, 29 Sep 2022 15:00:26 -0700	[thread overview]
Message-ID: <20220929220026.29621-1-tphan@ventanamicro.com> (raw)

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>
---
 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..55ae9f97e 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	other threads:[~2022-09-30  1:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-29 22:00 Tuan Phan [this message]
2022-10-03 15:26 ` [PATCH] Fix __clzsi2 logic Daniel Kiper
2022-10-03 18:06   ` Tuan Phan
2022-10-03 18:29   ` [PATCH v2] " Tuan Phan
2022-10-10 16:43     ` Tuan Phan
2022-10-10 20:29       ` Daniel Kiper
2022-10-10 21:44         ` Tuan Phan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220929220026.29621-1-tphan@ventanamicro.com \
    --to=tphan@ventanamicro.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.