[Devel] [PATCH RHEL10 COMMIT] selftests/prctl: remove unused variable 'j' in set-process-name

Konstantin Khorenko khorenko at virtuozzo.com
Tue Mar 31 23:33:08 MSK 2026


The commit is pushed to "branch-rh10-6.12.0-55.52.1.5.x.vz10-ovz" and will appear at git at bitbucket.org:openvz/vzkernel.git
after rh10-6.12.0-55.52.1.5.12.vz10
------>
commit 528114ee178bede7d3f4455b2e4999f35d7581d3
Author: Konstantin Khorenko <khorenko at virtuozzo.com>
Date:   Mon Mar 23 21:31:32 2026 +0100

    selftests/prctl: remove unused variable 'j' in set-process-name
    
      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>
    Reviewed-by: Vasileios Almpanis <vasileios.almpanis 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 562f707ba771d..27468cb86a390 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