Re: [PATCH] kunit: fix longest symbol length test

2025-04-27 Thread Nathan Chancellor
Hi Sergio, On Sun, Apr 27, 2025 at 09:10:09PM +0200, Sergio González Collado wrote: > The kunit test that checks the longests symbol length [1], has triggered > warnings in some CI pilelines when symbol prefixes are used [2]. The test > is adjusted to depend on !CONFIG_PREFIX_SYMBOLS as sujested i

Re: [RFC PATCH] selftests: introduce and use SELFTESTS_CC_IS_CLANG instead of LLVM

2024-07-04 Thread Nathan Chancellor
On Wed, Jul 03, 2024 at 08:04:52PM -0700, John Hubbard wrote: > Current practice in the selftests Makefiles is to use $(LLVM) as a way > to decide if clang is being used as the compiler (and/or the linker > front end). Unfortunately, this does not cover all of the use cases: > > 1) CC could have b

Re: [PATCH v2 1/2] selftests/lib.mk: handle both LLVM=1 and CC=clang builds

2024-06-07 Thread Nathan Chancellor
On Fri, Jun 07, 2024 at 12:12:19PM +0100, Ryan Roberts wrote: > On 04/06/2024 05:55, John Hubbard wrote: > > On 6/3/24 3:47 PM, Nathan Chancellor wrote: > >> Does CC=clang even work for the selftests? lib.mk here uses 'CC :=' so > >> won't CC=clan

Re: [PATCH] selftests/timers: Guard LONG_MAX / LONG_MIN defines

2024-06-04 Thread Nathan Chancellor
] > 108 | #define LONG_MIN (-LONG_MAX - 1) > | ^ > prebuilts/clang/host/linux-x86/clang-r522817/lib/clang/18/include/limits.h:52:9: > note: previous definition is here >52 | #define LONG_MIN (-__LONG_MAX__ -1L) > | ^ > > Signed-off-by: Edw

Re: [PATCH v2 1/2] selftests/lib.mk: handle both LLVM=1 and CC=clang builds

2024-06-03 Thread Nathan Chancellor
On Mon, Jun 03, 2024 at 04:32:30PM +0100, Mark Brown wrote: > On Fri, May 31, 2024 at 11:37:50AM -0700, John Hubbard wrote: > > The kselftests may be built in a couple different ways: > > make LLVM=1 > > make CC=clang > > > > In order to handle both cases, set LLVM=1 if CC=clang. That way,

Re: [PATCH v2 2/2] selftests/fchmodat2: fix clang build failure due to -static-libasan

2024-06-03 Thread Nathan Chancellor
ght not be > obvious. > > Cc: Ryan Roberts > Signed-off-by: John Hubbard Assuming that $(LLVM) is the correct conditional to test for: Reviewed-by: Nathan Chancellor > --- > tools/testing/selftests/fchmodat2/Makefile | 11 ++- > 1 file changed, 10 insertions(+),

Re: [PATCH v2 1/2] selftests/openat2: fix clang build failures: -static-libasan, LOCAL_HDRS

2024-06-03 Thread Nathan Chancellor
; > Fix this by using selftests/lib.mk facilities for tracking local header > file dependencies: add them to LOCAL_HDRS, leaving only the .c files to > be passed to the compiler. > > Reviewed-by: Ryan Roberts > Signed-off-by: John Hubbard Assuming that $(LLVM) is the correct condi

Re: [PATCH v2 1/2] selftests/openat2: fix clang build failures: -static-libasan, LOCAL_HDRS

2024-06-03 Thread Nathan Chancellor
; > Fix this by using selftests/lib.mk facilities for tracking local header > file dependencies: add them to LOCAL_HDRS, leaving only the .c files to > be passed to the compiler. > > Reviewed-by: Ryan Roberts > Signed-off-by: John Hubbard Assuming that $(LLVM) is the correct condi

Re: [PATCH v2 2/2] selftests/lib.mk: silence some clang warnings that gcc already ignores

2024-06-03 Thread Nathan Chancellor
ese files: > > ./net/af_unix/scm_rights.c > ./net/timestamping.c > ./net/ipsec.c > ./user_events/perf_test.c > > Cc: Nathan Chancellor > Signed-off-by: John Hubbard This seems reasonable to me. Acked-by: Nathan Chancellor > --- > tools/testing/

Re: [PATCH v2] selftests/net: suppress clang's "variable-sized type not at the end" warning

2024-05-28 Thread Nathan Chancellor
On Mon, May 27, 2024 at 02:36:41PM -0700, John Hubbard wrote: > When building with clang, via: > > make LLVM=1 -C tools/testing/selftest > > ...clang warns that "a variable sized type not at the end of a struct or > class is a GNU extension". > > These cases are not easily changed, because t

