Skip to content

Commit b49ef29

Browse files
holtmannjhedberg
authored andcommitted
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 <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
1 parent 0435605 commit b49ef29

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎net/bluetooth/selftest.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ static int __init test_ecdh(void)
200200
{
201201
struct crypto_kpp *tfm;
202202
ktime_t calltime, delta, rettime;
203-
unsigned long long duration;
203+
unsigned long long duration = 0;
204204
int err;
205205

206206
calltime = ktime_get();

0 commit comments

Comments
 (0)