selftests/bpf: Fix compiler warnings in task_local_data.h
Subsystems (3)
PATCH 1/1 selftests/bpf: Fix compiler warnings in task_local_data.h
Fix compiler warnings about unused parameter, narrowing non-constant into a smaller type and comparison between integers of different size.
--- tools/testing/selftests/bpf/prog_tests/task_local_data.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
tools/testing/selftests/bpf/prog_tests/task_local_data.h +3 -2
@@ -120,6 +120,7 @@ static void tld_free(void);static void __tld_thread_exit_handler (void *unused) { + (void )unused;tld_free (); }#endif
@@ -222,10 +223,10 @@ static tld_key_t __tld_create_key(const char *name, size_t size, bool dyn_data)if (!TLD_READ_ONCE (tld_meta_p)) { err =__tld_init_meta_p ();if (err) -return (tld_key_t ){err}; +return (tld_key_t ){(__s16 )err}; } -for (i =0 ; i <TLD_MAX_DATA_CNT ; i++) { +for (i =0 ; i < (int )TLD_MAX_DATA_CNT ; i++) { retry: cnt =atomic_load (&tld_meta_p->cnt);if (i < cnt) {
Signature · 1 line
2.52.0
Quoted 3 lines · Amery Hung
Fix compiler warnings about unused parameter, narrowing non-constant into a smaller type and comparison between integers of different size.
Nit: might be worth noting it's supposed to fix compilation in C++.
Quoted 3 lines
Signed-off-by Amery Hung <[email protected]>---
Quoted 1 line
[...]
This patch was applied to bpf/bpf-next.git (master) by Alexei Starovoitov <[email protected]>:
Hello:
This patch was applied to bpf/bpf-next.git (master) by Alexei Starovoitov <[email protected]>:
Quoted 7 lines · On Mon, 23 Mar 2026 16:11:33 -0700 you wrote:
Fix compiler warnings about unused parameter, narrowing non-constant into a smaller type and comparison between integers of different size.
Signed-off-by Amery Hung <[email protected]>--- tools/testing/selftests/bpf/prog_tests/task_local_data.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
Here is the summary with links:
- [bpf-next,v1,1/1] selftests/bpf: Fix compiler warnings in task_local_data.h
https://git.kernel.org/bpf/bpf-next/c/03b7b389fe88
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html