Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Marcel Holtmann and committed by
Johan Hedberg
b49ef29d 04356052

+1 -1
+1 -1
net/bluetooth/selftest.c
··· 200 200 { 201 201 struct crypto_kpp *tfm; 202 202 ktime_t calltime, delta, rettime; 203 - unsigned long long duration; 203 + unsigned long long duration = 0; 204 204 int err; 205 205 206 206 calltime = ktime_get();