From: sfjro@users.sourceforge.net
To: tg@mirbsd.de
Cc: aufs-users@lists.sourceforge.net, debian-kernel@lists.debian.org,
linux-m68k@vger.kernel.org
Subject: [PATCH 1/2] aufs: headers 1/2, bugfix, where the pr_fmt macro definition
Date: Tue, 3 Jan 2012 14:21:21 +0900 [thread overview]
Message-ID: <1325568082-25540-2-git-send-email-sfjro@users.sourceforge.net> (raw)
In-Reply-To: <1325568082-25540-1-git-send-email-sfjro@users.sourceforge.net>
In-Reply-To: <Pine.BSM.4.64L.1201021735430.29291@herc.mirbsd.org>
From: J. R. Okajima <hooanon05@yahoo.co.jp>
The pr_fmt macro is defined in fs/aufs/Makefile and it refers to the
AUFS_NAME macro, which caused a compilation error in m68k architecture.
Also it refers to the "current" macro which will be a problem too.
See-also: http://sourceforge.net/mailarchive/message.php?msg_id=28608043
Reported-by: Ben Hutchings <ben@decadent.org.uk>
Suggested-by: Thorsten Glaser <tg@mirbsd.de>
Signed-off-by: J. R. Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/Makefile | 4 ++--
include/linux/aufs_type.h | 20 ++++++++++++++------
2 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/fs/aufs/Makefile b/fs/aufs/Makefile
index 0aadd21..dc8fd36 100644
--- a/fs/aufs/Makefile
+++ b/fs/aufs/Makefile
@@ -4,8 +4,8 @@ include ${srctree}/${src}/magic.mk
# cf. include/linux/kernel.h
# enable pr_debug
ccflags-y += -DDEBUG
-# sparse doesn't allow spaces
-ccflags-y += -D'pr_fmt(fmt)=AUFS_NAME"\040%s:%d:%s[%d]:\040"fmt,__func__,__LINE__,current->comm,current->pid'
+# sparse requires the full pathname
+ccflags-y += -include ${srctree}/include/linux/aufs_type.h
obj-$(CONFIG_AUFS_FS) += aufs.o
aufs-y := module.o sbinfo.o super.o branch.o xino.o sysaufs.o opts.o \
diff --git a/include/linux/aufs_type.h b/include/linux/aufs_type.h
index 60b52b0..25cdc06 100644
--- a/include/linux/aufs_type.h
+++ b/include/linux/aufs_type.h
@@ -19,15 +19,24 @@
#ifndef __AUFS_TYPE_H__
#define __AUFS_TYPE_H__
-#include <linux/ioctl.h>
-#include <linux/kernel.h>
-#include <linux/limits.h>
+#define AUFS_NAME "aufs"
+
#ifdef __KERNEL__
-#include <linux/types.h>
+/*
+ * define it before including all other headers.
+ * sched.h may use pr_* macros before defining "current", so define the
+ * no-current version first, and re-define later.
+ */
+#define pr_fmt(fmt) AUFS_NAME " %s:%d: " fmt, __func__, __LINE__
+#include <linux/sched.h>
+#undef pr_fmt
+#define pr_fmt(fmt) AUFS_NAME " %s:%d:%s[%d]: " fmt, \
+ __func__, __LINE__, current->comm, current->pid
#else
+#include <linux/limits.h>
#include <stdint.h>
#include <sys/types.h>
-#endif
+#endif /* __KERNEL__ */
#define AUFS_VERSION "2.2-35"
@@ -58,7 +67,6 @@ typedef int16_t aufs_bindex_t;
/* ---------------------------------------------------------------------- */
-#define AUFS_NAME "aufs"
#define AUFS_FSTYPE AUFS_NAME
#define AUFS_ROOT_INO 2
--
1.7.2.5
next prev parent reply other threads:[~2012-01-03 5:21 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-30 17:06 [PATCH] aufs: Do not refer to AUFS_NAME in pr_fmt Ben Hutchings
2011-12-31 4:46 ` sfjro
2011-12-31 8:01 ` Geert Uytterhoeven
2011-12-31 16:31 ` Thorsten Glaser
2012-01-02 2:58 ` sfjro
2012-01-02 3:40 ` Ben Hutchings
2012-01-02 4:01 ` sfjro
2012-01-02 2:04 ` sfjro
2011-12-31 22:18 ` Thorsten Glaser
2011-12-31 22:31 ` Thorsten Glaser
2012-01-01 1:15 ` Thorsten Glaser
2012-01-02 6:45 ` sfjro
2012-01-02 10:31 ` Thorsten Glaser
2012-01-02 13:15 ` sfjro
2012-01-02 13:30 ` Thorsten Glaser
2012-01-02 13:53 ` sfjro
2012-01-02 16:14 ` Thorsten Glaser
2012-01-02 16:53 ` sfjro
2012-01-02 17:36 ` Thorsten Glaser
2012-01-03 5:21 ` [PATCH 0/2] aufs: headers (Re: [PATCH] aufs: Do not refer to AUFS_NAME in pr_fmt) sfjro
2012-01-03 5:21 ` sfjro [this message]
2012-01-03 5:21 ` [PATCH 2/2] aufs: headers 2/2, simply refined sfjro
2011-12-31 22:55 ` [PATCH] aufs: Do not refer to AUFS_NAME in pr_fmt Thorsten Glaser
2012-01-01 8:47 ` Geert Uytterhoeven
2012-01-01 14:48 ` Thorsten Glaser
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1325568082-25540-2-git-send-email-sfjro@users.sourceforge.net \
--to=sfjro@users.sourceforge.net \
--cc=aufs-users@lists.sourceforge.net \
--cc=debian-kernel@lists.debian.org \
--cc=linux-m68k@vger.kernel.org \
--cc=tg@mirbsd.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox