From: Marcel Holtmann <marcel@holtmann.org>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH] Bluetooth: Fix compiler warning with selftest duration calculation
Date: Fri, 6 Oct 2017 20:42:45 +0200 [thread overview]
Message-ID: <20171006184245.5525-1-marcel@holtmann.org> (raw)
CC net/bluetooth/selftest.o
net/bluetooth/selftest.c: In function ‘bt_selftest_init’:
net/bluetooth/selftest.c:246:3: warning: ‘duration’ may be used uninitialized in this function [-Wmaybe-uninitialized]
snprintf(test_ecdh_buffer, sizeof(test_ecdh_buffer),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"PASS (%llu usecs)\n", duration);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/bluetooth/selftest.c:203:21: note: ‘duration’ was declared here
unsigned long long duration;
^~~~~~~~
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
---
net/bluetooth/selftest.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/bluetooth/selftest.c b/net/bluetooth/selftest.c
index 2d1519d0affa..03e3c89c3046 100644
--- a/net/bluetooth/selftest.c
+++ b/net/bluetooth/selftest.c
@@ -200,7 +200,7 @@ static int __init test_ecdh(void)
{
struct crypto_kpp *tfm;
ktime_t calltime, delta, rettime;
- unsigned long long duration;
+ unsigned long long duration = 0;
int err;
calltime = ktime_get();
--
2.13.6
next reply other threads:[~2017-10-06 18:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-06 18:42 Marcel Holtmann [this message]
2017-10-07 6:45 ` [PATCH] Bluetooth: Fix compiler warning with selftest duration calculation Johan Hedberg
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=20171006184245.5525-1-marcel@holtmann.org \
--to=marcel@holtmann.org \
--cc=linux-bluetooth@vger.kernel.org \
/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