* [PATCH] Bluetooth: Fix compiler warning with selftest duration calculation
@ 2017-10-06 18:42 Marcel Holtmann
2017-10-07 6:45 ` Johan Hedberg
0 siblings, 1 reply; 2+ messages in thread
From: Marcel Holtmann @ 2017-10-06 18:42 UTC (permalink / raw)
To: linux-bluetooth
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Bluetooth: Fix compiler warning with selftest duration calculation
2017-10-06 18:42 [PATCH] Bluetooth: Fix compiler warning with selftest duration calculation Marcel Holtmann
@ 2017-10-07 6:45 ` Johan Hedberg
0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2017-10-07 6:45 UTC (permalink / raw)
To: Marcel Holtmann; +Cc: linux-bluetooth
Hi Marcel,
On Fri, Oct 06, 2017, Marcel Holtmann wrote:
> 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(-)
Applied to bluetooth-next. Thanks.
Johan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-10-07 6:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-06 18:42 [PATCH] Bluetooth: Fix compiler warning with selftest duration calculation Marcel Holtmann
2017-10-07 6:45 ` Johan Hedberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).