Re: [PATCH v2] selftests/user_events: silence a clang warning: address of packed member

2024-05-28 Thread Nathan Chancellor
On Tue, May 28, 2024 at 01:28:33PM -0700, Nathan Chancellor wrote: > Hi John, > > On Mon, May 27, 2024 at 02:47:04PM -0700, John Hubbard wrote: > > When building with clang, via: > > > > make LLVM=1 -C tools/testing/selftest > > > > ...clang warns

Re: [PATCH v2] selftests/user_events: silence a clang warning: address of packed member

2024-05-28 Thread Nathan Chancellor
Hi John, On Mon, May 27, 2024 at 02:47:04PM -0700, John Hubbard wrote: > When building with clang, via: > > make LLVM=1 -C tools/testing/selftest > > ...clang warns about "taking address of packed member 'write_index' ". > This is not particularly helpful, because the test code really wants

Re: [PATCH] kunit: tool: Build compile_commands.json

2024-05-17 Thread Nathan Chancellor
ly in my opinion, as Python will already be available (which is the only dependency of gen_compile_commands.py as far as I am aware) and it should not take that long to generate. Reviewed-by: Nathan Chancellor > --- > tools/testing/kunit/kunit_kernel.py | 3 ++- > 1 file changed, 2 insertions(+

Re: [PATCH] selftests/harness: fix many "format string is empty" warnings

2024-05-01 Thread Nathan Chancellor
nd a few > errors (some tests have -Werror set). > > [1] > https://lore.kernel.org/all/20240329-selftests-libmk-llvm-rfc-v1-1-2f9ed7d1c...@valentinobst.de/ > > Cc: Valentin Obst > Cc: Kees Cook > Cc: Nick Desaulniers > Cc: Nathan Chancellor > Cc: Shuah Khan

[PATCH v2 07/10] selftests: sync: ksft_exit_pass() does not return

2024-04-24 Thread Nathan Chancellor
rogram will terminate upon calling these functions (which is what the comment alluded to as well). Reviewed-by: Muhammad Usama Anjum Reviewed-by: Thomas Gleixner Signed-off-by: Nathan Chancellor --- tools/testing/selftests/sync/sync_test.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) d

[PATCH v2 10/10] selftests: kselftest: Make ksft_exit functions return void instead of int

2024-04-24 Thread Nathan Chancellor
ned up properly, change the types of the ksft_exit...() functions to void to match their __noreturn nature. Reviewed-by: Muhammad Usama Anjum Reviewed-by: Thomas Gleixner Signed-off-by: Nathan Chancellor --- tools/testing/selftests/kselftest.h | 12 ++-- 1 file changed, 6 insertions(+), 6

[PATCH v2 09/10] selftests: x86: ksft_exit_pass() does not return

2024-04-24 Thread Nathan Chancellor
rogram will terminate upon calling these functions. Reviewed-by: Muhammad Usama Anjum Reviewed-by: Thomas Gleixner Signed-off-by: Nathan Chancellor --- tools/testing/selftests/x86/lam.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/x86/lam.c b

[PATCH v2 08/10] selftests: timers: ksft_exit functions do not return

2024-04-24 Thread Nathan Chancellor
the program will terminate upon calling these functions. Reviewed-by: Muhammad Usama Anjum Reviewed-by: Thomas Gleixner Signed-off-by: Nathan Chancellor --- Cc: anna-ma...@linutronix.de Cc: frede...@kernel.org Cc: t...@linutronix.de Cc: jstu...@google.com Cc: sb...@kernel.org --- tools/testing/se

[PATCH v2 06/10] selftests/resctrl: ksft_exit_skip() does not return

2024-04-24 Thread Nathan Chancellor
rogram will terminate upon calling these functions. Reviewed-by: Muhammad Usama Anjum Reviewed-by: Thomas Gleixner Signed-off-by: Nathan Chancellor --- Cc: fenghua...@intel.com Cc: reinette.cha...@intel.com --- tools/testing/selftests/resctrl/resctrl_tests.c | 6 +++--- 1 file changed, 3 insertion

[PATCH v2 05/10] selftests: pidfd: ksft_exit functions do not return

2024-04-24 Thread Nathan Chancellor
because the program will terminate upon calling these functions. Just removing 'return' would have resulted in !ret ? ksft_exit_pass() : ksft_exit_fail(); so convert that into the more idiomatic if (ret) ksft_exit_fail(); ksft_exit_pass(); Reviewed-by: Muhammad Usama Anjum R

[PATCH v2 04/10] selftests/mm: ksft_exit functions do not return

