Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
* [lttng-dev] [PATCH lttng-ust] Unnecessary bit shit
@ 2015-09-21 18:31 Jonathan Rajotte
  2015-09-21 18:44 ` Mathieu Desnoyers
  0 siblings, 1 reply; 2+ messages in thread
From: Jonathan Rajotte @ 2015-09-21 18:31 UTC (permalink / raw)


Reported by cppcheck [1].

[1]
https://ci.lttng.org/view/Code%20quality/job/lttng-ust_master_cppcheck/5/cppcheckResult/source.10/

Proposed-by: Michael Jeanson <mjeanson at efficios.com>
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien at efficios.com>
---
 libringbuffer/backend_internal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libringbuffer/backend_internal.h b/libringbuffer/backend_internal.h
index 344784f..79f8bde 100644
--- a/libringbuffer/backend_internal.h
+++ b/libringbuffer/backend_internal.h
@@ -485,7 +485,7 @@ static inline int lttng_ust_fls(unsigned int x)
 		r -= 2;
 	}
 	if (!(x & 0x80000000U)) {
-		x <<= 1;
+		/* No need to bit shift on last operation */
 		r -= 1;
 	}
 	return r;
-- 
2.1.4




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-09-21 18:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-21 18:31 [lttng-dev] [PATCH lttng-ust] Unnecessary bit shit Jonathan Rajotte
2015-09-21 18:44 ` Mathieu Desnoyers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox