[LTP] [PATCH 2/2] syscalls/pwritev: Make make check happy
ice_yangxiao@163.com
ice_yangxiao@163.com
Sat Jan 13 15:49:39 CET 2024
From: Xiao Yang <yangx.jy@fujitsu.com>
Signed-off-by: Xiao Yang <yangx.jy@fujitsu.com>
---
testcases/kernel/syscalls/pwritev/pwritev.h | 19 ++------
testcases/kernel/syscalls/pwritev/pwritev01.c | 20 ++++----
testcases/kernel/syscalls/pwritev/pwritev02.c | 46 +++++++++----------
testcases/kernel/syscalls/pwritev/pwritev03.c | 2 +-
4 files changed, 38 insertions(+), 49 deletions(-)
diff --git a/testcases/kernel/syscalls/pwritev/pwritev.h b/testcases/kernel/syscalls/pwritev/pwritev.h
index 833160ddb..6c12027b5 100644
--- a/testcases/kernel/syscalls/pwritev/pwritev.h
+++ b/testcases/kernel/syscalls/pwritev/pwritev.h
@@ -1,18 +1,7 @@
-/*
-* Copyright (c) 2015 Fujitsu Ltd.
-* Author: Xiao Yang <yangx.jy@cn.fujitsu.com>
-*
-* This program is free software; you can redistribute it and/or modify it
-* under the terms of version 2 of the GNU General Public License as
-* published by the Free Software Foundation.
-*
-* This program is distributed in the hope that it would be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-*
-* You should have received a copy of the GNU General Public License
-* alone with this program.
-*/
+/* SPDX-License-Identifier: GPL-2.0-or-later
+ * Copyright (c) 2015 Fujitsu Ltd.
+ * Author: Xiao Yang <yangx.jy@cn.fujitsu.com>
+ */
#ifndef PWRITEV_H
#define PWRITEV_H
diff --git a/testcases/kernel/syscalls/pwritev/pwritev01.c b/testcases/kernel/syscalls/pwritev/pwritev01.c
index 66358f7c4..4c2b84c5b 100644
--- a/testcases/kernel/syscalls/pwritev/pwritev01.c
+++ b/testcases/kernel/syscalls/pwritev/pwritev01.c
@@ -1,17 +1,17 @@
// SPDX-License-Identifier: GPL-2.0-or-later
/*
-* Copyright (c) 2015 Fujitsu Ltd.
-* Author: Xiao Yang <yangx.jy@cn.fujitsu.com>
-*/
+ * Copyright (c) 2015 Fujitsu Ltd.
+ * Author: Xiao Yang <yangx.jy@cn.fujitsu.com>
+ */
/*
-* Test Name: pwritev01
-*
-* Test Description:
-* Testcase to check the basic functionality of the pwritev(2).
-* pwritev(2) should succeed to write the expected content of data
-* and after writing the file, the file offset is not changed.
-*/
+ * Test Name: pwritev01
+ *
+ * Test Description:
+ * Testcase to check the basic functionality of the pwritev(2).
+ * pwritev(2) should succeed to write the expected content of data
+ * and after writing the file, the file offset is not changed.
+ */
#define _GNU_SOURCE
#include <string.h>
diff --git a/testcases/kernel/syscalls/pwritev/pwritev02.c b/testcases/kernel/syscalls/pwritev/pwritev02.c
index 0881b7566..de69d5add 100644
--- a/testcases/kernel/syscalls/pwritev/pwritev02.c
+++ b/testcases/kernel/syscalls/pwritev/pwritev02.c
@@ -1,30 +1,30 @@
// SPDX-License-Identifier: GPL-2.0-or-later
/*
-* Copyright (c) 2015-2016 Fujitsu Ltd.
-* Author: Xiao Yang <yangx.jy@cn.fujitsu.com>
-*/
+ * Copyright (c) 2015-2016 Fujitsu Ltd.
+ * Author: Xiao Yang <yangx.jy@cn.fujitsu.com>
+ */
/*
-* Test Name: pwritev02
-*
-* Description:
-* 1) pwritev(2) fails if iov_len is invalid.
-* 2) pwritev(2) fails if the vector count iovcnt is less than zero.
-* 3) pwritev(2) fails if offset is negative.
-* 4) pwritev(2) fails when attempts to write from a invalid address
-* 5) pwritev(2) fails if file descriptor is invalid.
-* 6) pwritev(2) fails if file descriptor is not open for writing.
-* 7) pwritev(2) fails if fd is associated with a pipe.
-*
-* Expected Result:
-* 1) pwritev(2) should return -1 and set errno to EINVAL.
-* 2) pwritev(2) should return -1 and set errno to EINVAL.
-* 3) pwritev(2) should return -1 and set errno to EINVAL.
-* 4) pwritev(2) should return -1 and set errno to EFAULT.
-* 5) pwritev(2) should return -1 and set errno to EBADF.
-* 6) pwritev(2) should return -1 and set errno to EBADF.
-* 7) pwritev(2) should return -1 and set errno to ESPIPE.
-*/
+ * Test Name: pwritev02
+ *
+ * Description:
+ * 1) pwritev(2) fails if iov_len is invalid.
+ * 2) pwritev(2) fails if the vector count iovcnt is less than zero.
+ * 3) pwritev(2) fails if offset is negative.
+ * 4) pwritev(2) fails when attempts to write from a invalid address
+ * 5) pwritev(2) fails if file descriptor is invalid.
+ * 6) pwritev(2) fails if file descriptor is not open for writing.
+ * 7) pwritev(2) fails if fd is associated with a pipe.
+ *
+ * Expected Result:
+ * 1) pwritev(2) should return -1 and set errno to EINVAL.
+ * 2) pwritev(2) should return -1 and set errno to EINVAL.
+ * 3) pwritev(2) should return -1 and set errno to EINVAL.
+ * 4) pwritev(2) should return -1 and set errno to EFAULT.
+ * 5) pwritev(2) should return -1 and set errno to EBADF.
+ * 6) pwritev(2) should return -1 and set errno to EBADF.
+ * 7) pwritev(2) should return -1 and set errno to ESPIPE.
+ */
#define _GNU_SOURCE
diff --git a/testcases/kernel/syscalls/pwritev/pwritev03.c b/testcases/kernel/syscalls/pwritev/pwritev03.c
index 8b91de336..e60ef191e 100644
--- a/testcases/kernel/syscalls/pwritev/pwritev03.c
+++ b/testcases/kernel/syscalls/pwritev/pwritev03.c
@@ -90,7 +90,7 @@ static void verify_direct_pwritev(unsigned int n)
static void setup(void)
{
int dev_fd, ret;
-
+
dev_fd = SAFE_OPEN(tst_device->dev, O_RDWR);
SAFE_IOCTL(dev_fd, BLKSSZGET, &ret);
SAFE_CLOSE(dev_fd);
--
2.26.2
More information about the ltp
mailing list