Skip to content

[PW_SID:987419] selftests/mm: Add compiler flags and fix found warnings - #714

Closed
linux-riscv-bot wants to merge 9 commits into
workflowfrom
pw987419
Closed

[PW_SID:987419] selftests/mm: Add compiler flags and fix found warnings#714
linux-riscv-bot wants to merge 9 commits into
workflowfrom
pw987419

Conversation

@linux-riscv-bot

Copy link
Copy Markdown

PR for series 987419 applied to workflow

Name: selftests/mm: Add compiler flags and fix found warnings
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=987419
Version: 2

Linux RISC-V bot and others added 9 commits July 31, 2025 23:47
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

Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Reviewed-by: Sidhartha Kumar <sidhartha.kumar@oracle.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.

Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Reviewed-by: Sidhartha Kumar <sidhartha.kumar@oracle.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.

Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
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 <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>
Mark the arguments which cannot be removed with __unused attribute.

Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Mark the arguments which cannot be removed with __unused attribute.

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>
@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v2,1/8] selftests/mm: Add -Wunreachable-code and fix warnings"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 103.67 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v2,1/8] selftests/mm: Add -Wunreachable-code and fix warnings"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 935.30 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v2,1/8] selftests/mm: Add -Wunreachable-code and fix warnings"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1255.66 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v2,1/8] selftests/mm: Add -Wunreachable-code and fix warnings"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 21.93 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v2,1/8] selftests/mm: Add -Wunreachable-code and fix warnings"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 22.90 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v2,1/8] selftests/mm: Add -Wunreachable-code and fix warnings"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 1.36 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v2,1/8] selftests/mm: Add -Wunreachable-code and fix warnings"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 74.05 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v2,1/8] selftests/mm: Add -Wunreachable-code and fix warnings"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v2,1/8] selftests/mm: Add -Wunreachable-code and fix warnings"
kdoc
Desc: Detects for kdoc errors
Duration: 1.25 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v2,1/8] selftests/mm: Add -Wunreachable-code and fix warnings"
module-param
Desc: Detect module_param changes
Duration: 0.27 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v2,1/8] selftests/mm: Add -Wunreachable-code and fix warnings"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v2,1/8] selftests/mm: Add -Wunreachable-code and fix warnings"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.31 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v2,2/8] selftests/mm: protection_keys: Fix dead code"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 103.41 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v2,2/8] selftests/mm: protection_keys: Fix dead code"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 930.09 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v2,2/8] selftests/mm: protection_keys: Fix dead code"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1256.55 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v2,2/8] selftests/mm: protection_keys: Fix dead code"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 21.39 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v2,2/8] selftests/mm: protection_keys: Fix dead code"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 22.87 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v2,2/8] selftests/mm: protection_keys: Fix dead code"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.71 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v2,2/8] selftests/mm: protection_keys: Fix dead code"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 74.24 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v2,2/8] selftests/mm: protection_keys: Fix dead code"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v2,2/8] selftests/mm: protection_keys: Fix dead code"
kdoc
Desc: Detects for kdoc errors
Duration: 0.89 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 8: "[v2,8/8] selftests/mm: Fix unused parameter warnings for different architectures"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 22.17 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 8: "[v2,8/8] selftests/mm: Fix unused parameter warnings for different architectures"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 22.96 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 8: "[v2,8/8] selftests/mm: Fix unused parameter warnings for different architectures"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 1.91 seconds
Result: WARNING
Output:

CHECK: architecture specific defines should be avoided
#26: FILE: tools/testing/selftests/mm/mseal_test.c:134:
+#if defined(__i386__) || defined(__x86_64__) /* arch */

total: 0 errors, 0 warnings, 1 checks, 75 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Commit 9d6542b39c6f ("selftests/mm: Fix unused parameter warnings for different architectures") has style problems, please review.

NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT CAMELCASE COMMIT_LOG_LONG_LINE GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.
total: 0 errors, 0 warnings, 1 checks, 75 lines checked
CHECK: architecture specific defines should be avoided


@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 8: "[v2,8/8] selftests/mm: Fix unused parameter warnings for different architectures"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 74.25 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 8: "[v2,8/8] selftests/mm: Fix unused parameter warnings for different architectures"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 8: "[v2,8/8] selftests/mm: Fix unused parameter warnings for different architectures"
kdoc
Desc: Detects for kdoc errors
Duration: 0.90 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 8: "[v2,8/8] selftests/mm: Fix unused parameter warnings for different architectures"
module-param
Desc: Detect module_param changes
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 8: "[v2,8/8] selftests/mm: Fix unused parameter warnings for different architectures"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 8: "[v2,8/8] selftests/mm: Fix unused parameter warnings for different architectures"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.32 seconds
Result: PASS

@linux-riscv-bot
linux-riscv-bot force-pushed the workflow branch 19 times, most recently from 25d60d7 to f9e6a09 Compare August 7, 2025 05:08
@linux-riscv-bot
linux-riscv-bot deleted the pw987419 branch August 8, 2025 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant