mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: barebox@lists.infradead.org
Cc: andrew.smirnov@gmail.com
Subject: [PATCH 3/5] log2: Use fls_long() in __roundup_pow_of_two()
Date: Thu, 23 Aug 2018 19:58:12 -0700	[thread overview]
Message-ID: <20180824025814.20886-4-andrew.smirnov@gmail.com> (raw)
In-Reply-To: <20180824025814.20886-1-andrew.smirnov@gmail.com>

Convert __roundup_pow_of_two() to use fls_long() instead of fls() so
the code would be identical to that found in Linux. This fix also
allowed next patch(taken from Linux kernel verbatim) to apply cleanly.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 include/linux/log2.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/log2.h b/include/linux/log2.h
index 919a22790..c373295f3 100644
--- a/include/linux/log2.h
+++ b/include/linux/log2.h
@@ -54,7 +54,7 @@ bool is_power_of_2(unsigned long n)
 static inline __attribute__((const))
 unsigned long __roundup_pow_of_two(unsigned long n)
 {
-	return 1UL << fls(n - 1);
+	return 1UL << fls_long(n - 1);
 }
 
 /*
-- 
2.17.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2018-08-24  2:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-24  2:58 [PATCH 0/5] include/linux/log2.h warning fix Andrey Smirnov
2018-08-24  2:58 ` [PATCH 1/5] log2: make order_base_2() behave correctly on const input value zero Andrey Smirnov
2018-08-24  2:58 ` [PATCH 2/5] give up on gcc ilog2() constant optimizations Andrey Smirnov
2018-08-24  2:58 ` Andrey Smirnov [this message]
2018-08-24  2:58 ` [PATCH 4/5] linux/log2.h: fix kernel-doc notation Andrey Smirnov
2018-08-24  2:58 ` [PATCH 5/5] scsi: ilog2: create truly constant version for sparse Andrey Smirnov
2018-08-24  8:23 ` [PATCH 0/5] include/linux/log2.h warning fix Sascha Hauer

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=20180824025814.20886-4-andrew.smirnov@gmail.com \
    --to=andrew.smirnov@gmail.com \
    --cc=barebox@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox