public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs: kill off xfs_printk()
@ 2011-05-03 20:14 Alex Elder
  2011-05-03 20:21 ` Alex Elder
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Alex Elder @ 2011-05-03 20:14 UTC (permalink / raw)
  To: xfs; +Cc: Joe Perches, Alex Elder

From: Joe Perches <joe@perches.com>

xfs_alert_tag() can be defined using xfs_alert(), and thereby avoid
using xfs_printk() altogether.  This is the only remaining use of
xfs_printk(), so changing it this way means xfs_printk() can simply
be eliminated.can simply be eliminated.can simply be eliminated.can
simply be eliminated.can simply be eliminated.can simply be
eliminated.can simply be eliminated.can simply be eliminated.can
simply be eliminated.

Also add format checking to the non-debug inline function xfs_debug.
Miscellaneous function prototype argument alignment.

(Updated to delete the definition of xfs_printk(), which is
no longer used or needed.)

Signed-off-by: Alex Elder <aelder@sgi.com>
---
 fs/xfs/linux-2.6/xfs_message.c |   20 +-------------------
 fs/xfs/linux-2.6/xfs_message.h |    7 +++----
 2 files changed, 4 insertions(+), 23 deletions(-)

diff --git a/fs/xfs/linux-2.6/xfs_message.c b/fs/xfs/linux-2.6/xfs_message.c
index 9f76cce..bd672de 100644
--- a/fs/xfs/linux-2.6/xfs_message.c
+++ b/fs/xfs/linux-2.6/xfs_message.c
@@ -41,23 +41,6 @@ __xfs_printk(
 	printk("%sXFS: %pV\n", level, vaf);
 }
 
-void xfs_printk(
-	const char		*level,
-	const struct xfs_mount	*mp,
-	const char		*fmt, ...)
-{
-	struct va_format	vaf;
-	va_list			args;
-
-	va_start(args, fmt);
-
-	vaf.fmt = fmt;
-	vaf.va = &args;
-
-	__xfs_printk(level, mp, &vaf);
-	va_end(args);
-}
-
 #define define_xfs_printk_level(func, kern_level)		\
 void func(const struct xfs_mount *mp, const char *fmt, ...)	\
 {								\
@@ -95,8 +78,7 @@ xfs_alert_tag(
 	int			do_panic = 0;
 
 	if (xfs_panic_mask && (xfs_panic_mask & panic_tag)) {
-		xfs_printk(KERN_ALERT, mp,
-			"XFS: Transforming an alert into a BUG.");
+		xfs_alert(mp, "Transforming an alert into a BUG.");
 		do_panic = 1;
 	}
 
diff --git a/fs/xfs/linux-2.6/xfs_message.h b/fs/xfs/linux-2.6/xfs_message.h
index f1b3fc1..7fb7ea0 100644
--- a/fs/xfs/linux-2.6/xfs_message.h
+++ b/fs/xfs/linux-2.6/xfs_message.h
@@ -3,9 +3,6 @@
 
 struct xfs_mount;
 
-extern void xfs_printk(const char *level, const struct xfs_mount *mp,
-                      const char *fmt, ...)
-        __attribute__ ((format (printf, 3, 4)));
 extern void xfs_emerg(const struct xfs_mount *mp, const char *fmt, ...)
         __attribute__ ((format (printf, 2, 3)));
 extern void xfs_alert(const struct xfs_mount *mp, const char *fmt, ...)
@@ -28,7 +25,9 @@ extern void xfs_info(const struct xfs_mount *mp, const char *fmt, ...)
 extern void xfs_debug(const struct xfs_mount *mp, const char *fmt, ...)
         __attribute__ ((format (printf, 2, 3)));
 #else
-static inline void xfs_debug(const struct xfs_mount *mp, const char *fmt, ...)
+static inline void
+__attribute__ ((format (printf, 2, 3)))
+xfs_debug(const struct xfs_mount *mp, const char *fmt, ...)
 {
 }
 #endif
-- 
1.7.4.4

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] xfs: kill off xfs_printk()
  2011-05-03 20:14 [PATCH] xfs: kill off xfs_printk() Alex Elder
@ 2011-05-03 20:21 ` Alex Elder
  2011-05-03 20:27 ` Joe Perches
  2011-05-04  0:44 ` Dave Chinner
  2 siblings, 0 replies; 6+ messages in thread
From: Alex Elder @ 2011-05-03 20:21 UTC (permalink / raw)
  To: xfs; +Cc: Joe Perches

On Tue, 2011-05-03 at 15:14 -0500, Alex Elder wrote:
...
> xfs_alert_tag() can be defined using xfs_alert(), and thereby avoid
> using xfs_printk() altogether.  This is the only remaining use of
> xfs_printk(), so changing it this way means xfs_printk() can simply
> be eliminated.can simply be eliminated.can simply be eliminated.can
> simply be eliminated.can simply be eliminated.can simply be
> eliminated.can simply be eliminated.can simply be eliminated.can
> simply be eliminated.

. . .


In case it wasn't clear from my text, xfs_printk() can
simply be eliminated.

(I don't know how all those duplicates got in there.)

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] xfs: kill off xfs_printk()
  2011-05-03 20:14 [PATCH] xfs: kill off xfs_printk() Alex Elder
  2011-05-03 20:21 ` Alex Elder
@ 2011-05-03 20:27 ` Joe Perches
  2011-05-04  0:44 ` Dave Chinner
  2 siblings, 0 replies; 6+ messages in thread
From: Joe Perches @ 2011-05-03 20:27 UTC (permalink / raw)
  To: Alex Elder; +Cc: xfs

On Tue, 2011-05-03 at 15:14 -0500, Alex Elder wrote:
> From: Joe Perches <joe@perches.com>
> 
> xfs_alert_tag() can be defined using xfs_alert(), and thereby avoid
> using xfs_printk() altogether.  This is the only remaining use of
> xfs_printk(), so changing it this way means xfs_printk() can simply
> be eliminated.can simply be eliminated.can simply be eliminated.can
> simply be eliminated.can simply be eliminated.can simply be
> eliminated.can simply be eliminated.can simply be eliminated.can
> simply be eliminated.

Recursion overflow?


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] xfs: kill off xfs_printk()
  2011-05-03 20:14 [PATCH] xfs: kill off xfs_printk() Alex Elder
  2011-05-03 20:21 ` Alex Elder
  2011-05-03 20:27 ` Joe Perches
@ 2011-05-04  0:44 ` Dave Chinner
  2011-05-04 14:29   ` Alex Elder
  2 siblings, 1 reply; 6+ messages in thread
From: Dave Chinner @ 2011-05-04  0:44 UTC (permalink / raw)
  To: Alex Elder; +Cc: Joe Perches, xfs

On Tue, May 03, 2011 at 03:14:44PM -0500, Alex Elder wrote:
> From: Joe Perches <joe@perches.com>
> 
> xfs_alert_tag() can be defined using xfs_alert(), and thereby avoid
> using xfs_printk() altogether.  This is the only remaining use of
> xfs_printk(), so changing it this way means xfs_printk() can simply
> be eliminated.can simply be eliminated.can simply be eliminated.can
> simply be eliminated.can simply be eliminated.can simply be
> eliminated.can simply be eliminated.can simply be eliminated.can
> simply be eliminated.
> 
> Also add format checking to the non-debug inline function xfs_debug.
> Miscellaneous function prototype argument alignment.
> 
> (Updated to delete the definition of xfs_printk(), which is
> no longer used or needed.)
> 
> Signed-off-by: Alex Elder <aelder@sgi.com>

If you are going to credit Joe as the original source of the patch
in the commit (i.e. via the "From:" tag), you probably should copy
in his original Signed-off-by tag as well....

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] xfs: kill off xfs_printk()
  2011-05-04  0:44 ` Dave Chinner
@ 2011-05-04 14:29   ` Alex Elder
  2011-05-04 14:54     ` Joe Perches
  0 siblings, 1 reply; 6+ messages in thread
From: Alex Elder @ 2011-05-04 14:29 UTC (permalink / raw)
  To: Dave Chinner; +Cc: Joe Perches, xfs

On Wed, 2011-05-04 at 10:44 +1000, Dave Chinner wrote:
> On Tue, May 03, 2011 at 03:14:44PM -0500, Alex Elder wrote:
> > From: Joe Perches <joe@perches.com>
> > 
> > xfs_alert_tag() can be defined using xfs_alert(), and thereby avoid
> > using xfs_printk() altogether.  This is the only remaining use of
> > xfs_printk(), so changing it this way means xfs_printk() can simply
> > be eliminated.can simply be eliminated.can simply be eliminated.can
> > simply be eliminated.can simply be eliminated.can simply be
> > eliminated.can simply be eliminated.can simply be eliminated.can
> > simply be eliminated.
> > 
> > Also add format checking to the non-debug inline function xfs_debug.
> > Miscellaneous function prototype argument alignment.
> > 
> > (Updated to delete the definition of xfs_printk(), which is
> > no longer used or needed.)
> > 
> > Signed-off-by: Alex Elder <aelder@sgi.com>
> 
> If you are going to credit Joe as the original source of the patch
> in the commit (i.e. via the "From:" tag), you probably should copy
> in his original Signed-off-by tag as well....

Honestly I wasn't sure about that.  Since I changed it I
kind of hoped he'd acknowledge or sign off on it.  I guess
I'm still learning about the conventions for signing off
on things.  I want to give all credit properly, I just
don't always know the Right Way to do so.

					-Alex


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] xfs: kill off xfs_printk()
  2011-05-04 14:29   ` Alex Elder
@ 2011-05-04 14:54     ` Joe Perches
  0 siblings, 0 replies; 6+ messages in thread
From: Joe Perches @ 2011-05-04 14:54 UTC (permalink / raw)
  To: aelder; +Cc: xfs

On Wed, 2011-05-04 at 09:29 -0500, Alex Elder wrote:
> Honestly I wasn't sure about that.  Since I changed it I
> kind of hoped he'd acknowledge or sign off on it.  I guess
> I'm still learning about the conventions for signing off
> on things.  I want to give all credit properly, I just
> don't always know the Right Way to do so.

When I modify a patch to my taste I use

Original-patch-by:

Anyway, no worries to me, whatever you want.

Acked-by: Joe Perches <joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
Original-patch-by: Joe Perches <joe@perches.com>

cheers, Joe

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

end of thread, other threads:[~2011-05-04 14:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-03 20:14 [PATCH] xfs: kill off xfs_printk() Alex Elder
2011-05-03 20:21 ` Alex Elder
2011-05-03 20:27 ` Joe Perches
2011-05-04  0:44 ` Dave Chinner
2011-05-04 14:29   ` Alex Elder
2011-05-04 14:54     ` Joe Perches

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