[PATCH 19/23] include: bitops: fix dead increment in fls() and ffs()

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

 



Static analyzers trip over this and a comment is as descriptive,
thus replace the dead code.

Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>
---
 include/asm-generic/bitops/ffs.h | 2 +-
 include/asm-generic/bitops/fls.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/asm-generic/bitops/ffs.h b/include/asm-generic/bitops/ffs.h
index fbbb43af7dc0..afc2d7b2d19f 100644
--- a/include/asm-generic/bitops/ffs.h
+++ b/include/asm-generic/bitops/ffs.h
@@ -32,7 +32,7 @@ static inline int ffs(int x)
 		r += 2;
 	}
 	if (!(x & 1)) {
-		x >>= 1;
+		/* x >>= 1; */
 		r += 1;
 	}
 	return r;
diff --git a/include/asm-generic/bitops/fls.h b/include/asm-generic/bitops/fls.h
index 850859bc5069..9d5d26a3bbdf 100644
--- a/include/asm-generic/bitops/fls.h
+++ b/include/asm-generic/bitops/fls.h
@@ -32,7 +32,7 @@ static inline int fls(int x)
 		r -= 2;
 	}
 	if (!(x & 0x80000000u)) {
-		x <<= 1;
+		/* x <<= 1; */
 		r -= 1;
 	}
 	return r;
-- 
2.26.2


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



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux