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

Zi Yan ziy at nvidia.com
Fri Aug 22 10:11:18 PDT 2025


On 22 Aug 2025, at 4:20, Muhammad Usama Anjum wrote:

> 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 at oracle.com>
> Signed-off-by: Muhammad Usama Anjum <usama.anjum at collabora.com>
> ---
>  tools/testing/selftests/mm/protection_keys.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>

LGTM. Acked-by: Zi Yan <ziy at nvidia.com>

--
Best Regards,
Yan, Zi



More information about the linux-riscv mailing list