Skip to contentSkip to conversation

open: clean up make check findings

PATCH In review Jinseok Kim 2 participants 3 messages Feb 26 – Mar 4

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 open: clean up make check findings

Fix various issues reported by make check in open syscall tests:

- Replace space indentation with tabs
- Remove extra blank lines
- Mark setup/cleanup helpers as static
- Add missing SPDX-License-Identifier
- Fix typo in error message
- Fix documentation comments

---
 testcases/kernel/syscalls/open/open01.c       | 2 +-
 testcases/kernel/syscalls/open/open02.c       | 6 +++---
 testcases/kernel/syscalls/open/open03.c       | 2 --
 testcases/kernel/syscalls/open/open11.c       | 4 ++--
 testcases/kernel/syscalls/open/open12_child.c | 1 +
 testcases/kernel/syscalls/open/open14.c       | 2 +-
 6 files changed, 8 insertions(+), 9 deletions(-)
testcases/kernel/syscalls/open/open01.c +1 -1
index 3ae1b269b..e5e598e56 100644
@@ -5,7 +5,7 @@
  *    06/2017 Modified by Guangwen Feng <[email protected]>
  */
 
-/*
+/*\
  * DESCRIPTION
  *	Open a file with oflag = O_CREAT set, does it set the sticky bit off?
  *
testcases/kernel/syscalls/open/open02.c +3 -3
index e1c5cc5dc..30b129019 100644
@@ -29,7 +29,7 @@ static struct tcase {
 	{TEST_FILE2, O_RDONLY | O_NOATIME, EPERM, "unprivileged O_RDONLY | O_NOATIME"},
 };
 
-void setup(void)
+static void setup(void)
 {
 	struct passwd *ltpuser;
 
@@ -45,10 +45,10 @@ static void verify_open(unsigned int n)
 	struct tcase *tc = &tcases[n];
 
 	TST_EXP_FAIL2(open(tc->filename, tc->flag, 0444),
-	             tc->exp_errno, "open() %s", tc->desc);
+			tc->exp_errno, "open() %s", tc->desc);
 }
 
-void cleanup(void)
+static void cleanup(void)
 {
 	SAFE_SETEUID(0);
 }
testcases/kernel/syscalls/open/open03.c +0 -2
index 275ca84f0..53baf1028 100644
@@ -19,8 +19,6 @@ static void verify_open(void)
 	SAFE_UNLINK(TEST_FILE);
 }
 
-
-
 static struct tst_test test = {
 	.needs_tmpdir = 1,
 	.test_all = verify_open,
testcases/kernel/syscalls/open/open11.c +2 -2
index 6f89d558d..2d4b4e821 100644
@@ -269,10 +269,10 @@ static void verify_open(unsigned int n)
 {
 	if (tc[n].err > 0) {
 		TST_EXP_FAIL2(open(tc[n].path, tc[n].flags, tc[n].mode),
-		             tc[n].err, "%s", tc[n].desc);
+				tc[n].err, "%s", tc[n].desc);
 	} else if (tc[n].err == 0) {
 		TST_EXP_FD(open(tc[n].path, tc[n].flags, tc[n].mode),
-		           "%s", tc[n].desc);
+				"%s", tc[n].desc);
 	} else {
 		TEST(open(tc[n].path, tc[n].flags, tc[n].mode));
 		tst_res(TPASS, "%s", tc[n].desc);
testcases/kernel/syscalls/open/open12_child.c +1 -0
index a6dabd5d2..2c3411426 100644
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (c) 2014 Fujitsu Ltd.
  * Author: Zeng Linggang <[email protected]>
testcases/kernel/syscalls/open/open14.c +1 -1
index a3c7d38a2..7f3babda3 100644
@@ -108,7 +108,7 @@ static int read_file(int fd)
 		SAFE_READ(0, fd, tmp, size);
 
 		if (memcmp(buf, tmp, size)) {
-			tst_res(TFAIL, "got unexepected data");
+			tst_res(TFAIL, "got unexpected data");
 			return 1;
 		}
 	}

--
2.43.0

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp