[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d1c43289-e79d-1d89-f9e9-84acfed772d7@iogearbox.net>
Date: Fri, 24 Jan 2020 11:11:24 +0100
From: Daniel Borkmann <daniel@...earbox.net>
To: Stanislav Fomichev <sdf@...gle.com>, netdev@...r.kernel.org,
bpf@...r.kernel.org
Cc: davem@...emloft.net, ast@...nel.org,
John Sperbeck <jsperbeck@...gle.com>
Subject: Re: [PATCH bpf-next] selftests/bpf: initialize duration variable
before using
On 1/24/20 12:51 AM, Stanislav Fomichev wrote:
> From: John Sperbeck <jsperbeck@...gle.com>
>
> The 'duration' variable is referenced in the CHECK() macro, and there are
> some uses of the macro before 'duration' is set. The clang compiler
> (validly) complains about this.
>
> Sample error:
>
> .../selftests/bpf/prog_tests/fexit_test.c:23:6: warning: variable 'duration' is uninitialized when used here [-Wuninitialized]
> if (CHECK(err, "prog_load sched cls", "err %d errno %d\n", err, errno))
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> .../selftests/bpf/test_progs.h:134:25: note: expanded from macro 'CHECK'
> if (CHECK(err, "prog_load sched cls", "err %d errno %d\n", err, errno))
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> _CHECK(condition, tag, duration, format)
> ^~~~~~~~
>
> Signed-off-by: John Sperbeck <jsperbeck@...gle.com>
> Signed-off-by: Stanislav Fomichev <sdf@...gle.com>
Applied, thanks!
Powered by blists - more mailing lists