From: jonathan.rajotte-julien@efficios.com (Jonathan Rajotte)
Subject: [lttng-dev] [PATCH lttng-ust] Unnecessary bit shit
Date: Mon, 21 Sep 2015 14:31:33 -0400 [thread overview]
Message-ID: <1442860293-20922-1-git-send-email-jonathan.rajotte-julien@efficios.com> (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
next reply other threads:[~2015-09-21 18:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-21 18:31 Jonathan Rajotte [this message]
2015-09-21 18:44 ` Mathieu Desnoyers
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=1442860293-20922-1-git-send-email-jonathan.rajotte-julien@efficios.com \
--to=jonathan.rajotte-julien@efficios.com \
/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