All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] m4: remove useless ltp-securebits.m4
@ 2019-07-19 10:48 Yang Xu
  2019-07-19 10:59 ` Xiao Yang
  0 siblings, 1 reply; 15+ messages in thread
From: Yang Xu @ 2019-07-19 10:48 UTC (permalink / raw)
  To: ltp

Since commit fe9d9218c, we have detected linux/securebits.h in
confiure.ac. one place used the HAVE_SECUREBITS(ltp-securebits.m4 
defined), it only controls compile. kernel/security/securebits/
check_keepcaps.c has HAVE_LINUX_SECUREBITS_H check in internal, 
so removing it is safe.

Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
---
 configure.ac                       |  1 -
 include/mk/features.mk.default     |  3 ---
 include/mk/features.mk.in          |  3 ---
 m4/ltp-securebits.m4               | 10 ----------
 testcases/kernel/security/Makefile |  4 ----
 5 files changed, 21 deletions(-)
 delete mode 100644 m4/ltp-securebits.m4

diff --git a/configure.ac b/configure.ac
index 3dcf282e8..f899d8ebc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -226,7 +226,6 @@ LTP_CHECK_NOMMU_LINUX
 LTP_CHECK_PERF_EVENT
 LTP_CHECK_PRCTL_SUPPORT
 LTP_CHECK_RLIMIT64
-LTP_CHECK_SECUREBITS
 LTP_CHECK_SELINUX
 LTP_CHECK_SIGNAL
 LTP_CHECK_STATX
diff --git a/include/mk/features.mk.default b/include/mk/features.mk.default
index 94b8b0c54..3a6cc5176 100644
--- a/include/mk/features.mk.default
+++ b/include/mk/features.mk.default
@@ -29,9 +29,6 @@ WITH_PYTHON			:= no
 
 # Features knobs
 
-# Is securebits[.h], et all support available?
-HAVE_SECUREBITS			:= no
-
 # Test suite knobs
 
 # Enable testcases/kernel/power_management's compile and install?
diff --git a/include/mk/features.mk.in b/include/mk/features.mk.in
index 7536b6f20..8e561b738 100644
--- a/include/mk/features.mk.in
+++ b/include/mk/features.mk.in
@@ -29,9 +29,6 @@ WITH_PYTHON			:= @WITH_PYTHON@
 
 # Features knobs
 
-# Is securebits[.h], et all support available?
-HAVE_SECUREBITS			:= @HAVE_SECUREBITS@
-
 # Test suite knobs
 
 # Enable testcases/kernel/power_management's compile and install?
diff --git a/m4/ltp-securebits.m4 b/m4/ltp-securebits.m4
deleted file mode 100644
index 7888e6335..000000000
--- a/m4/ltp-securebits.m4
+++ /dev/null
@@ -1,10 +0,0 @@
-dnl SPDX-License-Identifier: GPL-2.0-or-later
-dnl Copyright (c) Serge Hallyn (2010)
-
-AC_DEFUN([LTP_CHECK_SECUREBITS],[
-	AC_CHECK_HEADERS(linux/securebits.h,[have_securebits=yes])
-if test "x$have_securebits" != xyes; then
-	have_securebits=no
-fi
-AC_SUBST(HAVE_SECUREBITS,$have_securebits)
-])
diff --git a/testcases/kernel/security/Makefile b/testcases/kernel/security/Makefile
index 0b4b98b83..eea794aa9 100644
--- a/testcases/kernel/security/Makefile
+++ b/testcases/kernel/security/Makefile
@@ -24,10 +24,6 @@ top_srcdir		?= ../../..
 
 include	$(top_srcdir)/include/mk/env_pre.mk
 
-ifneq ($(HAVE_SECUREBITS),yes)
-FILTER_OUT_DIRS		+= securebits
-endif
-
 OPT_CFLAGS		+= -O
 DEBUG_LDFLAGS		+= -s
 
-- 
2.18.1




^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [LTP] [PATCH] m4: remove useless ltp-securebits.m4
  2019-07-19 10:48 [LTP] [PATCH] m4: remove useless ltp-securebits.m4 Yang Xu
@ 2019-07-19 10:59 ` Xiao Yang
  2019-07-22  9:52   ` [LTP] [PATCH v2 1/2] m4: remove some useless m4 Yang Xu
  2019-07-22  9:59   ` [LTP] [PATCH] " Yang Xu
  0 siblings, 2 replies; 15+ messages in thread
From: Xiao Yang @ 2019-07-19 10:59 UTC (permalink / raw)
  To: ltp

Hi Xu,

LGTM. :-)

Reviewed-by: Xiao Yang <ice_yangxiao@163.com>

Best Regards,

Xiao Yang

On 07/19/2019 06:48 PM, Yang Xu wrote:
> Since commit fe9d9218c, we have detected linux/securebits.h in
> confiure.ac. one place used the HAVE_SECUREBITS(ltp-securebits.m4
> defined), it only controls compile. kernel/security/securebits/
> check_keepcaps.c has HAVE_LINUX_SECUREBITS_H check in internal,
> so removing it is safe.
>
> Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
> ---
>   configure.ac                       |  1 -
>   include/mk/features.mk.default     |  3 ---
>   include/mk/features.mk.in          |  3 ---
>   m4/ltp-securebits.m4               | 10 ----------
>   testcases/kernel/security/Makefile |  4 ----
>   5 files changed, 21 deletions(-)
>   delete mode 100644 m4/ltp-securebits.m4
>
> diff --git a/configure.ac b/configure.ac
> index 3dcf282e8..f899d8ebc 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -226,7 +226,6 @@ LTP_CHECK_NOMMU_LINUX
>   LTP_CHECK_PERF_EVENT
>   LTP_CHECK_PRCTL_SUPPORT
>   LTP_CHECK_RLIMIT64
> -LTP_CHECK_SECUREBITS
>   LTP_CHECK_SELINUX
>   LTP_CHECK_SIGNAL
>   LTP_CHECK_STATX
> diff --git a/include/mk/features.mk.default b/include/mk/features.mk.default
> index 94b8b0c54..3a6cc5176 100644
> --- a/include/mk/features.mk.default
> +++ b/include/mk/features.mk.default
> @@ -29,9 +29,6 @@ WITH_PYTHON			:= no
>   
>   # Features knobs
>   
> -# Is securebits[.h], et all support available?
> -HAVE_SECUREBITS			:= no
> -
>   # Test suite knobs
>   
>   # Enable testcases/kernel/power_management's compile and install?
> diff --git a/include/mk/features.mk.in b/include/mk/features.mk.in
> index 7536b6f20..8e561b738 100644
> --- a/include/mk/features.mk.in
> +++ b/include/mk/features.mk.in
> @@ -29,9 +29,6 @@ WITH_PYTHON			:= @WITH_PYTHON@
>   
>   # Features knobs
>   
> -# Is securebits[.h], et all support available?
> -HAVE_SECUREBITS			:= @HAVE_SECUREBITS@
> -
>   # Test suite knobs
>   
>   # Enable testcases/kernel/power_management's compile and install?
> diff --git a/m4/ltp-securebits.m4 b/m4/ltp-securebits.m4
> deleted file mode 100644
> index 7888e6335..000000000
> --- a/m4/ltp-securebits.m4
> +++ /dev/null
> @@ -1,10 +0,0 @@
> -dnl SPDX-License-Identifier: GPL-2.0-or-later
> -dnl Copyright (c) Serge Hallyn (2010)
> -
> -AC_DEFUN([LTP_CHECK_SECUREBITS],[
> -	AC_CHECK_HEADERS(linux/securebits.h,[have_securebits=yes])
> -if test "x$have_securebits" != xyes; then
> -	have_securebits=no
> -fi
> -AC_SUBST(HAVE_SECUREBITS,$have_securebits)
> -])
> diff --git a/testcases/kernel/security/Makefile b/testcases/kernel/security/Makefile
> index 0b4b98b83..eea794aa9 100644
> --- a/testcases/kernel/security/Makefile
> +++ b/testcases/kernel/security/Makefile
> @@ -24,10 +24,6 @@ top_srcdir		?= ../../..
>   
>   include	$(top_srcdir)/include/mk/env_pre.mk
>   
> -ifneq ($(HAVE_SECUREBITS),yes)
> -FILTER_OUT_DIRS		+= securebits
> -endif
> -
>   OPT_CFLAGS		+= -O
>   DEBUG_LDFLAGS		+= -s
>   



^ permalink raw reply	[flat|nested] 15+ messages in thread

* [LTP] [PATCH v2 1/2] m4: remove some useless m4
  2019-07-19 10:59 ` Xiao Yang
@ 2019-07-22  9:52   ` Yang Xu
  2019-07-22  9:52     ` [LTP] [PATCH v2 2/2] ltp-cap.m4: uncouple licap and cap_compare Yang Xu
  2019-07-29 12:26     ` [LTP] [PATCH v2 1/2] m4: remove some useless m4 Petr Vorel
  2019-07-22  9:59   ` [LTP] [PATCH] " Yang Xu
  1 sibling, 2 replies; 15+ messages in thread
From: Yang Xu @ 2019-07-22  9:52 UTC (permalink / raw)
  To: ltp

Since commit fe9d9218c, we have detected linux/securebits.h in
confiure.ac. one place used the HAVE_SECUREBITS defined), it only
controls compile. kernel/security/securebits/check_keepcaps.c has
HAVE_LINUX_SECUREBITS_H check in internal, so removing it is safe.

No testcase used these macros defined in ltp/time.m4, and these
(CLOCK_MONOTONIC_RAW, CLOCK_REALTIME_COARSE, CLOCK_MONOTONIC_COARSE)
have been defined in lapi/posix_clocks.h. Removing it is safe.

FS_IOC_GETFLAGS and FS_IOC_SETFLAGS have been defined in lapi/fs.h.
setxattr03.c checked this ioctl return value, so removing it is safe.

Since commit ef772539, LTP_CHECK_CGROUPSTATS has been removed. But
testcase still used it. It looks like a mistakenly deletion. Removing
ltp-cgroupstats.m4, check linux/cgroupstats.h in configure.ac.

Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
---
 configure.ac                                  |  6 ++--
 include/mk/features.mk.default                |  3 --
 include/mk/features.mk.in                     |  3 --
 m4/ltp-cgroupstats.m4                         |  8 -----
 m4/ltp-fs_ioc_flags.m4                        | 11 -------
 m4/ltp-securebits.m4                          | 10 ------
 m4/ltp-time.m4                                | 12 -------
 testcases/kernel/security/Makefile            |  4 ---
 .../kernel/syscalls/setxattr/setxattr03.c     | 33 +++----------------
 9 files changed, 7 insertions(+), 83 deletions(-)
 delete mode 100644 m4/ltp-cgroupstats.m4
 delete mode 100644 m4/ltp-fs_ioc_flags.m4
 delete mode 100644 m4/ltp-securebits.m4
 delete mode 100644 m4/ltp-time.m4

diff --git a/configure.ac b/configure.ac
index 3dcf282e8..699d7907d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -36,8 +36,9 @@ AC_CHECK_HEADERS([ \
     ifaddrs.h \
     keyutils.h \
     linux/can.h \
-    linux/dccp.h \
+    linux/cgroupstats.h \
     linux/cryptouser.h \
+    linux/dccp.h \
     linux/genetlink.h \
     linux/keyctl.h \
     linux/if_alg.h \
@@ -209,7 +210,6 @@ LTP_CHECK_CLONE_SUPPORTS_7_ARGS
 LTP_CHECK_CRYPTO
 LTP_CHECK_FIDEDUPE
 LTP_CHECK_FORTIFY_SOURCE
-LTP_CHECK_FS_IOC_FLAGS
 LTP_CHECK_FTS_H
 LTP_CHECK_IF_LINK
 LTP_CHECK_IOVEC
@@ -226,7 +226,6 @@ LTP_CHECK_NOMMU_LINUX
 LTP_CHECK_PERF_EVENT
 LTP_CHECK_PRCTL_SUPPORT
 LTP_CHECK_RLIMIT64
-LTP_CHECK_SECUREBITS
 LTP_CHECK_SELINUX
 LTP_CHECK_SIGNAL
 LTP_CHECK_STATX
@@ -249,7 +248,6 @@ LTP_CHECK_SYSCALL_QUOTACTL
 LTP_CHECK_SYSCALL_SIGNALFD
 LTP_CHECK_SYSCALL_UTIMENSAT
 LTP_CHECK_TASKSTATS
-LTP_CHECK_TIME
 LTP_CHECK_TIMERFD
 test "x$with_tirpc" = xyes && LTP_CHECK_TIRPC
 LTP_CHECK_TPACKET_V3
diff --git a/include/mk/features.mk.default b/include/mk/features.mk.default
index 94b8b0c54..3a6cc5176 100644
--- a/include/mk/features.mk.default
+++ b/include/mk/features.mk.default
@@ -29,9 +29,6 @@ WITH_PYTHON			:= no
 
 # Features knobs
 
-# Is securebits[.h], et all support available?
-HAVE_SECUREBITS			:= no
-
 # Test suite knobs
 
 # Enable testcases/kernel/power_management's compile and install?
diff --git a/include/mk/features.mk.in b/include/mk/features.mk.in
index 7536b6f20..8e561b738 100644
--- a/include/mk/features.mk.in
+++ b/include/mk/features.mk.in
@@ -29,9 +29,6 @@ WITH_PYTHON			:= @WITH_PYTHON@
 
 # Features knobs
 
-# Is securebits[.h], et all support available?
-HAVE_SECUREBITS			:= @HAVE_SECUREBITS@
-
 # Test suite knobs
 
 # Enable testcases/kernel/power_management's compile and install?
diff --git a/m4/ltp-cgroupstats.m4 b/m4/ltp-cgroupstats.m4
deleted file mode 100644
index 527f719ac..000000000
--- a/m4/ltp-cgroupstats.m4
+++ /dev/null
@@ -1,8 +0,0 @@
-dnl SPDX-License-Identifier: GPL-2.0-or-later
-dnl Copyright (c) Linux Test Project, 2009
-
-AC_DEFUN([LTP_CHECK_CGROUPSTATS],
-[
-AC_CHECK_HEADERS(linux/cgroupstats.h,[LTP_CHECK_CGROUPSTATS_HEADER=yes])
-AC_SUBST(LTP_CHECK_CGROUPSTATS_HEADER)
-])
diff --git a/m4/ltp-fs_ioc_flags.m4 b/m4/ltp-fs_ioc_flags.m4
deleted file mode 100644
index 79fffd27b..000000000
--- a/m4/ltp-fs_ioc_flags.m4
+++ /dev/null
@@ -1,11 +0,0 @@
-dnl SPDX-License-Identifier: GPL-2.0-or-later
-dnl Copyright (c) Linux Test Project, 2012
-dnl Author: Cyril Hrubis <chrubis@suse.cz>
-
-AC_DEFUN([LTP_CHECK_FS_IOC_FLAGS],[
-AH_TEMPLATE(HAVE_FS_IOC_FLAGS,
-[Define to 1 if you have FS_IOC_GETFLAGS and FS_IOC_SETFLAGS in <linux/fs.h>.])
-AC_MSG_CHECKING([for FS_IOC_GETFLAGS and FS_IOC_SETFLAGS in <linux/fs.h>])
-AC_TRY_COMPILE([#include <linux/fs.h>], [int flags = FS_IOC_GETFLAGS;],
-               AC_DEFINE(HAVE_FS_IOC_FLAGS) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
-])
diff --git a/m4/ltp-securebits.m4 b/m4/ltp-securebits.m4
deleted file mode 100644
index 7888e6335..000000000
--- a/m4/ltp-securebits.m4
+++ /dev/null
@@ -1,10 +0,0 @@
-dnl SPDX-License-Identifier: GPL-2.0-or-later
-dnl Copyright (c) Serge Hallyn (2010)
-
-AC_DEFUN([LTP_CHECK_SECUREBITS],[
-	AC_CHECK_HEADERS(linux/securebits.h,[have_securebits=yes])
-if test "x$have_securebits" != xyes; then
-	have_securebits=no
-fi
-AC_SUBST(HAVE_SECUREBITS,$have_securebits)
-])
diff --git a/m4/ltp-time.m4 b/m4/ltp-time.m4
deleted file mode 100644
index 205ba6d5a..000000000
--- a/m4/ltp-time.m4
+++ /dev/null
@@ -1,12 +0,0 @@
-dnl SPDX-License-Identifier: GPL-2.0-or-later
-dnl Author: Ngie Cooper <yaneurabeya@gmail.com>
-
-dnl For all directly related time syscalls
-AC_DEFUN([LTP_CHECK_TIME],[
-	AC_CHECK_DECLS([CLOCK_MONOTONIC_RAW, CLOCK_REALTIME_COARSE, CLOCK_MONOTONIC_COARSE],,,[
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-#include <time.h>
-])
-])
diff --git a/testcases/kernel/security/Makefile b/testcases/kernel/security/Makefile
index 0b4b98b83..eea794aa9 100644
--- a/testcases/kernel/security/Makefile
+++ b/testcases/kernel/security/Makefile
@@ -24,10 +24,6 @@ top_srcdir		?= ../../..
 
 include	$(top_srcdir)/include/mk/env_pre.mk
 
-ifneq ($(HAVE_SECUREBITS),yes)
-FILTER_OUT_DIRS		+= securebits
-endif
-
 OPT_CFLAGS		+= -O
 DEBUG_LDFLAGS		+= -s
 
diff --git a/testcases/kernel/syscalls/setxattr/setxattr03.c b/testcases/kernel/syscalls/setxattr/setxattr03.c
index a2f6cbf36..53fca2073 100644
--- a/testcases/kernel/syscalls/setxattr/setxattr03.c
+++ b/testcases/kernel/syscalls/setxattr/setxattr03.c
@@ -1,30 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2012 Red Hat, Inc.
  *
- * 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.
- *
- * Further, this software is distributed without any warranty that it
- * is free of the rightful claim of any third person regarding
- * infringement or the like.  Any license provided herein, whether
- * implied or otherwise, applies only to this software file.  Patent
- * licenses, if any, provided herein do not apply to combinations of
- * this program with other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-
-/*
  * setxattr(2) to immutable and append-only files should get EPERM
- *
  * There are 2 test cases:
  * 1. Set attribute to a immutable file, setxattr(2) should return -1
  *    and set errno to EPERM
@@ -47,14 +25,14 @@
 #ifdef HAVE_SYS_XATTR_H
 # include <sys/xattr.h>
 #endif
-#include <linux/fs.h>
+#include "lapi/fs.h"
 
 #include "test.h"
 #include "safe_macros.h"
 
 char *TCID = "setxattr03";
 
-#if defined HAVE_SYS_XATTR_H && defined HAVE_FS_IOC_FLAGS
+#if defined HAVE_SYS_XATTR_H
 #define XATTR_TEST_KEY "user.testkey"
 #define XATTR_TEST_VALUE "this is a test value"
 #define XATTR_TEST_VALUE_SIZE (sizeof(XATTR_TEST_VALUE) - 1)
@@ -206,7 +184,6 @@ static void cleanup(void)
 #else
 int main(void)
 {
-	tst_brkm(TCONF, NULL, "<sys/xattr.h> not present or FS_IOC_FLAGS "
-		 "missing in <linux/fs.h>");
+	tst_brkm(TCONF, NULL, "<sys/xattr.h> not present");
 }
-#endif /* defined HAVE_SYS_XATTR_H && defined HAVE_FS_IOC_FLAGS */
+#endif /* defined HAVE_SYS_XATTR_H */
-- 
2.18.1




^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [LTP] [PATCH v2 2/2] ltp-cap.m4: uncouple licap and cap_compare
  2019-07-22  9:52   ` [LTP] [PATCH v2 1/2] m4: remove some useless m4 Yang Xu
@ 2019-07-22  9:52     ` Yang Xu
  2019-07-29 12:26     ` [LTP] [PATCH v2 1/2] m4: remove some useless m4 Petr Vorel
  1 sibling, 0 replies; 15+ messages in thread
From: Yang Xu @ 2019-07-22  9:52 UTC (permalink / raw)
  To: ltp

Currently, HAVE_LIBCAP is not defined unless libcap supports
cap_compare(). The check for libcap and cap_compare() has to be
uncoupled because libcap-1 doesn't have cap_compare.

Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
---
 m4/ltp-cap.m4                                 | 21 ++++++++++---------
 .../security/filecaps/check_simple_capset.c   |  4 ++--
 .../security/filecaps/verify_caps_exec.c      |  6 +++---
 3 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/m4/ltp-cap.m4 b/m4/ltp-cap.m4
index 02d3cac8c..502f57006 100644
--- a/m4/ltp-cap.m4
+++ b/m4/ltp-cap.m4
@@ -1,17 +1,18 @@
 dnl SPDX-License-Identifier: GPL-2.0-or-later
 dnl Copyright (c) Cisco Systems Inc., 2009
 dnl Copyright (c) Linux Test Project, 2010
+dnl Copyright (c) 2019 FUJITSU LIMITED. All rights reserved.
 dnl Author: Ngie Cooper <yaneurabeya@gmail.com>
 
 AC_DEFUN([LTP_CHECK_CAPABILITY_SUPPORT],[
-AH_TEMPLATE(HAVE_LIBCAP,
-[Define to 1 if you have libcap-2 installed.])
-AC_CHECK_HEADERS([sys/capability.h],[capability_header_prefix="sys"])
-if test "x$capability_header_prefix" != x; then
-	AC_CHECK_LIB(cap,cap_compare,[cap_libs="-lcap"])
-fi
-if test "x$cap_libs" != x; then
-	AC_DEFINE(HAVE_LIBCAP)
-fi
-AC_SUBST(CAP_LIBS,$cap_libs)
+	AC_CHECK_LIB(cap,cap_init,[have_libcap=yes])
+	AC_CHECK_LIB(cap,cap_compare,[have_libcap_2=yes])
+	AC_CHECK_HEADERS(sys/capability.h,[have_sys_cap=yes])
+	if test "x$have_libcap" = "xyes" -a "x$have_sys_cap" = "xyes"; then
+		AC_DEFINE(HAVE_LIBCAP, 1, [Define to 1 if you have libcap and it's headers installed])
+		AC_SUBST(CAP_LIBS, "-lcap")
+	fi
+	if test "x$have_libcap_2" = "xyes" -a "x$have_sys_cap" = "xyes"; then
+		AC_DEFINE(HAVE_LIBCAP_V2, 1, [Define to 1 if you have libcap-2 and it's headers installed])
+	fi
 ])
diff --git a/testcases/kernel/security/filecaps/check_simple_capset.c b/testcases/kernel/security/filecaps/check_simple_capset.c
index 81a75babd..e9c414119 100644
--- a/testcases/kernel/security/filecaps/check_simple_capset.c
+++ b/testcases/kernel/security/filecaps/check_simple_capset.c
@@ -27,7 +27,7 @@
 
 int main(void)
 {
-#ifdef HAVE_LIBCAP
+#ifdef HAVE_LIBCAP_V2
 	cap_t caps, caps2;
 	int ret;
 
@@ -41,7 +41,7 @@ int main(void)
 	cap_free(caps2);
 	return ret;
 #else
-	printf("System doesn't support full POSIX capabilities.\n");
+	printf("System doesn't support V2 POSIX capabilities.\n");
 	return 1;
 #endif
 }
diff --git a/testcases/kernel/security/filecaps/verify_caps_exec.c b/testcases/kernel/security/filecaps/verify_caps_exec.c
index 3e6794102..a4c127fb6 100644
--- a/testcases/kernel/security/filecaps/verify_caps_exec.c
+++ b/testcases/kernel/security/filecaps/verify_caps_exec.c
@@ -62,7 +62,7 @@ static void usage(const char *me)
 #define DROP_PERMS 0
 #define KEEP_PERMS 1
 
-#ifdef HAVE_LIBCAP
+#ifdef HAVE_LIBCAP_V2
 static void print_my_caps(void)
 {
 	cap_t cap = cap_get_proc();
@@ -398,7 +398,7 @@ static int caps_actually_set_test(void)
 
 int main(int argc, char *argv[])
 {
-#ifdef HAVE_LIBCAP
+#ifdef HAVE_LIBCAP_V2
 	if (argc < 2)
 		usage(argv[0]);
 
@@ -419,7 +419,7 @@ int main(int argc, char *argv[])
 		usage(argv[0]);
 	}
 #else
-	tst_resm(TCONF, "System doesn't have POSIX capabilities support.");
+	tst_resm(TCONF, "System doesn't have POSIX  V2 capabilities support.");
 #endif
 
 	tst_exit();
-- 
2.18.1




^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [LTP] [PATCH] m4: remove useless ltp-securebits.m4
  2019-07-19 10:59 ` Xiao Yang
  2019-07-22  9:52   ` [LTP] [PATCH v2 1/2] m4: remove some useless m4 Yang Xu
@ 2019-07-22  9:59   ` Yang Xu
  1 sibling, 0 replies; 15+ messages in thread
From: Yang Xu @ 2019-07-22  9:59 UTC (permalink / raw)
  To: ltp

Hi Xiao

I  have sent  a v2 patch about removing more useless m4.

> Hi Xu,
>
> LGTM. :-)
>
> Reviewed-by: Xiao Yang <ice_yangxiao@163.com>
>
> Best Regards,
>
> Xiao Yang
>
> On 07/19/2019 06:48 PM, Yang Xu wrote:
>> Since commit fe9d9218c, we have detected linux/securebits.h in
>> confiure.ac. one place used the HAVE_SECUREBITS(ltp-securebits.m4
>> defined), it only controls compile. kernel/security/securebits/
>> check_keepcaps.c has HAVE_LINUX_SECUREBITS_H check in internal,
>> so removing it is safe.
>>
>> Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
>> ---
>>   configure.ac                       |  1 -
>>   include/mk/features.mk.default     |  3 ---
>>   include/mk/features.mk.in          |  3 ---
>>   m4/ltp-securebits.m4               | 10 ----------
>>   testcases/kernel/security/Makefile |  4 ----
>>   5 files changed, 21 deletions(-)
>>   delete mode 100644 m4/ltp-securebits.m4
>>
>> diff --git a/configure.ac b/configure.ac
>> index 3dcf282e8..f899d8ebc 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -226,7 +226,6 @@ LTP_CHECK_NOMMU_LINUX
>>   LTP_CHECK_PERF_EVENT
>>   LTP_CHECK_PRCTL_SUPPORT
>>   LTP_CHECK_RLIMIT64
>> -LTP_CHECK_SECUREBITS
>>   LTP_CHECK_SELINUX
>>   LTP_CHECK_SIGNAL
>>   LTP_CHECK_STATX
>> diff --git a/include/mk/features.mk.default 
>> b/include/mk/features.mk.default
>> index 94b8b0c54..3a6cc5176 100644
>> --- a/include/mk/features.mk.default
>> +++ b/include/mk/features.mk.default
>> @@ -29,9 +29,6 @@ WITH_PYTHON            := no
>>     # Features knobs
>>   -# Is securebits[.h], et all support available?
>> -HAVE_SECUREBITS            := no
>> -
>>   # Test suite knobs
>>     # Enable testcases/kernel/power_management's compile and install?
>> diff --git a/include/mk/features.mk.in b/include/mk/features.mk.in
>> index 7536b6f20..8e561b738 100644
>> --- a/include/mk/features.mk.in
>> +++ b/include/mk/features.mk.in
>> @@ -29,9 +29,6 @@ WITH_PYTHON            := @WITH_PYTHON@
>>     # Features knobs
>>   -# Is securebits[.h], et all support available?
>> -HAVE_SECUREBITS            := @HAVE_SECUREBITS@
>> -
>>   # Test suite knobs
>>     # Enable testcases/kernel/power_management's compile and install?
>> diff --git a/m4/ltp-securebits.m4 b/m4/ltp-securebits.m4
>> deleted file mode 100644
>> index 7888e6335..000000000
>> --- a/m4/ltp-securebits.m4
>> +++ /dev/null
>> @@ -1,10 +0,0 @@
>> -dnl SPDX-License-Identifier: GPL-2.0-or-later
>> -dnl Copyright (c) Serge Hallyn (2010)
>> -
>> -AC_DEFUN([LTP_CHECK_SECUREBITS],[
>> -    AC_CHECK_HEADERS(linux/securebits.h,[have_securebits=yes])
>> -if test "x$have_securebits" != xyes; then
>> -    have_securebits=no
>> -fi
>> -AC_SUBST(HAVE_SECUREBITS,$have_securebits)
>> -])
>> diff --git a/testcases/kernel/security/Makefile 
>> b/testcases/kernel/security/Makefile
>> index 0b4b98b83..eea794aa9 100644
>> --- a/testcases/kernel/security/Makefile
>> +++ b/testcases/kernel/security/Makefile
>> @@ -24,10 +24,6 @@ top_srcdir        ?= ../../..
>>     include    $(top_srcdir)/include/mk/env_pre.mk
>>   -ifneq ($(HAVE_SECUREBITS),yes)
>> -FILTER_OUT_DIRS        += securebits
>> -endif
>> -
>>   OPT_CFLAGS        += -O
>>   DEBUG_LDFLAGS        += -s
>
>
>
>
> .
>



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20190722/e9d70efb/attachment-0001.htm>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [LTP] [PATCH v2 1/2] m4: remove some useless m4
  2019-07-22  9:52   ` [LTP] [PATCH v2 1/2] m4: remove some useless m4 Yang Xu
  2019-07-22  9:52     ` [LTP] [PATCH v2 2/2] ltp-cap.m4: uncouple licap and cap_compare Yang Xu
@ 2019-07-29 12:26     ` Petr Vorel
  2019-07-29 13:16       ` Cyril Hrubis
  1 sibling, 1 reply; 15+ messages in thread
From: Petr Vorel @ 2019-07-29 12:26 UTC (permalink / raw)
  To: ltp

Hi,

> Since commit fe9d9218c, we have detected linux/securebits.h in
> confiure.ac. one place used the HAVE_SECUREBITS defined), it only
> controls compile. kernel/security/securebits/check_keepcaps.c has
> HAVE_LINUX_SECUREBITS_H check in internal, so removing it is safe.

> No testcase used these macros defined in ltp/time.m4, and these
> (CLOCK_MONOTONIC_RAW, CLOCK_REALTIME_COARSE, CLOCK_MONOTONIC_COARSE)
> have been defined in lapi/posix_clocks.h. Removing it is safe.

> FS_IOC_GETFLAGS and FS_IOC_SETFLAGS have been defined in lapi/fs.h.
> setxattr03.c checked this ioctl return value, so removing it is safe.

> Since commit ef772539, LTP_CHECK_CGROUPSTATS has been removed. But
> testcase still used it. It looks like a mistakenly deletion. Removing
> ltp-cgroupstats.m4, check linux/cgroupstats.h in configure.ac.

> Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Acked-by: Petr Vorel <pvorel@suse.cz>

Although I wonder whether mixing 4 changes (even related to autoconf)
in single commit is a good idea (makes it a bit hard to review).

Kind regards,
Petr

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [LTP] [PATCH v2 1/2] m4: remove some useless m4
  2019-07-29 12:26     ` [LTP] [PATCH v2 1/2] m4: remove some useless m4 Petr Vorel
@ 2019-07-29 13:16       ` Cyril Hrubis
  2019-07-29 14:42         ` Petr Vorel
  0 siblings, 1 reply; 15+ messages in thread
From: Cyril Hrubis @ 2019-07-29 13:16 UTC (permalink / raw)
  To: ltp

Hi!
> > Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
> Acked-by: Petr Vorel <pvorel@suse.cz>
> 
> Although I wonder whether mixing 4 changes (even related to autoconf)
> in single commit is a good idea (makes it a bit hard to review).

Yes please, at least the SPDX conversion has to be in a separate patch.

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [LTP] [PATCH v2 1/2] m4: remove some useless m4
  2019-07-29 13:16       ` Cyril Hrubis
@ 2019-07-29 14:42         ` Petr Vorel
  2019-07-30  5:18           ` Yang Xu
  2019-07-30  5:45           ` [LTP] [PATCH v3 1/5] m4: remove useless ltp-securebits.m4 Yang Xu
  0 siblings, 2 replies; 15+ messages in thread
From: Petr Vorel @ 2019-07-29 14:42 UTC (permalink / raw)
  To: ltp

Hi,

> > > Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
> > Acked-by: Petr Vorel <pvorel@suse.cz>

> > Although I wonder whether mixing 4 changes (even related to autoconf)
> > in single commit is a good idea (makes it a bit hard to review).

> Yes please, at least the SPDX conversion has to be in a separate patch.
+1

BTW m4/ltp-signalfd.m4 would require cleanup as well.

Kind regards,
Petr

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [LTP] [PATCH v2 1/2] m4: remove some useless m4
  2019-07-29 14:42         ` Petr Vorel
@ 2019-07-30  5:18           ` Yang Xu
  2019-07-30  5:45           ` [LTP] [PATCH v3 1/5] m4: remove useless ltp-securebits.m4 Yang Xu
  1 sibling, 0 replies; 15+ messages in thread
From: Yang Xu @ 2019-07-30  5:18 UTC (permalink / raw)
  To: ltp


> Hi,
>
>>>> Signed-off-by: Yang Xu<xuyang2018.jy@cn.fujitsu.com>
>>> Acked-by: Petr Vorel<pvorel@suse.cz>
>>> Although I wonder whether mixing 4 changes (even related to autoconf)
>>> in single commit is a good idea (makes it a bit hard to review).
>> Yes please, at least the SPDX conversion has to be in a separate patch.
> +1
>
> BTW m4/ltp-signalfd.m4 would require cleanup as well.
Hi Cyril ,Petr

Sorry. This patch looks a little mess.

I will split it into five patches, as below:

v3-0001-m4-remove-useless-ltp-securebits.m4.patch
v3-0002-m4-remove-useless-ltp-time.m4.patch
v3-0003-m4-remove-useless-ltp-fs_ioc_flags.m4.patch
V3-0004-m4-remove-useless-ltp-cgroupstats.m4.patch
v3-0005-m4-clean-up-ltp-signalfd.m4.patch


Also, SPDX conversion for setxattr03.c, I will cleanup this case after this patchset merged.

Thanks
Yang Xu

> Kind regards,
> Petr
>
>
> .
>




^ permalink raw reply	[flat|nested] 15+ messages in thread

* [LTP] [PATCH v3 1/5] m4: remove useless ltp-securebits.m4
  2019-07-29 14:42         ` Petr Vorel
  2019-07-30  5:18           ` Yang Xu
@ 2019-07-30  5:45           ` Yang Xu
  2019-07-30  5:45             ` [LTP] [PATCH v3 2/5] m4: remove useless ltp-time.m4 Yang Xu
                               ` (4 more replies)
  1 sibling, 5 replies; 15+ messages in thread
From: Yang Xu @ 2019-07-30  5:45 UTC (permalink / raw)
  To: ltp

Since commit fe9d9218c, we have detected linux/securebits.h in
confiure.ac. one place used the HAVE_SECUREBITS(ltp-securebits.m4
defined), it only controls compile. kernel/security/securebits/
check_keepcaps.c has HAVE_LINUX_SECUREBITS_H check in internal,
so removing it is safe.

Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Reviewed-by: Xiao Yang <ice_yangxiao@163.com>
---
 configure.ac                       |  1 -
 include/mk/features.mk.default     |  3 ---
 include/mk/features.mk.in          |  3 ---
 m4/ltp-securebits.m4               | 10 ----------
 testcases/kernel/security/Makefile |  4 ----
 5 files changed, 21 deletions(-)
 delete mode 100644 m4/ltp-securebits.m4

diff --git a/configure.ac b/configure.ac
index 298d90835..640ba0cba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -231,7 +231,6 @@ LTP_CHECK_NOMMU_LINUX
 LTP_CHECK_PERF_EVENT
 LTP_CHECK_PRCTL_SUPPORT
 LTP_CHECK_RLIMIT64
-LTP_CHECK_SECUREBITS
 LTP_CHECK_SELINUX
 LTP_CHECK_SIGNAL
 LTP_CHECK_STATX
diff --git a/include/mk/features.mk.default b/include/mk/features.mk.default
index 94b8b0c54..3a6cc5176 100644
--- a/include/mk/features.mk.default
+++ b/include/mk/features.mk.default
@@ -29,9 +29,6 @@ WITH_PYTHON			:= no
 
 # Features knobs
 
-# Is securebits[.h], et all support available?
-HAVE_SECUREBITS			:= no
-
 # Test suite knobs
 
 # Enable testcases/kernel/power_management's compile and install?
diff --git a/include/mk/features.mk.in b/include/mk/features.mk.in
index 7536b6f20..8e561b738 100644
--- a/include/mk/features.mk.in
+++ b/include/mk/features.mk.in
@@ -29,9 +29,6 @@ WITH_PYTHON			:= @WITH_PYTHON@
 
 # Features knobs
 
-# Is securebits[.h], et all support available?
-HAVE_SECUREBITS			:= @HAVE_SECUREBITS@
-
 # Test suite knobs
 
 # Enable testcases/kernel/power_management's compile and install?
diff --git a/m4/ltp-securebits.m4 b/m4/ltp-securebits.m4
deleted file mode 100644
index 7888e6335..000000000
--- a/m4/ltp-securebits.m4
+++ /dev/null
@@ -1,10 +0,0 @@
-dnl SPDX-License-Identifier: GPL-2.0-or-later
-dnl Copyright (c) Serge Hallyn (2010)
-
-AC_DEFUN([LTP_CHECK_SECUREBITS],[
-	AC_CHECK_HEADERS(linux/securebits.h,[have_securebits=yes])
-if test "x$have_securebits" != xyes; then
-	have_securebits=no
-fi
-AC_SUBST(HAVE_SECUREBITS,$have_securebits)
-])
diff --git a/testcases/kernel/security/Makefile b/testcases/kernel/security/Makefile
index 0b4b98b83..eea794aa9 100644
--- a/testcases/kernel/security/Makefile
+++ b/testcases/kernel/security/Makefile
@@ -24,10 +24,6 @@ top_srcdir		?= ../../..
 
 include	$(top_srcdir)/include/mk/env_pre.mk
 
-ifneq ($(HAVE_SECUREBITS),yes)
-FILTER_OUT_DIRS		+= securebits
-endif
-
 OPT_CFLAGS		+= -O
 DEBUG_LDFLAGS		+= -s
 
-- 
2.18.1




^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [LTP] [PATCH v3 2/5] m4: remove useless ltp-time.m4
  2019-07-30  5:45           ` [LTP] [PATCH v3 1/5] m4: remove useless ltp-securebits.m4 Yang Xu
@ 2019-07-30  5:45             ` Yang Xu
  2019-07-30  5:45             ` [LTP] [PATCH v3 3/5] m4:remove useless ltp-fs_ioc_flags.m4 Yang Xu
                               ` (3 subsequent siblings)
  4 siblings, 0 replies; 15+ messages in thread
From: Yang Xu @ 2019-07-30  5:45 UTC (permalink / raw)
  To: ltp

No testcase used these macros defined in ltp-time.m4, and these
(CLOCK_MONOTONIC_RAW, CLOCK_REALTIME_COARSE, CLOCK_MONOTONIC_COARSE)
have been defined in lapi/posix_clocks.h. Removing it is safe.

Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
---
 configure.ac   |  1 -
 m4/ltp-time.m4 | 12 ------------
 2 files changed, 13 deletions(-)
 delete mode 100644 m4/ltp-time.m4

diff --git a/configure.ac b/configure.ac
index 640ba0cba..b0eddcbf8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -253,7 +253,6 @@ LTP_CHECK_SYSCALL_QUOTACTL
 LTP_CHECK_SYSCALL_SIGNALFD
 LTP_CHECK_SYSCALL_UTIMENSAT
 LTP_CHECK_TASKSTATS
-LTP_CHECK_TIME
 LTP_CHECK_TIMERFD
 test "x$with_tirpc" = xyes && LTP_CHECK_TIRPC
 LTP_CHECK_TPACKET_V3
diff --git a/m4/ltp-time.m4 b/m4/ltp-time.m4
deleted file mode 100644
index 205ba6d5a..000000000
--- a/m4/ltp-time.m4
+++ /dev/null
@@ -1,12 +0,0 @@
-dnl SPDX-License-Identifier: GPL-2.0-or-later
-dnl Author: Ngie Cooper <yaneurabeya@gmail.com>
-
-dnl For all directly related time syscalls
-AC_DEFUN([LTP_CHECK_TIME],[
-	AC_CHECK_DECLS([CLOCK_MONOTONIC_RAW, CLOCK_REALTIME_COARSE, CLOCK_MONOTONIC_COARSE],,,[
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-#include <time.h>
-])
-])
-- 
2.18.1




^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [LTP] [PATCH v3 3/5] m4:remove useless ltp-fs_ioc_flags.m4
  2019-07-30  5:45           ` [LTP] [PATCH v3 1/5] m4: remove useless ltp-securebits.m4 Yang Xu
  2019-07-30  5:45             ` [LTP] [PATCH v3 2/5] m4: remove useless ltp-time.m4 Yang Xu
@ 2019-07-30  5:45             ` Yang Xu
  2019-07-30  5:45             ` [LTP] [PATCH v3 4/5] m4: remove useless ltp-cgroupstats.m4 Yang Xu
                               ` (2 subsequent siblings)
  4 siblings, 0 replies; 15+ messages in thread
From: Yang Xu @ 2019-07-30  5:45 UTC (permalink / raw)
  To: ltp

FS_IOC_GETFLAGS and FS_IOC_SETFLAGS have been defined in lapi/fs.h.
setxattr03.c checked this ioctl return value, so removing it is safe.

Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
---
 configure.ac                                    |  1 -
 m4/ltp-fs_ioc_flags.m4                          | 11 -----------
 testcases/kernel/syscalls/setxattr/setxattr03.c |  9 ++++-----
 3 files changed, 4 insertions(+), 17 deletions(-)
 delete mode 100644 m4/ltp-fs_ioc_flags.m4

diff --git a/configure.ac b/configure.ac
index b0eddcbf8..70c6fef5b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -214,7 +214,6 @@ LTP_CHECK_CLONE_SUPPORTS_7_ARGS
 LTP_CHECK_CRYPTO
 LTP_CHECK_FIDEDUPE
 LTP_CHECK_FORTIFY_SOURCE
-LTP_CHECK_FS_IOC_FLAGS
 LTP_CHECK_FTS_H
 LTP_CHECK_IF_LINK
 LTP_CHECK_IOVEC
diff --git a/m4/ltp-fs_ioc_flags.m4 b/m4/ltp-fs_ioc_flags.m4
deleted file mode 100644
index 79fffd27b..000000000
--- a/m4/ltp-fs_ioc_flags.m4
+++ /dev/null
@@ -1,11 +0,0 @@
-dnl SPDX-License-Identifier: GPL-2.0-or-later
-dnl Copyright (c) Linux Test Project, 2012
-dnl Author: Cyril Hrubis <chrubis@suse.cz>
-
-AC_DEFUN([LTP_CHECK_FS_IOC_FLAGS],[
-AH_TEMPLATE(HAVE_FS_IOC_FLAGS,
-[Define to 1 if you have FS_IOC_GETFLAGS and FS_IOC_SETFLAGS in <linux/fs.h>.])
-AC_MSG_CHECKING([for FS_IOC_GETFLAGS and FS_IOC_SETFLAGS in <linux/fs.h>])
-AC_TRY_COMPILE([#include <linux/fs.h>], [int flags = FS_IOC_GETFLAGS;],
-               AC_DEFINE(HAVE_FS_IOC_FLAGS) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
-])
diff --git a/testcases/kernel/syscalls/setxattr/setxattr03.c b/testcases/kernel/syscalls/setxattr/setxattr03.c
index a2f6cbf36..4215a21f4 100644
--- a/testcases/kernel/syscalls/setxattr/setxattr03.c
+++ b/testcases/kernel/syscalls/setxattr/setxattr03.c
@@ -47,14 +47,14 @@
 #ifdef HAVE_SYS_XATTR_H
 # include <sys/xattr.h>
 #endif
-#include <linux/fs.h>
+#include "lapi/fs.h"
 
 #include "test.h"
 #include "safe_macros.h"
 
 char *TCID = "setxattr03";
 
-#if defined HAVE_SYS_XATTR_H && defined HAVE_FS_IOC_FLAGS
+#if defined HAVE_SYS_XATTR_H
 #define XATTR_TEST_KEY "user.testkey"
 #define XATTR_TEST_VALUE "this is a test value"
 #define XATTR_TEST_VALUE_SIZE (sizeof(XATTR_TEST_VALUE) - 1)
@@ -206,7 +206,6 @@ static void cleanup(void)
 #else
 int main(void)
 {
-	tst_brkm(TCONF, NULL, "<sys/xattr.h> not present or FS_IOC_FLAGS "
-		 "missing in <linux/fs.h>");
+	tst_brkm(TCONF, NULL, "<sys/xattr.h> not present");
 }
-#endif /* defined HAVE_SYS_XATTR_H && defined HAVE_FS_IOC_FLAGS */
+#endif /* defined HAVE_SYS_XATTR_H */
-- 
2.18.1




^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [LTP] [PATCH v3 4/5] m4: remove useless ltp-cgroupstats.m4
  2019-07-30  5:45           ` [LTP] [PATCH v3 1/5] m4: remove useless ltp-securebits.m4 Yang Xu
  2019-07-30  5:45             ` [LTP] [PATCH v3 2/5] m4: remove useless ltp-time.m4 Yang Xu
  2019-07-30  5:45             ` [LTP] [PATCH v3 3/5] m4:remove useless ltp-fs_ioc_flags.m4 Yang Xu
@ 2019-07-30  5:45             ` Yang Xu
  2019-07-30  5:45             ` [LTP] [PATCH v3 5/5] m4: clean up ltp-signalfd.m4 Yang Xu
  2019-08-02  8:57             ` [LTP] [PATCH v3 1/5] m4: remove useless ltp-securebits.m4 Petr Vorel
  4 siblings, 0 replies; 15+ messages in thread
From: Yang Xu @ 2019-07-30  5:45 UTC (permalink / raw)
  To: ltp

Since commit ef772539, LTP_CHECK_CGROUPSTATS has been removed. But
testcase still used it. It looks like a mistakenly deletion. Removing
ltp-cgroupstats.m4, check linux/cgroupstats.h in configure.ac.

Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
---
 configure.ac          | 1 +
 m4/ltp-cgroupstats.m4 | 8 --------
 2 files changed, 1 insertion(+), 8 deletions(-)
 delete mode 100644 m4/ltp-cgroupstats.m4

diff --git a/configure.ac b/configure.ac
index 70c6fef5b..6a3952622 100644
--- a/configure.ac
+++ b/configure.ac
@@ -38,6 +38,7 @@ AC_CHECK_HEADERS([ \
     linux/can.h \
     linux/dccp.h \
     linux/cryptouser.h \
+    linux/cgroupstats.h \
     linux/genetlink.h \
     linux/keyctl.h \
     linux/if_alg.h \
diff --git a/m4/ltp-cgroupstats.m4 b/m4/ltp-cgroupstats.m4
deleted file mode 100644
index 527f719ac..000000000
--- a/m4/ltp-cgroupstats.m4
+++ /dev/null
@@ -1,8 +0,0 @@
-dnl SPDX-License-Identifier: GPL-2.0-or-later
-dnl Copyright (c) Linux Test Project, 2009
-
-AC_DEFUN([LTP_CHECK_CGROUPSTATS],
-[
-AC_CHECK_HEADERS(linux/cgroupstats.h,[LTP_CHECK_CGROUPSTATS_HEADER=yes])
-AC_SUBST(LTP_CHECK_CGROUPSTATS_HEADER)
-])
-- 
2.18.1




^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [LTP] [PATCH v3 5/5] m4: clean up ltp-signalfd.m4
  2019-07-30  5:45           ` [LTP] [PATCH v3 1/5] m4: remove useless ltp-securebits.m4 Yang Xu
                               ` (2 preceding siblings ...)
  2019-07-30  5:45             ` [LTP] [PATCH v3 4/5] m4: remove useless ltp-cgroupstats.m4 Yang Xu
@ 2019-07-30  5:45             ` Yang Xu
  2019-08-02  8:57             ` [LTP] [PATCH v3 1/5] m4: remove useless ltp-securebits.m4 Petr Vorel
  4 siblings, 0 replies; 15+ messages in thread
From: Yang Xu @ 2019-07-30  5:45 UTC (permalink / raw)
  To: ltp

Since patch[1] in 2007.10, the signo had been rename as ssi_signo. The
code is so old we can remove signo detection.
Also since patch[2] in 2009.1, the linux/type.h had been include. we can
remove this detection.
I don't find "signalfd.h" in /usr/include on different distros, so I think
we can only use two ways(glibc or tst_syscall) to call it.

[1]:https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=96358de6
[2]:https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a788fd53

Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
---
 m4/ltp-signalfd.m4                            | 62 +++----------------
 .../kernel/syscalls/signalfd/signalfd01.c     | 22 ++-----
 2 files changed, 13 insertions(+), 71 deletions(-)

diff --git a/m4/ltp-signalfd.m4 b/m4/ltp-signalfd.m4
index a435123ef..5aac395bd 100644
--- a/m4/ltp-signalfd.m4
+++ b/m4/ltp-signalfd.m4
@@ -1,65 +1,17 @@
 dnl SPDX-License-Identifier: GPL-2.0-or-later
 dnl Copyright (c) Red Hat Inc., 2008
+dnl Copyright (c) 2019 Fujitsu Ltd.
 dnl Author: Masatake YAMATO <yamato@redhat.com>
 
-dnl LTP_CHECK_SYSCALL_SIGNALFD
-dnl --------------------------
-dnl * Checking the existence of the libc wrapper for signalfd.
-dnl   If it exists, a shell variable LTP_SYSCALL_SIGNALFD_FUNCTION is set to "yes".
-dnl
-dnl * Checking the existence of signalfd.h.
-dnl   If it exists, a shell variable LTP_SYSCALL_SIGNALFD_HEADER is set to "yes".
-dnl
-dnl * Checking the prefix used in fileds for signalfd_siginfo structure.
-dnl   If it exists, a shell variable LTP_SYSCALL_SIGNALFD_FIELD_PREFIX is set to "given".
-dnl
-dnl About cpp macros defined in this macro,
-dnl see testcases/kernel/syscalls/signalfd/signalfd01.c of ltp.
-AC_DEFUN([LTP_CHECK_SYSCALL_SIGNALFD],
-[
-_LTP_CHECK_SYSCALL_SIGNALFD_FUNCTION
-_LTP_CHECK_SYSCALL_SIGNALFD_HEADER
+AC_DEFUN([LTP_CHECK_SYSCALL_SIGNALFD],[
 
-if test x"$LTP_SYSCALL_SIGNALFD_HEADER" = xyes; then
-   _LTP_CHECK_SYSCALL_SIGNALFD_FIELD_PREFIX
-fi]
-)
-
-dnl _LTP_CHECK_SYSCALL_SIGNALFD_FUNCTION
-dnl ------------------------------------
-AC_DEFUN([_LTP_CHECK_SYSCALL_SIGNALFD_FUNCTION],[
-AC_CHECK_FUNCS(signalfd,[LTP_SYSCALL_SIGNALFD_FUNCTION=yes])])
-
-dnl _LTP_CHECK_SYSCALL_SIGNALFD_HEADER
-dnl ----------------------------------
-AC_DEFUN([_LTP_CHECK_SYSCALL_SIGNALFD_HEADER],
-[
-AC_CHECK_HEADERS([sys/signalfd.h linux/types.h])
-AC_CHECK_HEADERS([linux/signalfd.h signalfd.h],[
-LTP_SYSCALL_SIGNALFD_HEADER=yes],,[
-#ifdef HAVE_LINUX_TYPES_H
-#include <linux/types.h>
-#endif
-]
-)
-]
-)
-
-dnl _LTP_CHECK_SYSCALL_SIGNALFD_FIELD_PREFIX
-dnl ----------------------------------------
-AC_DEFUN([_LTP_CHECK_SYSCALL_SIGNALFD_FIELD_PREFIX],
-[
-AC_CHECK_MEMBERS([struct signalfd_siginfo.ssi_signo, struct signalfd_siginfo.signo],[
-LTP_SYSCALL_SIGNALFD_FIELD_PREFIX=given],,[
+AC_CHECK_FUNCS(signalfd,,)
+AC_CHECK_HEADERS([sys/signalfd.h],,)
+AC_CHECK_HEADERS([linux/signalfd.h],,)
+AC_CHECK_MEMBERS([struct signalfd_siginfo.ssi_signo],,,[
 #if defined HAVE_SYS_SIGNALFD_H
 #include <sys/signalfd.h>
 #elif defined HAVE_LINUX_SIGNALFD_H
-#ifdef HAVE_LINUX_TYPES_H
-#include <linux/types.h>
-#endif
 #include <linux/signalfd.h>
-#elif defined HAVE_SIGNALFD_H
-#include <signalfd.h>
 #endif])
-]
-)
+])
diff --git a/testcases/kernel/syscalls/signalfd/signalfd01.c b/testcases/kernel/syscalls/signalfd/signalfd01.c
index 72901ff6a..1a62156ff 100644
--- a/testcases/kernel/syscalls/signalfd/signalfd01.c
+++ b/testcases/kernel/syscalls/signalfd/signalfd01.c
@@ -56,22 +56,13 @@ int TST_TOTAL = 1;
 #if defined HAVE_SYS_SIGNALFD_H
 #include <sys/signalfd.h>
 #elif defined HAVE_LINUX_SIGNALFD_H
-#if defined HAVE_LINUX_TYPES_H
-#include <linux/types.h>
-#endif
 #include <linux/signalfd.h>
 #define USE_OWNIMPL
-#elif defined HAVE_SIGNALFD_H
-#include <signalfd.h>
 #else
 #define  USE_STUB
 #endif
 
-#if defined HAVE_STRUCT_SIGNALFD_SIGINFO_SSI_SIGNO
-#define SIGNALFD_PREFIX(FIELD) ssi_##FIELD
-#elif defined HAVE_STRUCT_SIGNALFD_SIGINFO_SIGNO
-#define SIGNALFD_PREFIX(FIELD) FIELD
-#else
+#ifndef HAVE_STRUCT_SIGNALFD_SIGINFO_SSI_SIGNO
 #define USE_STUB
 #endif
 
@@ -170,14 +161,13 @@ int do_test1(uint32_t sig)
 		goto out;
 	}
 
-	if (fdsi.SIGNALFD_PREFIX(signo) == sig) {
+	if (fdsi.ssi_signo == sig) {
 		tst_resm(TPASS, "got expected signal");
 		sfd_for_next = sfd;
 		goto out;
 	} else {
 		tst_resm(TFAIL, "got unexpected signal: signal=%d : %s",
-			 fdsi.SIGNALFD_PREFIX(signo),
-			 strsignal(fdsi.SIGNALFD_PREFIX(signo)));
+			 fdsi.ssi_signo, strsignal(fdsi.ssi_signo));
 		sfd_for_next = -1;
 		close(sfd);
 		goto out;
@@ -254,13 +244,13 @@ void do_test2(int fd, uint32_t sig)
 		goto out;
 	}
 
-	if (fdsi.SIGNALFD_PREFIX(signo) == sig) {
+	if (fdsi.ssi_signo == sig) {
 		tst_resm(TPASS, "got expected signal");
 		goto out;
 	} else {
 		tst_resm(TFAIL, "got unexpected signal: signal=%d : %s",
-			 fdsi.SIGNALFD_PREFIX(signo),
-			 strsignal(fdsi.SIGNALFD_PREFIX(signo)));
+			 fdsi.ssi_signo),
+			 strsignal(fdsi.ssi_signo);
 		goto out;
 	}
 
-- 
2.18.1




^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [LTP] [PATCH v3 1/5] m4: remove useless ltp-securebits.m4
  2019-07-30  5:45           ` [LTP] [PATCH v3 1/5] m4: remove useless ltp-securebits.m4 Yang Xu
                               ` (3 preceding siblings ...)
  2019-07-30  5:45             ` [LTP] [PATCH v3 5/5] m4: clean up ltp-signalfd.m4 Yang Xu
@ 2019-08-02  8:57             ` Petr Vorel
  4 siblings, 0 replies; 15+ messages in thread
From: Petr Vorel @ 2019-08-02  8:57 UTC (permalink / raw)
  To: ltp

Hi Yang,

> Since commit fe9d9218c, we have detected linux/securebits.h in
> confiure.ac. one place used the HAVE_SECUREBITS(ltp-securebits.m4
> defined), it only controls compile. kernel/security/securebits/
> check_keepcaps.c has HAVE_LINUX_SECUREBITS_H check in internal,
> so removing it is safe.

> Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
> Reviewed-by: Xiao Yang <ice_yangxiao@163.com>
Whole patchset merged (with tiny changes in commit messages).
Thanks for this cleanup and speedup!

Kind regards,
Petr

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2019-08-02  8:57 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-19 10:48 [LTP] [PATCH] m4: remove useless ltp-securebits.m4 Yang Xu
2019-07-19 10:59 ` Xiao Yang
2019-07-22  9:52   ` [LTP] [PATCH v2 1/2] m4: remove some useless m4 Yang Xu
2019-07-22  9:52     ` [LTP] [PATCH v2 2/2] ltp-cap.m4: uncouple licap and cap_compare Yang Xu
2019-07-29 12:26     ` [LTP] [PATCH v2 1/2] m4: remove some useless m4 Petr Vorel
2019-07-29 13:16       ` Cyril Hrubis
2019-07-29 14:42         ` Petr Vorel
2019-07-30  5:18           ` Yang Xu
2019-07-30  5:45           ` [LTP] [PATCH v3 1/5] m4: remove useless ltp-securebits.m4 Yang Xu
2019-07-30  5:45             ` [LTP] [PATCH v3 2/5] m4: remove useless ltp-time.m4 Yang Xu
2019-07-30  5:45             ` [LTP] [PATCH v3 3/5] m4:remove useless ltp-fs_ioc_flags.m4 Yang Xu
2019-07-30  5:45             ` [LTP] [PATCH v3 4/5] m4: remove useless ltp-cgroupstats.m4 Yang Xu
2019-07-30  5:45             ` [LTP] [PATCH v3 5/5] m4: clean up ltp-signalfd.m4 Yang Xu
2019-08-02  8:57             ` [LTP] [PATCH v3 1/5] m4: remove useless ltp-securebits.m4 Petr Vorel
2019-07-22  9:59   ` [LTP] [PATCH] " Yang Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.