public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 0/2] Fix constant redefinition
@ 2022-05-03 15:29 Petr Vorel
  2022-05-03 15:29 ` [LTP] [PATCH 1/2] lapi/mount.h: Remove <linux/mount.h> Petr Vorel
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Petr Vorel @ 2022-05-03 15:29 UTC (permalink / raw)
  To: ltp

Hi,

sorry for introducing regression via merging unreviewed patchset.

Kind regards,
Petr

Petr Vorel (2):
  lapi/mount.h: Remove <linux/mount.h>
  Remove duplicate include of <sys/mount.h>

 include/lapi/fsmount.h                              | 7 +++++--
 include/lapi/mount.h                                | 6 +-----
 lib/tst_cgroup.c                                    | 1 -
 testcases/kernel/syscalls/open/open12.c             | 1 -
 testcases/kernel/syscalls/pivot_root/pivot_root01.c | 2 --
 testcases/kernel/syscalls/statx/statx06.c           | 1 -
 testcases/kernel/syscalls/umount2/umount2_01.c      | 1 -
 testcases/kernel/syscalls/umount2/umount2_02.c      | 1 -
 8 files changed, 6 insertions(+), 14 deletions(-)

-- 
2.36.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* [LTP] [PATCH 1/2] lapi/mount.h: Remove <linux/mount.h>
  2022-05-03 15:29 [LTP] [PATCH 0/2] Fix constant redefinition Petr Vorel
@ 2022-05-03 15:29 ` Petr Vorel
  2022-05-10  9:03   ` Li Wang
  2022-05-03 15:29 ` [LTP] [PATCH 2/2] Remove duplicate include of <sys/mount.h> Petr Vorel
  2022-05-09 15:09 ` [LTP] [PATCH 0/2] Fix constant redefinition Cyril Hrubis
  2 siblings, 1 reply; 6+ messages in thread
From: Petr Vorel @ 2022-05-03 15:29 UTC (permalink / raw)
  To: ltp

To avoid constants redefinition:

tst_cgroup.c: note: in included file (through ../include/lapi/mount.h):
/usr/include/linux/mount.h:13:9: warning: preprocessor token MS_RDONLY redefined
tst_cgroup.c: note: in included file:
/usr/include/sys/mount.h:36:9: this was the original definition

c0cb5d196 was missing #include "config.h" which leaded to always
including <sys/mount.h> while keeping including <sys/mount.h> before
lapi/mount.h (will be removed in separate commit).

Because <linux/mount.h> conflicts with <sys/mount.h>, but does not
include some common functions (e.g. mount(), umount()), it's better to
include in lapi/mount.h only <sys/mount.h>. This requires to include
<linux/mount.h> instead of lapi/mount.h in lapi/fsmount.h.

Fixes: c0cb5d196 ("lapi/mount.h: Include kernel/libc header")

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 include/lapi/fsmount.h | 7 +++++--
 include/lapi/mount.h   | 6 +-----
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/include/lapi/fsmount.h b/include/lapi/fsmount.h
index 377af85ec..3609855f6 100644
--- a/include/lapi/fsmount.h
+++ b/include/lapi/fsmount.h
@@ -8,11 +8,14 @@
 #ifndef LAPI_FSMOUNT_H__
 #define LAPI_FSMOUNT_H__
 
+#include "config.h"
 #include <sys/syscall.h>
 #include <sys/types.h>
 
-#include "config.h"
-#include "lapi/mount.h"
+#ifdef HAVE_LINUX_MOUNT_H
+# include <linux/mount.h>
+#endif
+
 #include "lapi/fcntl.h"
 #include "lapi/syscalls.h"
 
diff --git a/include/lapi/mount.h b/include/lapi/mount.h
index 6d098e3fd..66e1d1319 100644
--- a/include/lapi/mount.h
+++ b/include/lapi/mount.h
@@ -7,11 +7,7 @@
 #ifndef LAPI_MOUNT_H__
 #define LAPI_MOUNT_H__
 
-#ifdef HAVE_LINUX_MOUNT_H
-# include <linux/mount.h>
-#else
-# include <sys/mount.h>
-#endif
+#include <sys/mount.h>
 
 #ifndef MS_REC
 # define MS_REC 16384
-- 
2.36.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* [LTP] [PATCH 2/2] Remove duplicate include of <sys/mount.h>
  2022-05-03 15:29 [LTP] [PATCH 0/2] Fix constant redefinition Petr Vorel
  2022-05-03 15:29 ` [LTP] [PATCH 1/2] lapi/mount.h: Remove <linux/mount.h> Petr Vorel
@ 2022-05-03 15:29 ` Petr Vorel
  2022-05-09 15:09 ` [LTP] [PATCH 0/2] Fix constant redefinition Cyril Hrubis
  2 siblings, 0 replies; 6+ messages in thread
From: Petr Vorel @ 2022-05-03 15:29 UTC (permalink / raw)
  To: ltp

<sys/mount.h> is already included by lapi/mount.h.

Fixes: c0cb5d196 ("lapi/mount.h: Include kernel/libc header")

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 lib/tst_cgroup.c                                    | 1 -
 testcases/kernel/syscalls/open/open12.c             | 1 -
 testcases/kernel/syscalls/pivot_root/pivot_root01.c | 2 --
 testcases/kernel/syscalls/statx/statx06.c           | 1 -
 testcases/kernel/syscalls/umount2/umount2_01.c      | 1 -
 testcases/kernel/syscalls/umount2/umount2_02.c      | 1 -
 6 files changed, 7 deletions(-)

diff --git a/lib/tst_cgroup.c b/lib/tst_cgroup.c
index feb5b3d07..081dfa9c6 100644
--- a/lib/tst_cgroup.c
+++ b/lib/tst_cgroup.c
@@ -11,7 +11,6 @@
 #include <stddef.h>
 #include <stdlib.h>
 #include <mntent.h>
-#include <sys/mount.h>
 
 #include "tst_test.h"
 #include "lapi/fcntl.h"
diff --git a/testcases/kernel/syscalls/open/open12.c b/testcases/kernel/syscalls/open/open12.c
index 4702d08db..bdf29a9a8 100644
--- a/testcases/kernel/syscalls/open/open12.c
+++ b/testcases/kernel/syscalls/open/open12.c
@@ -24,7 +24,6 @@
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/wait.h>
-#include <sys/mount.h>
 #include <unistd.h>
 #include <mntent.h>
 #include <errno.h>
diff --git a/testcases/kernel/syscalls/pivot_root/pivot_root01.c b/testcases/kernel/syscalls/pivot_root/pivot_root01.c
index 1fbe8c189..2d80928b7 100644
--- a/testcases/kernel/syscalls/pivot_root/pivot_root01.c
+++ b/testcases/kernel/syscalls/pivot_root/pivot_root01.c
@@ -9,8 +9,6 @@
 #include <errno.h>
 #include <lapi/syscalls.h>
 #include <sched.h>
-
-#include <sys/mount.h>
 #include <stdlib.h>
 
 #include "tst_test.h"
diff --git a/testcases/kernel/syscalls/statx/statx06.c b/testcases/kernel/syscalls/statx/statx06.c
index 4a0685a65..28badb038 100644
--- a/testcases/kernel/syscalls/statx/statx06.c
+++ b/testcases/kernel/syscalls/statx/statx06.c
@@ -20,7 +20,6 @@
 
 #define _GNU_SOURCE
 #include <stdio.h>
-#include <sys/mount.h>
 #include <time.h>
 
 #include "tst_test.h"
diff --git a/testcases/kernel/syscalls/umount2/umount2_01.c b/testcases/kernel/syscalls/umount2/umount2_01.c
index 46a6d59c3..53817bf68 100644
--- a/testcases/kernel/syscalls/umount2/umount2_01.c
+++ b/testcases/kernel/syscalls/umount2/umount2_01.c
@@ -23,7 +23,6 @@
  */
 
 #include <errno.h>
-#include <sys/mount.h>
 
 #include "test.h"
 #include "safe_macros.h"
diff --git a/testcases/kernel/syscalls/umount2/umount2_02.c b/testcases/kernel/syscalls/umount2/umount2_02.c
index b23f37b04..f4b228f97 100644
--- a/testcases/kernel/syscalls/umount2/umount2_02.c
+++ b/testcases/kernel/syscalls/umount2/umount2_02.c
@@ -20,7 +20,6 @@
  * - succeed when target is a mount point
  */
 
-#include <sys/mount.h>
 #include "lapi/mount.h"
 #include "tst_test.h"
 
-- 
2.36.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [PATCH 0/2] Fix constant redefinition
  2022-05-03 15:29 [LTP] [PATCH 0/2] Fix constant redefinition Petr Vorel
  2022-05-03 15:29 ` [LTP] [PATCH 1/2] lapi/mount.h: Remove <linux/mount.h> Petr Vorel
  2022-05-03 15:29 ` [LTP] [PATCH 2/2] Remove duplicate include of <sys/mount.h> Petr Vorel
@ 2022-05-09 15:09 ` Cyril Hrubis
  2 siblings, 0 replies; 6+ messages in thread
From: Cyril Hrubis @ 2022-05-09 15:09 UTC (permalink / raw)
  To: Petr Vorel; +Cc: ltp

Hi!
Both patches looks fine.

Reviewed-by: Cyril Hrubis <chrubis@suse.cz>

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [PATCH 1/2] lapi/mount.h: Remove <linux/mount.h>
  2022-05-03 15:29 ` [LTP] [PATCH 1/2] lapi/mount.h: Remove <linux/mount.h> Petr Vorel
@ 2022-05-10  9:03   ` Li Wang
  2022-05-10 11:02     ` Petr Vorel
  0 siblings, 1 reply; 6+ messages in thread
From: Li Wang @ 2022-05-10  9:03 UTC (permalink / raw)
  To: Petr Vorel; +Cc: LTP List


[-- Attachment #1.1: Type: text/plain, Size: 75 bytes --]

For series:
Reviewed-by: Li Wang <liwang@redhat.com>

-- 
Regards,
Li Wang

[-- Attachment #1.2: Type: text/html, Size: 391 bytes --]

[-- Attachment #2: Type: text/plain, Size: 60 bytes --]


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [PATCH 1/2] lapi/mount.h: Remove <linux/mount.h>
  2022-05-10  9:03   ` Li Wang
@ 2022-05-10 11:02     ` Petr Vorel
  0 siblings, 0 replies; 6+ messages in thread
From: Petr Vorel @ 2022-05-10 11:02 UTC (permalink / raw)
  To: Li Wang, Cyril Hrubis; +Cc: LTP List

Hi Cyril, Li,

thanks for your review, merged.

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

end of thread, other threads:[~2022-05-10 11:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-03 15:29 [LTP] [PATCH 0/2] Fix constant redefinition Petr Vorel
2022-05-03 15:29 ` [LTP] [PATCH 1/2] lapi/mount.h: Remove <linux/mount.h> Petr Vorel
2022-05-10  9:03   ` Li Wang
2022-05-10 11:02     ` Petr Vorel
2022-05-03 15:29 ` [LTP] [PATCH 2/2] Remove duplicate include of <sys/mount.h> Petr Vorel
2022-05-09 15:09 ` [LTP] [PATCH 0/2] Fix constant redefinition Cyril Hrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox