[PW_SID:994570] selftests/mm: Add compiler flags and fix found warnings - #823
[PW_SID:994570] selftests/mm: Add compiler flags and fix found warnings#823linux-riscv-bot wants to merge 8 commits into
Conversation
Enable -Wunreachable-code flag to catch dead code and fix them.
1. Remove the dead code and write a comment instead:
hmm-tests.c:2033:3: warning: code will never be executed
[-Wunreachable-code]
perror("Should not reach this\n");
^~~~~~
2. ksft_exit_fail_msg() calls exit(). Remove the dead code.
split_huge_page_test.c:301:3: warning: code will never be executed
[-Wunreachable-code]
goto cleanup;
^~~~~~~~~~~~
3. Remove duplicate inline.
pkey_sighandler_tests.c:44:15: warning: duplicate 'inline' declaration
specifier [-Wduplicate-decl-specifier]
static inline __always_inline
Reviewed-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
The while loop doesn't execute and following warning gets generated:
protection_keys.c:561:15: warning: code will never be executed
[-Wunreachable-code]
int rpkey = alloc_random_pkey();
Let's enable the while loop such that it gets executed nr_iterations
times. Simplify the code a bit as well.
Reviewed-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
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. Add always_unused and maybe_unused variants just like kernel itself have. Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add -Wunused 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 <usama.anjum@collabora.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Cleanup code and remove the unused arguments Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
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 <usama.anjum@collabora.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Use __always_unused macro instead of raw compiler attribute. Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
__maybe_unused is now defined in the kselftest.h. Remove from this file as its not required. Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "[v3,1/8] selftests/mm: Add -Wunreachable-code and fix warnings" |
|
Patch 1: "[v3,1/8] selftests/mm: Add -Wunreachable-code and fix warnings" |
|
Patch 1: "[v3,1/8] selftests/mm: Add -Wunreachable-code and fix warnings" |
|
Patch 1: "[v3,1/8] selftests/mm: Add -Wunreachable-code and fix warnings" |
|
Patch 1: "[v3,1/8] selftests/mm: Add -Wunreachable-code and fix warnings" |
|
Patch 1: "[v3,1/8] selftests/mm: Add -Wunreachable-code and fix warnings" |
|
Patch 1: "[v3,1/8] selftests/mm: Add -Wunreachable-code and fix warnings" |
|
Patch 1: "[v3,1/8] selftests/mm: Add -Wunreachable-code and fix warnings" |
|
Patch 1: "[v3,1/8] selftests/mm: Add -Wunreachable-code and fix warnings" |
|
Patch 1: "[v3,1/8] selftests/mm: Add -Wunreachable-code and fix warnings" |
|
Patch 1: "[v3,1/8] selftests/mm: Add -Wunreachable-code and fix warnings" |
|
Patch 1: "[v3,1/8] selftests/mm: Add -Wunreachable-code and fix warnings" |
|
Patch 2: "[v3,2/8] selftests/mm: protection_keys: Fix dead code" |
|
Patch 2: "[v3,2/8] selftests/mm: protection_keys: Fix dead code" |
|
Patch 2: "[v3,2/8] selftests/mm: protection_keys: Fix dead code" |
|
Patch 2: "[v3,2/8] selftests/mm: protection_keys: Fix dead code" |
|
Patch 2: "[v3,2/8] selftests/mm: protection_keys: Fix dead code" |
|
Patch 2: "[v3,2/8] selftests/mm: protection_keys: Fix dead code" |
|
Patch 2: "[v3,2/8] selftests/mm: protection_keys: Fix dead code" |
|
Patch 2: "[v3,2/8] selftests/mm: protection_keys: Fix dead code" |
|
Patch 2: "[v3,2/8] selftests/mm: protection_keys: Fix dead code" |
|
Patch 2: "[v3,2/8] selftests/mm: protection_keys: Fix dead code" |
|
Patch 6: "[v3,6/8] selftests/mm: Fix unused parameter warnings for different architectures" |
|
Patch 6: "[v3,6/8] selftests/mm: Fix unused parameter warnings for different architectures" |
|
Patch 6: "[v3,6/8] selftests/mm: Fix unused parameter warnings for different architectures" |
|
Patch 6: "[v3,6/8] selftests/mm: Fix unused parameter warnings for different architectures" |
|
Patch 6: "[v3,6/8] selftests/mm: Fix unused parameter warnings for different architectures" |
|
Patch 6: "[v3,6/8] selftests/mm: Fix unused parameter warnings for different architectures" |
|
Patch 7: "[v3,7/8] selftests/mm: mark variable unused with macro" |
|
Patch 7: "[v3,7/8] selftests/mm: mark variable unused with macro" |
|
Patch 7: "[v3,7/8] selftests/mm: mark variable unused with macro" |
|
Patch 7: "[v3,7/8] selftests/mm: mark variable unused with macro" |
|
Patch 7: "[v3,7/8] selftests/mm: mark variable unused with macro" |
|
Patch 7: "[v3,7/8] selftests/mm: mark variable unused with macro" |
|
Patch 7: "[v3,7/8] selftests/mm: mark variable unused with macro" |
|
Patch 7: "[v3,7/8] selftests/mm: mark variable unused with macro" |
|
Patch 7: "[v3,7/8] selftests/mm: mark variable unused with macro" |
|
Patch 7: "[v3,7/8] selftests/mm: mark variable unused with macro" |
|
Patch 7: "[v3,7/8] selftests/mm: mark variable unused with macro" |
|
Patch 7: "[v3,7/8] selftests/mm: mark variable unused with macro" |
|
Patch 8: "[v3,8/8] selftests/mm: pkey-helpers: Remove duplicate __maybe_unused" |
|
Patch 8: "[v3,8/8] selftests/mm: pkey-helpers: Remove duplicate __maybe_unused" |
|
Patch 8: "[v3,8/8] selftests/mm: pkey-helpers: Remove duplicate __maybe_unused" |
|
Patch 8: "[v3,8/8] selftests/mm: pkey-helpers: Remove duplicate __maybe_unused" |
|
Patch 8: "[v3,8/8] selftests/mm: pkey-helpers: Remove duplicate __maybe_unused" |
|
Patch 8: "[v3,8/8] selftests/mm: pkey-helpers: Remove duplicate __maybe_unused" |
|
Patch 8: "[v3,8/8] selftests/mm: pkey-helpers: Remove duplicate __maybe_unused" |
|
Patch 8: "[v3,8/8] selftests/mm: pkey-helpers: Remove duplicate __maybe_unused" |
|
Patch 8: "[v3,8/8] selftests/mm: pkey-helpers: Remove duplicate __maybe_unused" |
|
Patch 8: "[v3,8/8] selftests/mm: pkey-helpers: Remove duplicate __maybe_unused" |
|
Patch 8: "[v3,8/8] selftests/mm: pkey-helpers: Remove duplicate __maybe_unused" |
|
Patch 8: "[v3,8/8] selftests/mm: pkey-helpers: Remove duplicate __maybe_unused" |
PR for series 994570 applied to workflow__riscv__fixes
Name: selftests/mm: Add compiler flags and fix found warnings
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=994570
Version: 3