open: clean up make check findings
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
Signed-off-by Jinseok Kim <[email protected]>
--- 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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
Reviewed-by Li Wang <[email protected]>
Signature · 6 lines
Regards, Li Wang -- Mailing list info: https://lists.linux.it/listinfo/ltp
Patch merged, thanks!
Signature · 5 lines
Regards, Li Wang -- Mailing list info: https://lists.linux.it/listinfo/ltp