From: Marcel Holtmann Date: Fri, 6 Oct 2017 18:42:45 +0000 (+0200) Subject: Bluetooth: Fix compiler warning with selftest duration calculation X-Git-Tag: v5.15~9988^2~190^2~20 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b49ef29d72bd2975b8b2cc84b1fa6b40aa2edd5f;p=platform%2Fkernel%2Flinux-starfive.git Bluetooth: Fix compiler warning with selftest duration calculation 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 Signed-off-by: Johan Hedberg --- diff --git a/net/bluetooth/selftest.c b/net/bluetooth/selftest.c index 2d1519d..03e3c89 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();