Skip to contentSkip to conversation

lib/ffz: remove dead store

PATCH In review Daniel Verkamp 3 participants 3 messages Jun 7, 2017 – Jun 27, 2017 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/ffz: remove dead store

'word' is written in the last 'if' block but never read again.

This is harmless, but scan-build (clang-analyzer) flags it as a warning.

---
 lib/ffz.h | 1 -
 1 file changed, 1 deletion(-)
lib/ffz.h +0 -1
index e2c1b8e..b98dad6 100644
@@ -28,7 +28,6 @@ static inline int ffs64(uint64_t word)
 		r += 2;
 	}
 	if (!(word & 1)) {
-		word >>= 1;
 		r += 1;
 	}
 
Signature · 1 line
2.9.4
#1 lore raw
Quoted 22 lines · Daniel Verkamp

'word' is written in the last 'if' block but never read again.

This is harmless, but scan-build (clang-analyzer) flags it as a warning.

---
 lib/ffz.h | 1 -
 1 file changed, 1 deletion(-)
lib/ffz.h +0 -2
index e2c1b8e..b98dad6 100644
@@ -28,7 +28,6 @@ static inline int ffs64(uint64_t word)
                r += 2;
        }
        if (!(word & 1)) {
-               word >>= 1;
                r += 1;
        }
 
--
Quoted 1 line

2.9.4

Any thoughts on this one Jens (just checking it didn't slip through the net)?

Signature · 1 line
Sitsofe | http://sucs.org/~sits/
#2 lore raw
Quoted 22 lines · Sitsofe Wheeler
Quoted 21 lines · Daniel Verkamp

'word' is written in the last 'if' block but never read again.

This is harmless, but scan-build (clang-analyzer) flags it as a warning.

---
 lib/ffz.h | 1 -
 1 file changed, 1 deletion(-)
lib/ffz.h +0 -1
index e2c1b8e..b98dad6 100644
@@ -28,7 +28,6 @@ static inline int ffs64(uint64_t word)
                r += 2;
        }
        if (!(word & 1)) {
-               word >>= 1;
                r += 1;
        }
 
Quoted 4 lines
Quoted 2 lines

--
2.9.4

Any thoughts on this one Jens (just checking it didn't slip through the net)?

It did, thanks for bringing it to my attention - applied, thanks Daniel.

Signature · 1 line
Jens Axboe