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

From: Zi Yan
Date: Fri Aug 22 2025 - 13:13:40 EST


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

LGTM. Acked-by: Zi Yan <ziy@xxxxxxxxxx>

--
Best Regards,
Yan, Zi