2024-04-24 Thread Nathan Chancellor
the program will terminate upon calling these functions. Reviewed-by: Muhammad Usama Anjum Reviewed-by: Thomas Gleixner Signed-off-by: Nathan Chancellor --- Cc: a...@linux-foundation.org Cc: linux...@kvack.org --- tools/testing/selftests/mm/compaction_test.c | 6 +++--- tools/testing

[PATCH v2 03/10] selftests: membarrier: ksft_exit_pass() does not return

2024-04-24 Thread Nathan Chancellor
rogram will terminate upon calling these functions. Reviewed-by: Muhammad Usama Anjum Reviewed-by: Thomas Gleixner Signed-off-by: Nathan Chancellor --- tools/testing/selftests/membarrier/membarrier_test_multi_thread.c | 2 +- tools/testing/selftests/membarrier/membarrier_test_single_thread.c | 2

[PATCH v2 02/10] selftests/ipc: ksft_exit functions do not return

2024-04-24 Thread Nathan Chancellor
the program will terminate upon calling these functions. Reviewed-by: Muhammad Usama Anjum Reviewed-by: Thomas Gleixner Signed-off-by: Nathan Chancellor --- tools/testing/selftests/ipc/msgque.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tools/testing/selftests

[PATCH v2 00/10] selftests: Make ksft_exit functions return void instead of int

2024-04-24 Thread Nathan Chancellor
view on patch split, as there were no functional changes, please holler if this was inappropriate. - Link to v1: https://lore.kernel.org/r/20240417-ksft-exit-int-to-void-v1-1-eff48fdba...@kernel.org --- Nathan Chancellor (10): selftests/clone3: ksft_exit functions do not return

[PATCH v2 01/10] selftests/clone3: ksft_exit functions do not return

2024-04-24 Thread Nathan Chancellor
because the program will terminate upon calling these functions. Just removing 'return' would have resulted in !ret ? ksft_exit_pass() : ksft_exit_fail(); so convert that into the more idiomatic if (ret) ksft_exit_fail(); ksft_exit_pass(); Reviewed-by: Muhammad Usama Anjum R

Re: [PATCH] selftests: Make ksft_exit functions return void instead of int

2024-04-24 Thread Nathan Chancellor
On Wed, Apr 24, 2024 at 10:00:12AM -0600, Shuah Khan wrote: > On 4/24/24 09:05, Nathan Chancellor wrote: > > On Wed, Apr 24, 2024 at 07:44:31AM -0600, Shuah Khan wrote: > > > On 4/17/24 09:37, Nathan Chancellor wrote: > > > > Commit f7d5bcd35d42 ("selfte

Re: [PATCH] selftests: Make ksft_exit functions return void instead of int

2024-04-24 Thread Nathan Chancellor
On Wed, Apr 24, 2024 at 07:44:31AM -0600, Shuah Khan wrote: > On 4/17/24 09:37, Nathan Chancellor wrote: > > Commit f7d5bcd35d42 ("selftests: kselftest: Mark functions that > > unconditionally call exit() as __noreturn") marked functions that call > > exit() as __nor

[PATCH] selftests: Make ksft_exit functions return void instead of int

2024-04-17 Thread Nathan Chancellor
ransform return !ret ? ksft_exit_pass() : ksft_exit_fail(); into the more idiomatic if (ret) ksft_exit_fail(); ksft_exit_pass(); as well as a few style clean ups now that the code is shorter. Signed-off-by: Nathan Chancellor --- tools/testing/selftests/clone3/clone3_clear_sighand.c

tools/testing/selftests/clone3/clone3_set_tid.c appears to always pass?

2024-04-17 Thread Nathan Chancellor
Hi Christian, I am looking at tools/testing/selftests/clone3/clone3_set_tid.c as part of a patch to clean up the uses of 'return ksft_exit_...();' throughout the selftests (as they call exit() so they do not return) and I noticed that it seems to always pass even when there may have been an error?

Re: [PATCH] selftests: Mark ksft_exit_fail_perror() as __noreturn

2024-04-15 Thread Nathan Chancellor
ly have been marked as __noreturn. > > Signed-off-by: Muhammad Usama Anjum Reviewed-by: Nathan Chancellor > --- > This patch has been suggested [1] and tested on top of the following > patches: > - f07041728422 ("selftests: add ksft_exit_fail_perror()"

Re: [PATCH] kselftest: Mark functions that unconditionally call exit() as __noreturn

2024-04-12 Thread Nathan Chancellor
On Fri, Apr 12, 2024 at 02:05:47PM +0200, Thomas Gleixner wrote: > On Thu, Apr 11 2024 at 11:45, Nathan Chancellor wrote: > > I have based this change on timers/urgent, as the commit that introduces > > this particular warning is there and it is marked for stable, even > > t

Re: [PATCH 2/3] selftests: timers: Fix uninitialized variable warning in ksft_min_kernel_version

2024-04-11 Thread Nathan Chancellor
On Thu, Apr 11, 2024 at 11:11:59AM -0700, John Stultz wrote: > On Thu, Apr 11, 2024 at 8:39 AM Nathan Chancellor wrote: > > On Wed, Apr 10, 2024 at 04:26:29PM -0700, John Stultz wrote: > > > Building with clang, I see the following warning: > > > > > > In

[PATCH] kselftest: Mark functions that unconditionally call exit() as __noreturn

2024-04-11 Thread Nathan Chancellor
eturn__))', which clears up the warning above and any future warnings that may appear for the same reason. Fixes: 6d029c25b71f ("selftests/timers/posix_timers: Reimplement check_timer_distribution()") Reported-by: John Stultz Closes: https://lore.kernel.org/all/20240410232637.4135564-2-js

Re: [PATCH 2/3] selftests: timers: Fix uninitialized variable warning in ksft_min_kernel_version

2024-04-11 Thread Nathan Chancellor
On Wed, Apr 10, 2024 at 04:26:29PM -0700, John Stultz wrote: > Building with clang, I see the following warning: > > In file included from posix_timers.c:17: > ./../kselftest.h:398:6: warning: variable 'major' is used uninitialized > whenever '||' condition is true [-Wsometimes-uninitialized] >

Re: [PATCH 1/3] selftests/bpf: Update LLVM Phabricator links

2024-01-11 Thread Nathan Chancellor
Hi Alexei, On Thu, Jan 11, 2024 at 12:00:50PM -0800, Alexei Starovoitov wrote: > On Thu, Jan 11, 2024 at 11:40 AM Nathan Chancellor wrote: > > > > Hi Yonghong, > > > > On Wed, Jan 10, 2024 at 08:05:36PM -0800, Yonghong Song wrote: > > > > > &g

Re: [PATCH 1/3] selftests/bpf: Update LLVM Phabricator links

2024-01-11 Thread Nathan Chancellor
Hi Yonghong, On Wed, Jan 10, 2024 at 08:05:36PM -0800, Yonghong Song wrote: > > On 1/9/24 2:16 PM, Nathan Chancellor wrote: > > reviews.llvm.org was LLVM's Phabricator instances for code review. It > > has been abandoned in favor of GitHub pull requests. While the major

[PATCH 3/3] treewide: Update LLVM Bugzilla links

2024-01-09 Thread Nathan Chancellor
gs.llvm.org/show_bug.cgi?id=" links to the "https://llvm.org/pr" shortlink so that the links show the most up to date information. Each migrated issue links back to the Bugzilla entry, so there should be no loss of fidelity of information here. Signed-off-by: Nathan Chancellor

[PATCH 2/3] arch and include: Update LLVM Phabricator links

2024-01-09 Thread Nathan Chancellor
Link: https://discourse.llvm.org/t/update-on-github-pull-requests/71540/172 Signed-off-by: Nathan Chancellor --- arch/arm64/Kconfig | 4 ++-- arch/riscv/Kconfig | 2 +- arch/riscv/include/asm/ftrace.h | 2 +- include/linux/compiler-clang.h | 2 +- 4 files changed, 5 inser

[PATCH 1/3] selftests/bpf: Update LLVM Phabricator links

2024-01-09 Thread Nathan Chancellor
ation. Additionally, fix a typo in the xdpwall.c print ("LLMV" -> "LLVM") while in the area. Link: https://discourse.llvm.org/t/update-on-github-pull-requests/71540/172 Signed-off-by: Nathan Chancellor --- Cc: a...@kernel.org Cc: dan...@iogearbox.net Cc: and...@kernel.

[PATCH 0/3] Update LLVM Phabricator and Bugzilla links

2024-01-09 Thread Nathan Chancellor
al (famous last words...). --- Nathan Chancellor (3): selftests/bpf: Update LLVM Phabricator links arch and include: Update LLVM Phabricator links treewide: Update LLVM Bugzilla links arch/arm64/Kconfig | 4 +-- arch/powerp

Re: [PATCH 1/3] kunit: Add a macro to wrap a deferred action function

2023-11-15 Thread Nathan Chancellor
ction_free+0x18/0x20 ... With this series applied with https://lore.kernel.org/20231106172557.2963-1...@opensource.cirrus.com/, all the tests pass for arm64 and x86_64 on my machine. I see no remaining casts in the tree in this state. It seems like the documentation in Documentation/dev-tools/