summaryrefslogtreecommitdiff
path: root/include/sbi
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2020-07-07 12:56:55 +0300
committerAnup Patel <anup@brainfault.org>2020-07-14 14:33:30 +0300
commitec1abf665737af032b8d58f8a5373bcaddedd902 (patch)
treee0b1e273a9138a36a4096e66e37c0a3f730d8f39 /include/sbi
parenta5f9104330353491fc6c0fdb42262543d39518d9 (diff)
downloadopensbi-ec1abf665737af032b8d58f8a5373bcaddedd902.tar.xz
include: sbi_bitops: Remove dead shift assignment in ffs/fls
The value assigned to x by the shift assignment in the last if block of ffs/fls is never read. Remove it. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Reviewed-by: Anup Patel <anup.patel@wdc.com>
Diffstat (limited to 'include/sbi')
-rw-r--r--include/sbi/sbi_bitops.h8
1 files changed, 2 insertions, 6 deletions
diff --git a/include/sbi/sbi_bitops.h b/include/sbi/sbi_bitops.h
index d920086..879430d 100644
--- a/include/sbi/sbi_bitops.h
+++ b/include/sbi/sbi_bitops.h
@@ -66,10 +66,8 @@ static inline int ffs(int x)
x >>= 2;
r += 2;
}
- if (!(x & 1)) {
- x >>= 1;
+ if (!(x & 1))
r += 1;
- }
return r;
}
@@ -148,10 +146,8 @@ static inline int fls(int x)
x <<= 2;
r -= 2;
}
- if (!(x & 0x80000000u)) {
- x <<= 1;
+ if (!(x & 0x80000000u))
r -= 1;
- }
return r;
}