[LTP] [COMMITTED 1/2] syscalls/shmctl: make make check happy

Yang Xu xuyang2018.jy@fujitsu.com
Thu Dec 2 02:58:53 CET 2021


Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
 testcases/kernel/syscalls/ipc/shmctl/shmctl01.c |  8 ++++----
 testcases/kernel/syscalls/ipc/shmctl/shmctl03.c |  3 +--
 testcases/kernel/syscalls/ipc/shmctl/shmctl04.c | 13 +++++++------
 testcases/kernel/syscalls/ipc/shmctl/shmctl08.c |  6 +++---
 4 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c b/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c
index 789fc8c72..e631b7b21 100644
--- a/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c
+++ b/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c
@@ -118,7 +118,7 @@ static void check_nattch(int exp_nattch, const char *msg)
 	}
 
 	tst_res(TFAIL, "%s shm_nattcg=%li expected %i",
-	        msg, (long)ds1.shm_nattch, exp_nattch);
+		msg, (long)ds1.shm_nattch, exp_nattch);
 }
 
 static void verify_shmstat_attach(void)
@@ -170,14 +170,14 @@ static void check_ds(struct shmid_ds *ds, const char *desc)
 
 	if (ds->shm_segsz != SHM_SIZE) {
 		tst_res(TFAIL, "%s: shm_segsz=%zu, expected %i",
-		        desc, ds->shm_segsz, SHM_SIZE);
+			desc, ds->shm_segsz, SHM_SIZE);
 	} else {
 		tst_res(TPASS, "%s: shm_segsz=%i", desc, SHM_SIZE);
 	}
 
 	if (ds->shm_cpid != pid) {
 		tst_res(TFAIL, "%s: shm_cpid=%i, expected %i",
-		        desc, ds->shm_cpid, pid);
+			desc, ds->shm_cpid, pid);
 	} else {
 		tst_res(TPASS, "%s: shm_cpid=%i", desc, pid);
 	}
@@ -232,7 +232,7 @@ static int get_shm_idx_from_id(int shm_id)
 	struct shmid_ds dummy_ds;
 	int max_idx, i;
 
-	max_idx = SAFE_SHMCTL(shm_id, SHM_INFO, (void*)&dummy);
+	max_idx = SAFE_SHMCTL(shm_id, SHM_INFO, (void *)&dummy);
 
 	for (i = 0; i <= max_idx; i++) {
 		if (shmctl(i, SHM_STAT, &dummy_ds) == shm_id)
diff --git a/testcases/kernel/syscalls/ipc/shmctl/shmctl03.c b/testcases/kernel/syscalls/ipc/shmctl/shmctl03.c
index 0f700a9bd..199ee4105 100644
--- a/testcases/kernel/syscalls/ipc/shmctl/shmctl03.c
+++ b/testcases/kernel/syscalls/ipc/shmctl/shmctl03.c
@@ -23,8 +23,7 @@ static void verify_ipcinfo(void)
 
 	if (TST_RET < 0) {
 		tst_res(TFAIL | TTERRNO,
-		        "shmctl(0, IPC_INFO, ...) returned %li",
-		        TST_RET);
+			"shmctl(0, IPC_INFO, ...) returned %li", TST_RET);
 		return;
 	}
 
diff --git a/testcases/kernel/syscalls/ipc/shmctl/shmctl04.c b/testcases/kernel/syscalls/ipc/shmctl/shmctl04.c
index 724610ef0..b244026ce 100644
--- a/testcases/kernel/syscalls/ipc/shmctl/shmctl04.c
+++ b/testcases/kernel/syscalls/ipc/shmctl/shmctl04.c
@@ -69,7 +69,7 @@ static void parse_proc_sysvipc(struct shm_info *info)
 	 * size.
 	 */
 	while (fscanf(f, "%*i %i %*i %i %*i %*i %*i %*i %*i %*i %*i %*i %*i %*i %i %i",
-	              &shmid, &size, &rss, &swap) > 0) {
+			&shmid, &size, &rss, &swap) > 0) {
 		used_ids++;
 		shm_rss += rss/page_size;
 		shm_swp += swap/page_size;
@@ -80,28 +80,28 @@ static void parse_proc_sysvipc(struct shm_info *info)
 
 	if (info->used_ids != used_ids) {
 		tst_res(TFAIL, "used_ids = %i, expected %i",
-		        info->used_ids, used_ids);
+			info->used_ids, used_ids);
 	} else {
 		tst_res(TPASS, "used_ids = %i", used_ids);
 	}
 
 	if (info->shm_rss != shm_rss) {
 		tst_res(TFAIL, "shm_rss = %li, expected %li",
-		        info->shm_rss, shm_rss);
+			info->shm_rss, shm_rss);
 	} else {
 		tst_res(TPASS, "shm_rss = %li", shm_rss);
 	}
 
 	if (info->shm_swp != shm_swp) {
 		tst_res(TFAIL, "shm_swp = %li, expected %li",
-		        info->shm_swp, shm_swp);
+			info->shm_swp, shm_swp);
 	} else {
 		tst_res(TPASS, "shm_swp = %li", shm_swp);
 	}
 
 	if (info->shm_tot != shm_tot) {
 		tst_res(TFAIL, "shm_tot = %li, expected %li",
-		        info->shm_tot, shm_tot);
+			info->shm_tot, shm_tot);
 	} else {
 		tst_res(TPASS, "shm_tot = %li", shm_tot);
 	}
@@ -146,7 +146,7 @@ static void verify_shminfo(unsigned int n)
 		tst_res(TPASS, "Counted used = %i", cnt);
 	} else {
 		tst_res(TFAIL, "Counted used = %i, used_ids = %i",
-		        cnt, info.used_ids);
+			cnt, info.used_ids);
 	}
 
 	parse_proc_sysvipc(&info);
@@ -156,6 +156,7 @@ static void setup(void)
 {
 	struct passwd *ltpuser = SAFE_GETPWNAM("nobody");
 	struct shmid_ds temp_ds;
+
 	nobody_uid = ltpuser->pw_uid;
 	root_uid = 0;
 
diff --git a/testcases/kernel/syscalls/ipc/shmctl/shmctl08.c b/testcases/kernel/syscalls/ipc/shmctl/shmctl08.c
index 88fcfe41f..bb2abca4c 100644
--- a/testcases/kernel/syscalls/ipc/shmctl/shmctl08.c
+++ b/testcases/kernel/syscalls/ipc/shmctl/shmctl08.c
@@ -44,7 +44,7 @@ static void check_mode(struct shmid_ds *ds, short exp_mode)
 	}
 
 	tst_res(TFAIL, "shm_perm.mode=%04o, expected %i",
-	        ds->shm_perm.mode, exp_mode);
+		ds->shm_perm.mode, exp_mode);
 }
 
 static void verify_shmset(void)
@@ -73,10 +73,10 @@ static void verify_shmset(void)
 
 	if (ds.shm_ctime <= old_ctime || ds.shm_ctime > old_ctime + 10) {
 		tst_res(TFAIL, "shm_ctime not updated old %li new %li",
-		        (long)old_ctime, (long)ds.shm_ctime);
+			(long)old_ctime, (long)ds.shm_ctime);
 	} else {
 		tst_res(TPASS, "shm_ctime updated correctly diff=%li",
-		        (long)(ds.shm_ctime - old_ctime));
+			(long)(ds.shm_ctime - old_ctime));
 	}
 
 	ds.shm_perm.mode = old_mode;
-- 
2.23.0



More information about the ltp mailing list