* [PATCH] tools lib lk: Uninclude linux/magic.h in debugfs.c.
@ 2013-09-18 23:16 Vinson Lee
2013-09-19 7:17 ` Borislav Petkov
2013-09-20 9:57 ` [tip:perf/urgent] tools lib lk: Uninclude linux/ magic.h " tip-bot for Vinson Lee
0 siblings, 2 replies; 4+ messages in thread
From: Vinson Lee @ 2013-09-18 23:16 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Borislav Petkov, linux-kernel
Cc: stable, Vinson Lee, Vinson Lee
From: Vinson Lee <vlee@twitter.com>
The compilation only looks for linux/magic.h from the default include
paths, which does not include the source tree. This results in a build
error if linux/magic.h is not available or not installed.
For example, this build error occurs on CentOS 5.
$ make -C tools/lib/lk V=1
[...]
gcc -o debugfs.o -c -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6
-D_FORTIFY_SOURCE=2 -Wbad-function-cast -Wdeclaration-after-statement
-Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations
-Wmissing-prototypes -Wnested-externs -Wno-system-headers
-Wold-style-definition -Wpacked -Wredundant-decls -Wshadow
-Wstrict-aliasing=3 -Wstrict-prototypes -Wswitch-default -Wswitch-enum
-Wundef -Wwrite-strings -Wformat -fPIC -D_LARGEFILE64_SOURCE
-D_FILE_OFFSET_BITS=64 debugfs.c
debugfs.c:8:25: error: linux/magic.h: No such file or directory
The only symbol from linux/magic.h needed by debugfs.c is DEBUGFS_MAGIC,
and that is already defined in debugfs.h. linux/magic.h isn't providing
any extra symbols and can unincluded. This is similar to the approach by
perf, which has its own magic.h wrapper at
tools/perf/util/include/linux/magic.h
Signed-off-by: Vinson Lee <vlee@twitter.com>
Cc: stable@vger.kernel.org # 3.10+
---
tools/lib/lk/debugfs.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/tools/lib/lk/debugfs.c b/tools/lib/lk/debugfs.c
index 099e7cd..7c43479 100644
--- a/tools/lib/lk/debugfs.c
+++ b/tools/lib/lk/debugfs.c
@@ -5,7 +5,6 @@
#include <stdbool.h>
#include <sys/vfs.h>
#include <sys/mount.h>
-#include <linux/magic.h>
#include <linux/kernel.h>
#include "debugfs.h"
--
1.8.2.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] tools lib lk: Uninclude linux/magic.h in debugfs.c.
2013-09-18 23:16 [PATCH] tools lib lk: Uninclude linux/magic.h in debugfs.c Vinson Lee
@ 2013-09-19 7:17 ` Borislav Petkov
2013-09-19 15:32 ` Arnaldo Carvalho de Melo
2013-09-20 9:57 ` [tip:perf/urgent] tools lib lk: Uninclude linux/ magic.h " tip-bot for Vinson Lee
1 sibling, 1 reply; 4+ messages in thread
From: Borislav Petkov @ 2013-09-19 7:17 UTC (permalink / raw)
To: Vinson Lee; +Cc: Arnaldo Carvalho de Melo, linux-kernel, stable, Vinson Lee
On Wed, Sep 18, 2013 at 04:16:40PM -0700, Vinson Lee wrote:
> From: Vinson Lee <vlee@twitter.com>
>
> The compilation only looks for linux/magic.h from the default include
> paths, which does not include the source tree. This results in a build
> error if linux/magic.h is not available or not installed.
Right, we have:
tools/perf/util/include/linux/magic.h
but tools/lib/lk/Makefile doesn't know about it, it seems. Oh well, the
solution falling back to debugfs.h is even better. :)
> For example, this build error occurs on CentOS 5.
>
> $ make -C tools/lib/lk V=1
> [...]
> gcc -o debugfs.o -c -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6
> -D_FORTIFY_SOURCE=2 -Wbad-function-cast -Wdeclaration-after-statement
> -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations
> -Wmissing-prototypes -Wnested-externs -Wno-system-headers
> -Wold-style-definition -Wpacked -Wredundant-decls -Wshadow
> -Wstrict-aliasing=3 -Wstrict-prototypes -Wswitch-default -Wswitch-enum
> -Wundef -Wwrite-strings -Wformat -fPIC -D_LARGEFILE64_SOURCE
> -D_FILE_OFFSET_BITS=64 debugfs.c
> debugfs.c:8:25: error: linux/magic.h: No such file or directory
>
> The only symbol from linux/magic.h needed by debugfs.c is DEBUGFS_MAGIC,
> and that is already defined in debugfs.h. linux/magic.h isn't providing
> any extra symbols and can unincluded. This is similar to the approach by
> perf, which has its own magic.h wrapper at
> tools/perf/util/include/linux/magic.h
>
> Signed-off-by: Vinson Lee <vlee@twitter.com>
> Cc: stable@vger.kernel.org # 3.10+
Acked-by: Borislav Petkov <bp@suse.de>
> ---
> tools/lib/lk/debugfs.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/tools/lib/lk/debugfs.c b/tools/lib/lk/debugfs.c
> index 099e7cd..7c43479 100644
> --- a/tools/lib/lk/debugfs.c
> +++ b/tools/lib/lk/debugfs.c
> @@ -5,7 +5,6 @@
> #include <stdbool.h>
> #include <sys/vfs.h>
> #include <sys/mount.h>
> -#include <linux/magic.h>
> #include <linux/kernel.h>
>
> #include "debugfs.h"
> --
> 1.8.2.1
>
--
Regards/Gruss,
Boris.
Sent from a fat crate under my desk. Formatting is fine.
--
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] tools lib lk: Uninclude linux/magic.h in debugfs.c.
2013-09-19 7:17 ` Borislav Petkov
@ 2013-09-19 15:32 ` Arnaldo Carvalho de Melo
0 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-09-19 15:32 UTC (permalink / raw)
To: Borislav Petkov; +Cc: Vinson Lee, linux-kernel, stable, Vinson Lee
Em Thu, Sep 19, 2013 at 09:17:20AM +0200, Borislav Petkov escreveu:
> On Wed, Sep 18, 2013 at 04:16:40PM -0700, Vinson Lee wrote:
> > From: Vinson Lee <vlee@twitter.com>
> >
> > The compilation only looks for linux/magic.h from the default include
> >
> > Signed-off-by: Vinson Lee <vlee@twitter.com>
> > Cc: stable@vger.kernel.org # 3.10+
>
> Acked-by: Borislav Petkov <bp@suse.de>
Thanks, applied.
- Arnaldo
^ permalink raw reply [flat|nested] 4+ messages in thread
* [tip:perf/urgent] tools lib lk: Uninclude linux/ magic.h in debugfs.c
2013-09-18 23:16 [PATCH] tools lib lk: Uninclude linux/magic.h in debugfs.c Vinson Lee
2013-09-19 7:17 ` Borislav Petkov
@ 2013-09-20 9:57 ` tip-bot for Vinson Lee
1 sibling, 0 replies; 4+ messages in thread
From: tip-bot for Vinson Lee @ 2013-09-20 9:57 UTC (permalink / raw)
To: linux-tip-commits; +Cc: acme, linux-kernel, hpa, mingo, tglx, bp, vlee, vlee
Commit-ID: ce7eebe5c3deef8e19c177c24ee75843256e69ca
Gitweb: http://git.kernel.org/tip/ce7eebe5c3deef8e19c177c24ee75843256e69ca
Author: Vinson Lee <vlee@twitter.com>
AuthorDate: Wed, 18 Sep 2013 16:16:40 -0700
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 19 Sep 2013 15:08:53 -0300
tools lib lk: Uninclude linux/magic.h in debugfs.c
The compilation only looks for linux/magic.h from the default include
paths, which does not include the source tree. This results in a build
error if linux/magic.h is not available or not installed.
For example, this build error occurs on CentOS 5.
$ make -C tools/lib/lk V=1
[...]
gcc -o debugfs.o -c -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6
-D_FORTIFY_SOURCE=2 -Wbad-function-cast -Wdeclaration-after-statement
-Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations
-Wmissing-prototypes -Wnested-externs -Wno-system-headers
-Wold-style-definition -Wpacked -Wredundant-decls -Wshadow
-Wstrict-aliasing=3 -Wstrict-prototypes -Wswitch-default -Wswitch-enum
-Wundef -Wwrite-strings -Wformat -fPIC -D_LARGEFILE64_SOURCE
-D_FILE_OFFSET_BITS=64 debugfs.c
debugfs.c:8:25: error: linux/magic.h: No such file or directory
The only symbol from linux/magic.h needed by debugfs.c is DEBUGFS_MAGIC,
and that is already defined in debugfs.h. linux/magic.h isn't providing
any extra symbols and can unincluded. This is similar to the approach by
perf, which has its own magic.h wrapper at
tools/perf/util/include/linux/magic.h
Signed-off-by: Vinson Lee <vlee@twitter.com>
Acked-by: Borislav Petkov <bp@suse.de>
Cc: Borislav Petkov <bp@suse.de>
Cc: Vinson Lee <vlee@freedesktop.org>
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/1379546200-17028-1-git-send-email-vlee@freedesktop.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/lib/lk/debugfs.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/tools/lib/lk/debugfs.c b/tools/lib/lk/debugfs.c
index 099e7cd..7c43479 100644
--- a/tools/lib/lk/debugfs.c
+++ b/tools/lib/lk/debugfs.c
@@ -5,7 +5,6 @@
#include <stdbool.h>
#include <sys/vfs.h>
#include <sys/mount.h>
-#include <linux/magic.h>
#include <linux/kernel.h>
#include "debugfs.h"
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-09-20 9:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-18 23:16 [PATCH] tools lib lk: Uninclude linux/magic.h in debugfs.c Vinson Lee
2013-09-19 7:17 ` Borislav Petkov
2013-09-19 15:32 ` Arnaldo Carvalho de Melo
2013-09-20 9:57 ` [tip:perf/urgent] tools lib lk: Uninclude linux/ magic.h " tip-bot for Vinson Lee
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome