[Devel] [PATCH vz10 13/15] selftests/prctl: remove unused variable 'j' in set-process-name
Vasileios Almpanis
vasileios.almpanis at virtuozzo.com
Mon Mar 30 11:26:41 MSK 2026
Reviewed-by: Vasileios Almpanis <vasileios.almpanis at virtuozzo.com>
On 3/23/26 9:31 PM, Konstantin Khorenko wrote:
> set-process-name.c: In function 'check_name':
> set-process-name.c:61:13: warning: variable 'j' set but not used [-Wunused-but-set-variable]
> 61 | int j;
> | ^
>
> Remove unused 'j' to fix -Wunused-but-set-variable warning.
> The snprintf() return value is not needed here.
>
> https://virtuozzo.atlassian.net/browse/VSTOR-127529
> Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
>
> Feature: fix selftests
> ---
> tools/testing/selftests/prctl/set-process-name.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/prctl/set-process-name.c b/tools/testing/selftests/prctl/set-process-name.c
> index 562f707ba771..27468cb86a39 100644
> --- a/tools/testing/selftests/prctl/set-process-name.c
> +++ b/tools/testing/selftests/prctl/set-process-name.c
> @@ -58,9 +58,8 @@ int check_name(void)
> char path[MAX_PATH_LEN] = {};
> char name[TASK_COMM_LEN] = {};
> char output[TASK_COMM_LEN] = {};
> - int j;
>
> - j = snprintf(path, MAX_PATH_LEN, "/proc/self/task/%d/comm", pid);
> + snprintf(path, MAX_PATH_LEN, "/proc/self/task/%d/comm", pid);
> fptr = fopen(path, "r");
> if (!fptr)
> return -EIO;
More information about the Devel
mailing list