mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 2/2] FS/CONFIGFS: Use pr_fmt
@ 2014-05-13 18:24 Fabian Frederick
  2014-05-13 20:50 ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: Fabian Frederick @ 2014-05-13 18:24 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, Joel Becker

-Adding pr_fmt based on module name.

Cc: Joel Becker <jlbec@evilplan.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 fs/configfs/configfs_internal.h | 6 ++++++
 fs/configfs/dir.c               | 4 ++--
 fs/configfs/inode.c             | 2 +-
 fs/configfs/mount.c             | 4 ++--
 4 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/fs/configfs/configfs_internal.h b/fs/configfs/configfs_internal.h
index b5f0a3b..bd4a3c1 100644
--- a/fs/configfs/configfs_internal.h
+++ b/fs/configfs/configfs_internal.h
@@ -24,6 +24,12 @@
  * configfs Copyright (C) 2005 Oracle.  All rights reserved.
  */
 
+#ifdef pr_fmt
+#undef pr_fmt
+#endif
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/slab.h>
 #include <linux/list.h>
 #include <linux/spinlock.h>
diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c
index 727d06e..668dcab 100644
--- a/fs/configfs/dir.c
+++ b/fs/configfs/dir.c
@@ -1699,7 +1699,7 @@ void configfs_unregister_subsystem(struct configfs_subsystem *subsys)
 	struct dentry *root = dentry->d_sb->s_root;
 
 	if (dentry->d_parent != root) {
-		pr_err("configfs: Tried to unregister non-subsystem!\n");
+		pr_err("Tried to unregister non-subsystem!\n");
 		return;
 	}
 
@@ -1709,7 +1709,7 @@ void configfs_unregister_subsystem(struct configfs_subsystem *subsys)
 	mutex_lock(&configfs_symlink_mutex);
 	spin_lock(&configfs_dirent_lock);
 	if (configfs_detach_prep(dentry, NULL)) {
-		pr_err("configfs: Tried to unregister non-empty subsystem!\n");
+		pr_err("Tried to unregister non-empty subsystem!\n");
 	}
 	spin_unlock(&configfs_dirent_lock);
 	mutex_unlock(&configfs_symlink_mutex);
diff --git a/fs/configfs/inode.c b/fs/configfs/inode.c
index fbb30db..5946ad9 100644
--- a/fs/configfs/inode.c
+++ b/fs/configfs/inode.c
@@ -168,7 +168,7 @@ static void configfs_set_inode_lock_class(struct configfs_dirent *sd,
 			 * In practice the maximum level of locking depth is
 			 * already reached. Just inform about possible reasons.
 			 */
-			pr_info("configfs: Too many levels of inodes for the locking correctness validator.\n");
+			pr_info("Too many levels of inodes for the locking correctness validator.\n");
 			pr_info("Spurious warnings may appear.\n");
 		}
 	}
diff --git a/fs/configfs/mount.c b/fs/configfs/mount.c
index af08de0..f6c2858 100644
--- a/fs/configfs/mount.c
+++ b/fs/configfs/mount.c
@@ -85,7 +85,7 @@ static int configfs_fill_super(struct super_block *sb, void *data, int silent)
 		/* directory inodes start off with i_nlink == 2 (for "." entry) */
 		inc_nlink(inode);
 	} else {
-		pr_debug("configfs: could not get root inode\n");
+		pr_debug("could not get root inode\n");
 		return -ENOMEM;
 	}
 
@@ -155,7 +155,7 @@ static int __init configfs_init(void)
 
 	return 0;
 out4:
-	pr_err("configfs: Unable to register filesystem!\n");
+	pr_err("Unable to register filesystem!\n");
 	configfs_inode_exit();
 out3:
 	kobject_put(config_kobj);
-- 
1.8.4.5


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

* Re: [PATCH 2/2] FS/CONFIGFS: Use pr_fmt
  2014-05-13 18:24 [PATCH 2/2] FS/CONFIGFS: Use pr_fmt Fabian Frederick
@ 2014-05-13 20:50 ` Andrew Morton
  2014-05-13 22:06   ` Valdis.Kletnieks
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2014-05-13 20:50 UTC (permalink / raw)
  To: Fabian Frederick; +Cc: linux-kernel, Joel Becker

On Tue, 13 May 2014 20:24:28 +0200 Fabian Frederick <fabf@skynet.be> wrote:

> -Adding pr_fmt based on module name.
>
> ...
>
> --- a/fs/configfs/configfs_internal.h
> +++ b/fs/configfs/configfs_internal.h
> @@ -24,6 +24,12 @@
>   * configfs Copyright (C) 2005 Oracle.  All rights reserved.
>   */
>  
> +#ifdef pr_fmt
> +#undef pr_fmt
> +#endif

Why this?

> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> +
>  #include <linux/slab.h>
>  #include <linux/list.h>
>  #include <linux/spinlock.h>
>
> ...
>

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

* Re: [PATCH 2/2] FS/CONFIGFS: Use pr_fmt
  2014-05-13 20:50 ` Andrew Morton
@ 2014-05-13 22:06   ` Valdis.Kletnieks
  2014-05-13 22:15     ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: Valdis.Kletnieks @ 2014-05-13 22:06 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Fabian Frederick, linux-kernel, Joel Becker

[-- Attachment #1: Type: text/plain, Size: 350 bytes --]

On Tue, 13 May 2014 13:50:49 -0700, Andrew Morton said:
> On Tue, 13 May 2014 20:24:28 +0200 Fabian Frederick <fabf@skynet.be> wrote:

> > +#ifdef pr_fmt
> > +#undef pr_fmt
> > +#endif
>
> Why this?
>
> > +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

Won't GCC whinge by default about the #define if it doesn't exactly match the
previous definition?

[-- Attachment #2: Type: application/pgp-signature, Size: 848 bytes --]

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

* Re: [PATCH 2/2] FS/CONFIGFS: Use pr_fmt
  2014-05-13 22:06   ` Valdis.Kletnieks
@ 2014-05-13 22:15     ` Andrew Morton
  2014-05-13 22:30       ` Joe Perches
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2014-05-13 22:15 UTC (permalink / raw)
  To: Valdis.Kletnieks; +Cc: Fabian Frederick, linux-kernel, Joel Becker

On Tue, 13 May 2014 18:06:50 -0400 Valdis.Kletnieks@vt.edu wrote:

> On Tue, 13 May 2014 13:50:49 -0700, Andrew Morton said:
> > On Tue, 13 May 2014 20:24:28 +0200 Fabian Frederick <fabf@skynet.be> wrote:
> 
> > > +#ifdef pr_fmt
> > > +#undef pr_fmt
> > > +#endif
> >
> > Why this?
> >
> > > +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> 
> Won't GCC whinge by default about the #define if it doesn't exactly match the
> previous definition?

Yes, if there's already a pf_fmt defined.  That's what I'm asking about
- what pr_fmt are we overriding here?  Seems wrong.


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

* Re: [PATCH 2/2] FS/CONFIGFS: Use pr_fmt
  2014-05-13 22:15     ` Andrew Morton
@ 2014-05-13 22:30       ` Joe Perches
  0 siblings, 0 replies; 5+ messages in thread
From: Joe Perches @ 2014-05-13 22:30 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Valdis.Kletnieks, Fabian Frederick, linux-kernel, Joel Becker

On Tue, 2014-05-13 at 15:15 -0700, Andrew Morton wrote:
> On Tue, 13 May 2014 18:06:50 -0400 Valdis.Kletnieks@vt.edu wrote:
> > On Tue, 13 May 2014 13:50:49 -0700, Andrew Morton said:
> > > On Tue, 13 May 2014 20:24:28 +0200 Fabian Frederick <fabf@skynet.be> wrote:
> > 
> > > > +#ifdef pr_fmt
> > > > +#undef pr_fmt
> > > > +#endif
> > >
> > > Why this?
> > >
> > > > +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> > 
> > Won't GCC whinge by default about the #define if it doesn't exactly match the
> > previous definition?
> 
> Yes, if there's already a pf_fmt defined.  That's what I'm asking about
> - what pr_fmt are we overriding here?  Seems wrong.

If this is not the first #include or if this
#includes kernel.h/printk.h, then the default
#define pr_fmt(fmt) fmt
from printk.h will be used.

One year soon, I'd like to change the default
from blank to KBUILD_MODNAME ": " fmt



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

end of thread, other threads:[~2014-05-13 22:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-13 18:24 [PATCH 2/2] FS/CONFIGFS: Use pr_fmt Fabian Frederick
2014-05-13 20:50 ` Andrew Morton
2014-05-13 22:06   ` Valdis.Kletnieks
2014-05-13 22:15     ` Andrew Morton
2014-05-13 22:30       ` Joe Perches

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

all inboxes | Powered by JetHome®