[PATCH v2 5/8] selftests/mm: Remove unused parameters

2025-07-31 Thread Muhammad Usama Anjum
Cleanup code and remove the unused arguments Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/ksm_tests.c | 17 +++-- tools/testing/selftests/mm/soft-dirty.c | 4 ++-- .../testing/selftests/mm/split_huge_page_test.c | 4 ++-- tools/testing

[PATCH v2 7/8] selftests/mm: Mark unused arguments with __unused

2025-07-31 Thread Muhammad Usama Anjum
Mark the arguments which cannot be removed with __unused attribute. Signed-off-by: Muhammad Usama Anjum --- .../selftests/mm/hugetlb_fault_after_madv.c| 4 ++-- .../testing/selftests/mm/hugetlb_madv_vs_map.c | 6 +++--- tools/testing/selftests/mm/pkey-arm64.h| 5 +++-- tools

[PATCH v2 2/8] selftests/mm: protection_keys: Fix dead code

2025-07-31 Thread Muhammad Usama Anjum
y the code a bit as well. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/protection_keys.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/testing/selftests/mm/protection_keys.c b/tools/testing/selftests/mm/protection_keys.c index 23e

[PATCH v2 8/8] selftests/mm: Fix unused parameter warnings for different architectures

2025-07-31 Thread Muhammad Usama Anjum
There are functions which have unused arguments for different architectures. Separate the code for each architecture and move #ifdef arch outside these functions. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/mseal_test.c | 8 +-- .../selftests/mm

[PATCH v2 4/8] selftests/mm: Add -Wunused family of flags

2025-07-31 Thread Muhammad Usama Anjum
Add -Wunused family of flags and fix all the warnings coming because of argc and argv. Remove them if they aren't being used entirely. Use __unused compiler attribute with argc where argv is being used. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/Mak

[PATCH v2 0/8] selftests/mm: Add compiler flags and fix found warnings

2025-07-31 Thread Muhammad Usama Anjum
Revamp how patches are written per same kind of failure Muhammad Usama Anjum (8): selftests/mm: Add -Wunreachable-code and fix warnings selftests/mm: protection_keys: Fix dead code selftests: kselftest.h: Add __unused macro selftests/mm: Add -Wunused family of flags selftests/mm: Remove un

[PATCH v2 6/8] selftests/mm: Mark unused arguments with __unused

2025-07-31 Thread Muhammad Usama Anjum
Mark the arguments which cannot be removed with __unused attribute. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/cow.c | 20 ++--- tools/testing/selftests/mm/memfd_secret.c| 4 +-- tools/testing/selftests/mm/pfnmap.c | 2 +- tools/testing

[PATCH v2 3/8] selftests: kselftest.h: Add __unused macro

2025-07-31 Thread Muhammad Usama Anjum
Add __unused macro instead of using the complete verbose unused compiler attribute. The raw __attribute__((__unused__)) is quite long and makes code too much verbose to the kernel developer's taste. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/kselftest.h | 4 1

[PATCH v2 1/8] selftests/mm: Add -Wunreachable-code and fix warnings

2025-07-31 Thread Muhammad Usama Anjum
eclaration specifier [-Wduplicate-decl-specifier] static inline __always_inline Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/Makefile| 1 + tools/testing/selftests/mm/hmm-tests.c | 5 ++--- tools/testing/selftests/mm/pkey_sighandler_tests.c | 2 +- tools/

[PATCH v3] selftests/mm: pagemap_scan ioctl: add PFN ZERO test cases

2025-07-07 Thread Muhammad Usama Anjum
Add test cases to test the correctness of PFN ZERO flag of pagemap_scan ioctl. Test with normal pages backed memory and huge pages backed memory. Cc: David Hildenbrand Signed-off-by: Muhammad Usama Anjum --- The bug has been fixed [1]. [1] https://lore.kernel.org/all/20250617143532.2375383-1

Re: [PATCH] selftests/mm: pagemap_scan ioctl: add PFN ZERO test cases

2025-07-02 Thread Muhammad Usama Anjum
... >>> + +    free(mem); >>> >>> >>> Shouldn't this be an munmap() ? >> free() is being used to free memory allocated by memalign(). > > Oh, I missed that detail. > > I'm afraid memalign+free that might not be what you want: there is no > guarantee that what you are getting hasn't bee

[PATCH v2] selftests/mm: pagemap_scan ioctl: add PFN ZERO test cases

2025-07-02 Thread Muhammad Usama Anjum
Add test cases to test the correctness of PFN ZERO flag of pagemap_scan ioctl. Test with normal pages backed memory and huge pages backed memory. Cc: David Hildenbrand Signed-off-by: Muhammad Usama Anjum --- The bug has been fixed [1]. [1] https://lore.kernel.org/all/20250617143532.2375383-1

Re: [PATCH] selftests/mm: pagemap_scan ioctl: add PFN ZERO test cases

2025-07-02 Thread Muhammad Usama Anjum
On 7/1/25 7:51 PM, David Hildenbrand wrote: > On 30.06.25 12:24, Muhammad Usama Anjum wrote: >> Add test cases to test the correctness of PFN ZERO flag of pagemap_scan >> ioctl. Test with normal pages backed memory and huge pages backed >> memory. > > Just to verify: wo

[PATCH] selftests/mm: pagemap_scan ioctl: add PFN ZERO test cases

2025-06-30 Thread Muhammad Usama Anjum
Add test cases to test the correctness of PFN ZERO flag of pagemap_scan ioctl. Test with normal pages backed memory and huge pages backed memory. Cc: David Hildenbrand Signed-off-by: Muhammad Usama Anjum --- The bug has been fixed [1]. [1] https://lore.kernel.org/all/20250617143532.2375383-1

Re: [PATCH v2] selftests: futex: define SYS_futex on 32-bit architectures with 64-bit time_t

2025-06-28 Thread Muhammad Usama Anjum
situation to ensure successful compilation and compatibility. > > Signed-off-by: Cynthia Huang > Signed-off-by: Ben Zong-You Xie Reviewed-by: Muhammad Usama Anjum > --- > Changes since v1: > - Fix the SOB chain > > v1 : > https://lore.kernel.org/all/202505

Re: [PATCH v2] selftests/filesystems/mount-notify: fix unused unused result warning

2025-06-22 Thread Muhammad Usama Anjum
On 6/20/25 7:55 PM, Chen Linxuan wrote: > On Fri, Jun 20, 2025 at 10:46 PM Muhammad Usama Anjum > wrote: >> >> On 6/20/25 8:50 AM, Chen Linxuan wrote: >>> When running `make kselftest`, the following compilation warning was >>> encountered: >

Re: [PATCH v2] selftests/filesystems/mount-notify: fix unused unused result warning

2025-06-20 Thread Muhammad Usama Anjum
On 6/20/25 8:50 AM, Chen Linxuan wrote: > When running `make kselftest`, the following compilation warning was > encountered: > > mount-notify_test.c: In function ‘fanotify_rmdir’: > mount-notify_test.c:490:17: warning: ignoring return value of ‘chdir’ > declared with attribute ‘warn_unused_resu

Re: [PATCH] selftests/filesystems/mount-notify: remove __kernel_fsid_t

2025-06-20 Thread Muhammad Usama Anjum
ious > declaration of ‘__kernel_fsid_t’ with type ‘__kernel_fsid_t’ >81 | } __kernel_fsid_t; > | ^~~ > > Signed-off-by: Chen Linxuan Reviewed-by: Muhammad Usama Anjum Tested-by: Muhammad Usama Anjum > --- > .../selftests/filesystems/mount-notify/mou

Re: [PATCH 7/7] selftests: vDSO: vdso_config: Avoid -Wunused-variables

2025-05-02 Thread Muhammad Usama Anjum
ons’ defined but not used > [-Wunused-variable] >61 | static const char *versions[7] = { > |^~~~ > > Avoid those warnings through attribute((unused)). > > Signed-off-by: Thomas Weißschuh Reviewed-by: Muhammad Usama Anjum > --- > tools/testing/s

Re: [PATCH 6/7] selftests: vDSO: vdso_test_getrandom: Always print TAP header

2025-05-02 Thread Muhammad Usama Anjum
eißschuh Reviewed-by: Muhammad Usama Anjum > --- > tools/testing/selftests/vDSO/vdso_test_getrandom.c | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/tools/testing/selftests/vDSO/vdso_test_getrandom.c > b/tools/testing/selftest

Re: [PATCH 5/7] selftests: vDSO: vdso_test_getrandom: Drop some dead code

2025-05-02 Thread Muhammad Usama Anjum
On 5/2/25 5:40 PM, Thomas Weißschuh wrote: > vgetrandom_put_state() and the variable ret in kselftest() are never used. > > Drop the dead code. > > Signed-off-by: Thomas Weißschuh Reviewed-by: Muhammad Usama Anjum > --- > tools/testing/selftests/vDSO/vdso_

Re: [PATCH 3/7] selftests: vDSO: vdso_test_correctness: Fix -Wold-style-definitions

2025-05-02 Thread Muhammad Usama Anjum
On 5/2/25 5:40 PM, Thomas Weißschuh wrote: > Functions definitions without any argument list produce a warning with > -Wold-style-definition: > > vdso_test_correctness.c:111:13: warning: old-style function definition > [-Wold-style-definition] > 111 | static void fill_function_pointers() >

Re: [PATCH 2/7] selftests: vDSO: clock_getres: Drop unused include of err.h

2025-05-02 Thread Muhammad Usama Anjum
On 5/2/25 5:40 PM, Thomas Weißschuh wrote: > Nothing from err.h is used. > > Drop the include. > > Signed-off-by: Thomas Weißschuh Reviewed-by: Muhammad Usama Anjum > --- > tools/testing/selftests/vDSO/vdso_test_clock_getres.c | 1 - > 1 file changed, 1 deletion(-)

Re: [PATCH 1/7] selftests: vDSO: chacha: Correctly skip test if necessary

2025-05-02 Thread Muhammad Usama Anjum
cha test") > Signed-off-by: Thomas Weißschuh Reviewed-by: Muhammad Usama Anjum > > --- > I'm not sure if this is not a general bug in ksft_exit_skip(). > First ksft_xskip is incremented then read back through ksft_test_num() and > then that result is incremented again. >

Re: [PATCH 3/3] selftests/timens: timerfd: Use correct clockid type in tclock_gettime()

2025-05-02 Thread Muhammad Usama Anjum
On 5/2/25 5:03 PM, Thomas Weißschuh wrote: > tclock_gettime() is a wrapper around clock_gettime(). > The first parameter of clock_gettime() is of type "clockid_t", > not "clock_t". > > Use the correct type instead. > > Signed-off-by: Thomas Wei

Re: [PATCH 2/3] selftests/timens: Make run_tests() functions static

2025-05-02 Thread Muhammad Usama Anjum
On 5/2/25 5:03 PM, Thomas Weißschuh wrote: > These functions are never used outside their defining compilation unit and > can be made static. > > Signed-off-by: Thomas Weißschuh Reviewed-by: Muhammad Usama Anjum > --- > tools/testing/selftests/timens/clock_nanosleep.c | 2 +

Re: [PATCH 1/3] selftests/timens: Print TAP headers

2025-05-02 Thread Muhammad Usama Anjum
On 5/2/25 5:03 PM, Thomas Weißschuh wrote: > The TAP specification requires that the output begins with a header line. > These headers lines are missing in the timens tests. > > Print such a line. > > Signed-off-by: Thomas Weißschuh Reviewed-by: Muhammad Usama Anjum >

Re: [PATCH v3 06/32] selftests: harness: Remove dependency on libatomic

2025-04-18 Thread Muhammad Usama Anjum
-off-by: Thomas Weißschuh Reviewed-by: Muhammad Usama Anjum > --- > tools/testing/selftests/kselftest_harness.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/tools/testing/selftests/kselftest_harness.h > b/tools/te

Re: [PATCH v3 05/32] selftests: harness: Remove inline qualifier for wrappers

2025-04-18 Thread Muhammad Usama Anjum
: Thomas Weißschuh Reviewed-by: Muhammad Usama Anjum > --- > tools/testing/selftests/kselftest_harness.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/tools/testing/selftests/kselftest_harness.h > b/tools/testing/s

Re: [PATCH v3 04/32] selftests: harness: Mark functions without prototypes static

2025-04-18 Thread Muhammad Usama Anjum
oid the issue by marking the functions static. > > Signed-off-by: Thomas Weißschuh Reviewed-by: Muhammad Usama Anjum > --- > tools/testing/selftests/kselftest_harness.h | 12 ++-- > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/tools/testing

Re: [PATCH v3 03/32] selftests: harness: Ignore unused variant argument warning

2025-04-18 Thread Muhammad Usama Anjum
note: in expansion of macro '__TEST_IMPL' > 156 | #define TEST(test_name) __TEST_IMPL(test_name, -1) > | ^~~ > harness-selftest.c:15:1: note: in expansion of macro 'TEST' >15 | TEST(standalone_pass) { >

Re: [PATCH v3 01/32] selftests: harness: Add kselftest harness selftest

2025-04-18 Thread Muhammad Usama Anjum
On 4/11/25 2:00 PM, Thomas Weißschuh wrote: > Add a selftest for the kselftest harness itself so any changes can be > validated. > > Signed-off-by: Thomas Weißschuh Reviewed-by: Muhammad Usama Anjum > --- > MAINTAINERS| 1 + > to

Re: [PATCH v2] selftests/mm/cow: Fix the incorrect error handling

2025-03-15 Thread Muhammad Usama Anjum
the description: Reviewed-by: Muhammad Usama Anjum > --- > tools/testing/selftests/mm/cow.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/mm/cow.c > b/tools/testing/selftests/mm/cow.c > index 9446673645eb..f0cb14ea860

Re: [PATCH v3 00/10] selftests/mm: Some cleanups from trying to run them

2025-03-05 Thread Muhammad Usama Anjum
Hi, Thanks for adding to the series Dev Jain. The series looks good. Thanks for doing such a series. It helps everyone. For the series: Reviewed-by: Muhammad Usama Anjum On 2/28/25 9:54 PM, Brendan Jackman wrote: > I never had much luck running mm selftests so I spent a few hours > d

Re: [PATCH 3/3] bitmap: break kunit into test cases

2025-02-09 Thread Muhammad Usama Anjum
On 2/8/25 1:14 AM, Tamir Duberstein wrote: > Move some tests into `bitmap_test_cases` and parameterize > `test_bitmap_print_buf`. This gives us nicer output in the event of a > failure. > > Signed-off-by: Tamir Duberstein Reviewed-by: Muhammad Usama Anjum > --- > lib

Re: [PATCH 2/3] bitmap: convert self-test to KUnit

2025-02-09 Thread Muhammad Usama Anjum
y: Tamir Duberstein Thanks for the conversion. Reviewed-by: Muhammad Usama Anjum > --- > MAINTAINERS | 2 +- > arch/m68k/configs/amiga_defconfig | 1 - > arch/m68k/configs/apollo_defconfig| 1 - > arch/m68k/configs/atari_defconfig |

Re: [PATCH 1/3] bitmap: remove _check_eq_u32_array

2025-02-09 Thread Muhammad Usama Anjum
On 2/8/25 1:14 AM, Tamir Duberstein wrote: > This has been unused since commit 3aa56885e516 ("bitmap: replace > bitmap_{from,to}_u32array") in 2018. Remove it to avoid the need to port > it to KUnit in this series. > > Signed-off-by: Tamir Duberstein Reviewed

Re: [PATCH 01/16] selftests/mm: remove argc and argv unused parameters

2025-01-31 Thread Muhammad Usama Anjum
On 1/10/25 5:12 AM, Andrew Morton wrote: > On Thu, 9 Jan 2025 09:50:45 -0800 Kees Cook wrote: > >> On Thu, Jan 09, 2025 at 10:48:52PM +0500, Muhammad Usama Anjum wrote: >>> For the all other case, why should we keep argv/argc and mark them unused >>> as we

Re: [PATCH 01/16] selftests/mm: remove argc and argv unused parameters

2025-01-31 Thread Muhammad Usama Anjum
On 1/11/25 12:00 AM, David Laight wrote: > On Thu, 9 Jan 2025 22:38:27 +0500 > Muhammad Usama Anjum wrote: > >> Remove the following warnings by removing unused argc and argv >> parameters: >> In function ‘main’: >> warning: unused parameter ‘argc’ [-Wunused

Re: [PATCH] selftests/capabilities/test_execve: Initialize the variable have_outer_privilege

2025-01-19 Thread Muhammad Usama Anjum
On 1/14/25 10:41 AM, liuye wrote: > Uninitialized variable: have_outer_privilege. > Fix it. Please improve the description. Explain how the current code is wrong. After that add: Reviewed-by: Muhammad Usama Anjum > > Signed-off-by: liuye > --- > tools/testing/self

Re: [PATCH 01/16] selftests/mm: remove argc and argv unused parameters

2025-01-09 Thread Muhammad Usama Anjum
On 1/9/25 10:42 PM, Kees Cook wrote: > On Thu, Jan 09, 2025 at 10:38:27PM +0500, Muhammad Usama Anjum wrote: >> Remove the following warnings by removing unused argc and argv >> parameters: >> In function ‘main’: >> warning: unused parameter ‘argc’ [-Wunused-parameter

[PATCH 09/16] selftests/mm: hugetlb-madvise: fix type mismatch issues

2025-01-09 Thread Muhammad Usama Anjum
)) { \ | ^~ hugetlb-madvise.c:114:9: note: in expansion of macro ‘validate_free_pages’ 114 | validate_free_pages(free_hugepages - NR_HUGE_PAGES); | ^~~ Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/hugetlb-madvise.c | 2 +- 1 file changed, 1

[PATCH 14/16] selftests/mm: thuge-gen: Fix type mismatch warnings

2025-01-09 Thread Muhammad Usama Anjum
Fix all the found type mismatch warnings. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/thuge-gen.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/mm/thuge-gen.c b/tools/testing/selftests/mm/thuge-gen.c index

[PATCH 16/16] selftests/mm: Makefile: Add the compiler flags

2025-01-09 Thread Muhammad Usama Anjum
Add the compiler flags to catch warnings during development. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/mm/Makefile b/tools/testing/selftests/mm/Makefile index 63ce39d024bb5

[PATCH 15/16] selftests/mm: uffd-*: Fix all type mismatch warnings

2025-01-09 Thread Muhammad Usama Anjum
Fix all type mismatch warnings in all uffd-* files. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/uffd-common.c | 6 +++--- tools/testing/selftests/mm/uffd-stress.c | 2 +- tools/testing/selftests/mm/uffd-unit-tests.c | 6 +++--- 3 files changed, 7 insertions(+), 7

[PATCH 12/16] selftests/mm: khugepaged: Fix type mismatch warnings

2025-01-09 Thread Muhammad Usama Anjum
Fix type mismatch warnings. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/khugepaged.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/testing/selftests/mm/khugepaged.c b/tools/testing/selftests/mm/khugepaged.c index 8a4d34cce36b2

[PATCH 13/16] selftests/mm: protection_keys: Fix variables types mismatch warnings

2025-01-09 Thread Muhammad Usama Anjum
Fix variable type mismatch warnings. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/protection_keys.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/testing/selftests/mm/protection_keys.c b/tools/testing/selftests/mm

[PATCH 11/16] selftests/mm: hugetlb-read-hwpoison: Fix type mismatch warnings

2025-01-09 Thread Muhammad Usama Anjum
Fix type mismatch warnings. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/hugetlb-read-hwpoison.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/mm/hugetlb-read-hwpoison.c b/tools/testing/selftests/mm/hugetlb-read

[PATCH 10/16] selftests/mm: hugepage-vmemmap: fix type mismatch warnings

2025-01-09 Thread Muhammad Usama Anjum
Fix type mismatch warnings. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/hugepage-vmemmap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/mm/hugepage-vmemmap.c b/tools/testing/selftests/mm/hugepage-vmemmap.c index

[PATCH 08/16] selftests/mm: guard-pages: Fix type mismatch warnings

2025-01-09 Thread Muhammad Usama Anjum
Fix type mismatch warnings. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/guard-pages.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/mm/guard-pages.c b/tools/testing/selftests/mm/guard-pages.c index ece37212a8a2e

[PATCH 06/16] selftests/mm: cow: remove unused variables and fix type mismatch errors

2025-01-09 Thread Muhammad Usama Anjum
Fix following warnings: - Remove unused variables - Use __attribute__(unused) with unused variables which aren't being used and cannot be removed because of function pointer declaration - Fix type mismatches Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/cow.c

[PATCH 07/16] selftests/mm: hmm-tests: Remove always false expressions

2025-01-09 Thread Muhammad Usama Anjum
As default_hsize is unsigned, it is always greater than equal to zero. Remove expression which is checking if it is less than 0. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/hmm-tests.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing

[PATCH 05/16] selftests/mm: kselftest_harness: Fix warnings

2025-01-09 Thread Muhammad Usama Anjum
) \ | ~~~^~~ ../kselftest_harness.h:152:25: note: in expansion of macro ‘__TEST_IMPL’ 152 | #define TEST(test_name) __TEST_IMPL(test_name, -1) | ^~~ mdwe_test.c:23:1: note: in expansion of macro ‘TEST’ 23 | TEST(prctl_flags) | ^~~~ Signed-off-by: Muhammad Usama Anjum --- tools

[PATCH 04/16] selftests/mm: Fix type mismatch warnings

2025-01-09 Thread Muhammad Usama Anjum
Fix type mismatch warnings in different tests. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/compaction_test.c | 2 +- tools/testing/selftests/mm/gup_longterm.c | 3 ++- tools/testing/selftests/mm/hugetlb_dio.c | 2 +- tools/testing

[PATCH 03/16] selftests/mm: Fix unused parameter warnings

2025-01-09 Thread Muhammad Usama Anjum
Fix unused parameter warnings. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/pkey-x86.h | 4 +++- .../selftests/mm/pkey_sighandler_tests.c | 17 +++-- tools/testing/selftests/mm/protection_keys.c | 18 ++ 3 files changed, 24

[PATCH 01/16] selftests/mm: remove argc and argv unused parameters

2025-01-09 Thread Muhammad Usama Anjum
(int argc, char *argv[]) |~~^~ Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/compaction_test.c | 2 +- tools/testing/selftests/mm/cow.c | 2 +- tools/testing/selftests/mm/droppable.c | 2 +- tools/testing

[PATCH 02/16] selftests/mm: Fix unused parameter warnings

2025-01-09 Thread Muhammad Usama Anjum
Fix warnings generated by unused parameters. Signed-off-by: Muhammad Usama Anjum --- .../selftests/mm/hugetlb_fault_after_madv.c | 4 +- .../selftests/mm/hugetlb_madv_vs_map.c| 6 +-- tools/testing/selftests/mm/ksm_tests.c| 17 +++--- tools/testing/selftests/mm

[PATCH 00/16] selftest/mm: Remove warnings found by adding compiler flags

2025-01-09 Thread Muhammad Usama Anjum
27;t being used. When I added them, I found tens of warnings in just mm suite. In this series, I'm fixing those warnings. The last check adds the compiler flags with which the warnings have been caught. Muhammad Usama Anjum (16): selftests/mm: remove argc and argv unused parameters se

[PATCH 4/4] selftests/mm: mremap_test: Remove unused variable and type mismatches

2024-12-09 Thread Muhammad Usama Anjum
Remove unused variable and fix type mismatches. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/mremap_test.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tools/testing/selftests/mm/mremap_test.c b/tools/testing/selftests/mm

[PATCH 3/4] selftests/mm: mseal_test: remove unused variables

2024-12-09 Thread Muhammad Usama Anjum
Fix following warnings: - Remove unused variables and fix following warnings: Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/mseal_test.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/mm/mseal_test.c b/tools/testing

[PATCH 2/4] selftests/mm: pagemap_ioctl: Fix types mismatches shown by compiler options

2024-12-09 Thread Muhammad Usama Anjum
Fix following warnings caught by compiler: - There are several type mismatches among different variables. - Remove unused variable warnings. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/pagemap_ioctl.c | 108 +++-- tools/testing/selftests/mm/vm_util.c

[PATCH 0/4] selftest/mm: Remove warnings found by adding compiler flags

2024-12-09 Thread Muhammad Usama Anjum
27;t being used. When I added them, I found tens of warnings in just mm suite. In this series, I'm fixing those warnings in a few files. More fixes would be sent later. Muhammad Usama Anjum (4): selftests/mm: thp_settings: remove const from return type selftests/mm: pagemap_ioctl: Fix t

[PATCH 1/4] selftests/mm: thp_settings: remove const from return type

2024-12-09 Thread Muhammad Usama Anjum
Remove cost from the return type as it is ignored anyways and generates the warning: warning: type qualifiers ignored on function return type [-Wignored-qualifiers] Signed-off-by: Muhammad Usama Anjum --- Optional fixes tag. Fixes: 00679a183ac6 ("selftests/mm: factor out thp set

[PATCH 0/4] selftest/mm: Remove warnings foun

2024-12-09 Thread Muhammad Usama Anjum
27;t being used. When I added them, I found tens of warnings in just mm suite. In this series, I'm fixing those warnings in a few files. More fixes would be sent later. Muhammad Usama Anjum (4): selftests/mm: thp_settings: remove const from return type selftests/mm: pagemap_ioctl: Fix t

Re: [PATCH] selftests/ipc: Remove unused variables

2024-12-01 Thread Muhammad Usama Anjum
On 12/2/24 9:58 AM, zhangjiao2 wrote: > From: zhang jiao > > Delete variables "msg" and "pid" that have never been used. > > Signed-off-by: zhang jiao Reviewed-by: Muhammad Usama Anjum > --- > tools/testing/selftests/ipc/msgque.c | 2 +- >

Re: [PATCH] selftest: hugetlb_dio: Fix test naming

2024-11-27 Thread Muhammad Usama Anjum
of the result with a single ksft_print_result() which incorporates > the parameters passed into the test into the output. > > Fixes: fae1980347bf ("selftests: hugetlb_dio: fixup check for initial > conditions to skip in the start") > Signed-off-by: Mark Brown Reviewed-by: Muhamm

Re: [PATCH] selftests: Warn about skipped tests in result summary

2024-11-25 Thread Muhammad Usama Anjum
diff --git a/tools/testing/selftests/kselftest/ktap_helpers.sh >> b/tools/testing/selftests/kselftest/ktap_helpers.sh >> index 79a125eb24c2..a4211221ccd6 100644 >> --- a/tools/testing/selftests/kselftest/ktap_helpers.sh >> +++ b/tools/testing/selftests/kselftest/ktap_helpers.sh >> @@ -107,5 +107,9 @@ ktap_finished() { >>   } >>     ktap_print_totals() { >> +    if [ "$KTAP_CNT_SKIP" -gt 0 ]; then >> +    echo "# Skipped tests detected. " \ >> +    "Consider enabling relevant config options to improve coverage." >> +    fi >>   echo "# Totals: pass:$KTAP_CNT_PASS fail:$KTAP_CNT_FAIL xfail:0 >> xpass:0 skip:$KTAP_CNT_SKIP error:0" >>   } > > thanks, > -- Shuah > -- BR, Muhammad Usama Anjum

Re: [PATCH v1] selftests: mm: Fix conversion specifiers in transact_test()

2024-11-19 Thread Muhammad Usama Anjum
s") > Signed-off-by: guanjing Reviewed-by: Muhammad Usama Anjum > --- > tools/testing/selftests/mm/pagemap_ioctl.c | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/tools/testing/selftests/mm/pagemap_ioctl.c > b/tools/testing/self

Re: [PATCH] selftests: hugetlb_dio: Check for initial conditions to skip in the start

2024-11-08 Thread Muhammad Usama Anjum
ages after munmap : 100 > ok 3 : Huge pages freed successfully ! > # No. Free pages before allocation : 100 > # No. Free pages after munmap : 100 > ok 4 : Huge pages freed successfully ! > # Totals: pass:4 fail:0 xfail:0 xpass:0 skip:0 error:0 > > Thanks > Donet > > -- BR, Muhammad Usama Anjum

[PATCH] selftests: hugetlb_dio: Check for initial conditions to skip in the start

2024-11-01 Thread Muhammad Usama Anjum
only execute if huge pages are free. Signed-off-by: Muhammad Usama Anjum --- Before: TAP version 13 1..4 Bail out! Error opening file : Read-only file system (30) # Planned tests != run tests (4 != 0) # Totals: pass:0 fail:0 xfail:0 xpass:0 skip:0 error:0 After: TAP version 13 1..0 # SKIP Unab

Re: [PATCH v1 1/2] selftests/x86/syscall: fix coccinelle WARNING recommending the use of ARRAY_SIZE()

2024-11-01 Thread Muhammad Usama Anjum
el.org > Cc: linux-kselft...@vger.kernel.org > Signed-off-by: Mirsad Todorovac Reviewed-by: Muhammad Usama Anjum > --- > v1: initial version. > > tools/testing/selftests/x86/syscall_numbering.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > >

Re: [PATCH] kvm: selftest: fix noop test in guest_memfd_test.c

2024-10-26 Thread Muhammad Usama Anjum
eate_guest_memfd(vm, page_size, flag); > TEST_ASSERT(fd == -1 && errno == EINVAL, > "guest_memfd() with flag '0x%lx' should fail with > EINVAL", Reviewed-by: Muhammad Usama Anjum -- BR, Muhammad Usama Anjum

[Bug Report] Wrong value of __NR_userfaultfd in asm-generic/unistd.h

2024-10-20 Thread Muhammad Usama Anjum
-generic/unistd.h in 09f7298100ea ("Subject: [PATCH] userfaultfd: register uapi generic syscall (aarch64)"). [1] https://lore.kernel.org/all/20240912103151.1520254-1-usama.an...@collabora.com -- BR, /Muhammad Usama Anjum

Re: [PATCH 1/2] selftests/mm: replace atomic_bool with pthread_barrier_t

2024-10-06 Thread Muhammad Usama Anjum
e the child has > a chance to start doing work. > > Fixes: 8c864371b2a1 ("selftests/mm: fix ARM related issue with fork after > pthread_create") > Signed-off-by: Edward Liaw Reviewed-by: Muhammad Usama Anjum > --- > tools/testing/selftests/mm/uffd-common.c

Re: [PATCH] selftests: make kselftest-clean remove libynl outputs

2024-10-06 Thread Muhammad Usama Anjum
)/tools/net/ynl GENS="$(YNL_GENS)" libynl.a > $(Q)cp $(top_srcdir)/tools/net/ynl/libynl.a $(OUTPUT)/libynl.a > + > +EXTRA_CLEAN += \ > + $(top_srcdir)/tools/net/ynl/lib/__pycache__ \ > + $(top_srcdir)/tools/net/ynl/lib/*.[ado] Reviewed-by: Muhammad Usama Anjum -- BR, Muhammad Usama Anjum

Re: [PATCH] selftests/mm: Add missing free.

2024-09-27 Thread Muhammad Usama Anjum
kdirty.c > @@ -280,6 +280,7 @@ static void test_uffdio_copy(void) > dst = mmap(NULL, pagesize, PROT_READ, MAP_PRIVATE|MAP_ANON, -1, 0); > if (dst == MAP_FAILED) { > ksft_test_result_fail("mmap() failed\n"); > + free(src); > return; > } > -- BR, Muhammad Usama Anjum

Re: [PATCH] selftests/mm: Fixed incorrect buffer->mirror size in hmm2 double_map test

2024-09-27 Thread Muhammad Usama Anjum
Result with this patch > === > # RUN hmm2.hmm2_device_private.double_map ... > #OK hmm2.hmm2_device_private.double_map > ok 53 hmm2.hmm2_device_private.double_map > > Signed-off-by: Donet Tom Please add Fixes-by tag. Other than this

Re: [PATCH 1/2] kselftests: mm: Fix wrong __NR_userfaultfd value

2024-09-23 Thread Muhammad Usama Anjum
On 9/23/24 9:02 PM, Shuah Khan wrote: > On 9/22/24 23:35, Muhammad Usama Anjum wrote: >> ... >> >>>> grep -rnIF "#define __NR_userfaultfd" >>>> tools/include/uapi/asm-generic/unistd.h:681:#define __NR_userfaultfd >>>> 282 >

[PATCH v2] kselftests: mm: Fix wrong __NR_userfaultfd value

2024-09-22 Thread Muhammad Usama Anjum
he correct number of this syscall on x86_64 is 323. Fix the header to asm/unistd.h. Fixes: a5c6bc590094 ("selftests/mm: remove local __NR_* definitions") Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/pagemap_ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

Re: [PATCH 1/2] kselftests: mm: Fix wrong __NR_userfaultfd value

2024-09-22 Thread Muhammad Usama Anjum
he best course of > action. > We might have other NR_ defines in these two files that are causing > problems > for tests and tools that we haven't uncovered yet. Added authors of these patches. > > thanks, > -- Shuah -- BR, Muhammad Usama Anjum

Re: [PATCH 1/2] kselftests: mm: Fix wrong __NR_userfaultfd value

2024-09-17 Thread Muhammad Usama Anjum
On 9/18/24 10:46 AM, Muhammad Usama Anjum wrote: > On 9/17/24 6:56 AM, Shuah Khan wrote: >> On 9/16/24 00:32, Muhammad Usama Anjum wrote: >>> On 9/12/24 8:44 PM, Shuah Khan wrote: >>>> On 9/12/24 04:31, Muhammad Usama Anjum wrote: >>>>> The valu

Re: [PATCH 1/2] kselftests: mm: Fix wrong __NR_userfaultfd value

2024-09-17 Thread Muhammad Usama Anjum
On 9/17/24 6:56 AM, Shuah Khan wrote: > On 9/16/24 00:32, Muhammad Usama Anjum wrote: >> On 9/12/24 8:44 PM, Shuah Khan wrote: >>> On 9/12/24 04:31, Muhammad Usama Anjum wrote: >>>> The value of __NR_userfaultfd was changed to 282 when >>>> asm-generic/u

Re: [PATCH 2/2] kselftests: mm: Fail the test if userfaultfd syscall isn't found

2024-09-15 Thread Muhammad Usama Anjum
On 9/12/24 10:28 PM, Shuah Khan wrote: > On 9/12/24 10:10, Shuah Khan wrote: >> On 9/12/24 04:31, Muhammad Usama Anjum wrote: >>> The userfaultfd is enabled in the config fragment of mm selftest suite. >>> It must always be present. If it isn't present, we should t

Re: [PATCH 1/2] kselftests: mm: Fix wrong __NR_userfaultfd value

2024-09-15 Thread Muhammad Usama Anjum
On 9/12/24 8:44 PM, Shuah Khan wrote: > On 9/12/24 04:31, Muhammad Usama Anjum wrote: >> The value of __NR_userfaultfd was changed to 282 when >> asm-generic/unistd.h was included. It makes the test to fail every time >> as the correct number of this syscall on x86_64 is 323.

Re: [PATCH] selftests: mm: Fix build errors on armhf

2024-09-15 Thread Muhammad Usama Anjum
On 9/14/24 3:33 AM, Jeff Xu wrote: > On Mon, Aug 19, 2024 at 3:05 AM Muhammad Usama Anjum > wrote: >> >> On 8/14/24 3:29 AM, Jeff Xu wrote: >>> Hi Muhammad >>> >>> On Fri, Aug 9, 2024 at 1:25 AM Muhammad Usama Anjum >>> wrote: >>>&g

[PATCH 2/2] kselftests: mm: Fail the test if userfaultfd syscall isn't found

2024-09-12 Thread Muhammad Usama Anjum
The userfaultfd is enabled in the config fragment of mm selftest suite. It must always be present. If it isn't present, we should throw error and not just skip. This would have helped us catch the test breakage. Adding this now to catch the future breakages. Signed-off-by: Muhammad Usama

[PATCH 1/2] kselftests: mm: Fix wrong __NR_userfaultfd value

2024-09-12 Thread Muhammad Usama Anjum
ned-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/pagemap_ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/mm/pagemap_ioctl.c b/tools/testing/selftests/mm/pagemap_ioctl.c index fc90af2a97b80..bcc73b4e805c6 100644 --- a/tools/testing

Re: [PATCH] selftests:resctrl: Fix build failure on archs without __cpuid_count()

2024-09-06 Thread Muhammad Usama Anjum
ftest.h:74:9: error: impossible constraint in ‘asm’ >74 | __asm__ __volatile__ ("cpuid\n\t" > \ > | ^~~ > cat_test.c:306:17: note: in expansion of macro ‘__cpuid_count’ > 306 | __cpuid_count(0x10, 2, eax, ebx,

Re: [v5.15] WARNING in kvm_arch_vcpu_ioctl_run

2024-01-09 Thread Muhammad Usama Anjum
ignature are ignored. > > Kernel: Linux 5.15 > Dashboard link: https://syzkaller.appspot.com/bug?extid=412c9ae97b4338c5187e > > --- > [1] I expect the commit to be present in: > > 1. linux-5.15.y branch of > git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git -- BR, Muhammad Usama Anjum

Re: [v5.15] WARNING in kvm_arch_vcpu_ioctl_run

2023-11-27 Thread Muhammad Usama Anjum
es with > the same signature are ignored. > > Kernel: Linux 5.15 > Dashboard link: https://syzkaller.appspot.com/bug?extid=412c9ae97b4338c5187e > > --- > [1] I expect the commit to be present in: > > 1. linux-5.15.y branch of > git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git -- BR, Muhammad Usama Anjum

[PATCH v2] cifs: remove unnecessary copies of tcon->crfid.fid

2021-04-15 Thread Muhammad Usama Anjum
pfid is being set to tcon->crfid.fid and they are copied in each other multiple times. Remove the memcopy between same pointers - memory locations. Addresses-Coverity: ("Overlapped copy") Fixes: 9e81e8ff74b9 ("cifs: return cached_fid from open_shroot") Signed-off-b

Re: [PATCH] cifs: remove unnecessary copies of tcon->crfid.fid

2021-04-15 Thread Muhammad Usama Anjum
On Wed, 2021-04-14 at 14:00 +0200, Aurélien Aptel wrote: > Muhammad Usama Anjum writes: > > pfid is being set to tcon->crfid.fid and they are copied in each other > > multiple times. Remove the memcopy between same pointers. > > > > Addresses-Coverity: ("Overla

[PATCH] cifs: remove unnecessary copies of tcon->crfid.fid

2021-04-13 Thread Muhammad Usama Anjum
pfid is being set to tcon->crfid.fid and they are copied in each other multiple times. Remove the memcopy between same pointers. Addresses-Coverity: ("Overlapped copy") Fixes: 9e81e8ff74b9 ("cifs: return cached_fid from open_shroot") Signed-off-by: Muhammad Usama Anju

[PATCH] objtool: prevent memory leak in error paths

2021-04-13 Thread Muhammad Usama Anjum
ndef_symbol()") Signed-off-by: Muhammad Usama Anjum --- Only build has been tested. tools/objtool/elf.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c index d08f5f3670f8..17ee265a6c6b 100644 --- a/tools/objtool/

[PATCH] security: keys: trusted: prevent memory leak in error path

2021-04-13 Thread Muhammad Usama Anjum
ASN.1 TPM2 key format for the blobs") Signed-off-by: Muhammad Usama Anjum --- This is only build tested. security/keys/trusted-keys/trusted_tpm2.c | 37 +++ 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/security/keys/trusted-keys/trusted_tpm2.c b/securi

[PATCH] Bluetooth: btusb: fix memory leak

2021-04-13 Thread Muhammad Usama Anjum
If btusb_mtk_submit_wmt_recv_urb returns error, wc should be freed and then error should be returned to prevent memory leak. Addresses-Coverity: ("Prevent memory leak") Fixes: 4cbb375e997d ("Bluetooth: btusb: Fixed too many in-token issue for Mediatek Chip.") Signed-off-by:

Re: [PATCH] xen/pciback: Fix incorrect type warnings

2021-04-13 Thread Muhammad Usama Anjum
Reminder! On Mon, 2021-03-29 at 09:24 +0200, Juergen Gross wrote: > On 26.03.21 19:14, Muhammad Usama Anjum wrote: > > Correct enum pci_channel_io_normal should be used instead of putting > > integer value 1. > > > > Fix following smatch warnings: > > drivers/

[PATCH] block: initialize variable ret with 0

2021-04-09 Thread Muhammad Usama Anjum
ret variable is not being set if get_capacity returns 0 in very first try. It should be initialized with 0 for this case. Addresses-Coverity: ("Uninitialized variable") Fixes: d3c4a43d92 ("block: refactor blk_drop_partitions") Signed-off-by: Muhammad Usama Anjum --- fs/b

Re: New Defects reported by Coverity Scan for linux-next weekly scan

2021-04-09 Thread Muhammad Usama Anjum
On Thu, 2021-04-08 at 17:13 +, scan-ad...@coverity.com wrote: > ** CID 1503714:(DEADCODE) > /drivers/staging/rtl8723bs/os_dep/ioctl_linux.c: 367 in wpa_set_auth_algs() > /drivers/staging/rtl8723bs/os_dep/ioctl_linux.c: 357 in wpa_set_auth_algs() > > > _

[PATCH] net: ipv6: check for validity before dereferencing cfg->fc_nlinfo.nlh

2021-04-08 Thread Muhammad Usama Anjum
nlh is being checked for validtity two times when it is dereferenced in this function. Check for validity again when updating the flags through nlh pointer to make the dereferencing safe. CC: Addresses-Coverity: ("NULL pointer dereference") Signed-off-by: Muhammad Usama Anjum ---

  1   2   >