* [PATCH] xfs: Remove duplicate XFS from xfs_alert_tag, neatening
@ 2011-04-21 21:08 Joe Perches
2011-04-26 20:46 ` Alex Elder
0 siblings, 1 reply; 3+ messages in thread
From: Joe Perches @ 2011-04-21 21:08 UTC (permalink / raw)
To: Alex Elder, linux-kernel; +Cc: xfs-masters, xfs, Dave Chinner
The xfs_printk in xfs_alert_tag doesn't need an XFS: prefix
as it's added by xfs_printk.
Add format checking to the non-debug inline function xfs_debug.
Miscellaneous function prototype argument alignment.
Signed-off-by: Joe Perches <joe@perches.com>
---
fs/xfs/linux-2.6/xfs_message.c | 3 +--
fs/xfs/linux-2.6/xfs_message.h | 5 +++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/fs/xfs/linux-2.6/xfs_message.c b/fs/xfs/linux-2.6/xfs_message.c
index 9f76cce..e894ab2 100644
--- a/fs/xfs/linux-2.6/xfs_message.c
+++ b/fs/xfs/linux-2.6/xfs_message.c
@@ -95,8 +95,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..c11f415 100644
--- a/fs/xfs/linux-2.6/xfs_message.h
+++ b/fs/xfs/linux-2.6/xfs_message.h
@@ -11,7 +11,7 @@ extern void xfs_emerg(const struct xfs_mount *mp, const char *fmt, ...)
extern void xfs_alert(const struct xfs_mount *mp, const char *fmt, ...)
__attribute__ ((format (printf, 2, 3)));
extern void xfs_alert_tag(const struct xfs_mount *mp, int tag,
- const char *fmt, ...)
+ const char *fmt, ...)
__attribute__ ((format (printf, 3, 4)));
extern void xfs_crit(const struct xfs_mount *mp, const char *fmt, ...)
__attribute__ ((format (printf, 2, 3)));
@@ -28,7 +28,8 @@ 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 __attribute__ ((format (printf, 2, 3)))
+void xfs_debug(const struct xfs_mount *mp, const char *fmt, ...)
{
}
#endif
--
1.7.5.rc3.dirty
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] xfs: Remove duplicate XFS from xfs_alert_tag, neatening
2011-04-21 21:08 [PATCH] xfs: Remove duplicate XFS from xfs_alert_tag, neatening Joe Perches
@ 2011-04-26 20:46 ` Alex Elder
2011-04-26 20:54 ` Joe Perches
0 siblings, 1 reply; 3+ messages in thread
From: Alex Elder @ 2011-04-26 20:46 UTC (permalink / raw)
To: Joe Perches; +Cc: xfs
On Thu, 2011-04-21 at 14:08 -0700, Joe Perches wrote:
> The xfs_printk in xfs_alert_tag doesn't need an XFS: prefix
> as it's added by xfs_printk.
>
> Add format checking to the non-debug inline function xfs_debug.
> Miscellaneous function prototype argument alignment.
>
> Signed-off-by: Joe Perches <joe@perches.com>
This seems like three very minor changes, but I actually
have something to say about each...
> ---
> fs/xfs/linux-2.6/xfs_message.c | 3 +--
> fs/xfs/linux-2.6/xfs_message.h | 5 +++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/fs/xfs/linux-2.6/xfs_message.c b/fs/xfs/linux-2.6/xfs_message.c
> index 9f76cce..e894ab2 100644
> --- a/fs/xfs/linux-2.6/xfs_message.c
> +++ b/fs/xfs/linux-2.6/xfs_message.c
> @@ -95,8 +95,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;
> }
>
I'll highlight the fact that this was the last caller of
xfs_printk(). As such I think it should just be eliminated,
and make the use of xfs_info() or xfs_debug() mandatory.
They are clean, easy, and have meaningful enough names
that this should be fine. (What do others think?)
> diff --git a/fs/xfs/linux-2.6/xfs_message.h b/fs/xfs/linux-2.6/xfs_message.h
> index f1b3fc1..c11f415 100644
> --- a/fs/xfs/linux-2.6/xfs_message.h
> +++ b/fs/xfs/linux-2.6/xfs_message.h
> @@ -11,7 +11,7 @@ extern void xfs_emerg(const struct xfs_mount *mp, const char *fmt, ...)
> extern void xfs_alert(const struct xfs_mount *mp, const char *fmt, ...)
> __attribute__ ((format (printf, 2, 3)));
> extern void xfs_alert_tag(const struct xfs_mount *mp, int tag,
> - const char *fmt, ...)
> + const char *fmt, ...)
This is a silly white space change, and I guess I don't care
either way. But I think much of the XFS code tab-aligns
things that wrap to successive lines.
> __attribute__ ((format (printf, 3, 4)));
> extern void xfs_crit(const struct xfs_mount *mp, const char *fmt, ...)
> __attribute__ ((format (printf, 2, 3)));
> @@ -28,7 +28,8 @@ 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 __attribute__ ((format (printf, 2, 3)))
> +void xfs_debug(const struct xfs_mount *mp, const char *fmt, ...)
> {
> }
> #endif
How about:
static inline void
__attribute__ ((format (printf, 2, 3)))
xfs_debug(const struct xfs_mount *mp, const char *fmt, ...)
{
}
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] xfs: Remove duplicate XFS from xfs_alert_tag, neatening
2011-04-26 20:46 ` Alex Elder
@ 2011-04-26 20:54 ` Joe Perches
0 siblings, 0 replies; 3+ messages in thread
From: Joe Perches @ 2011-04-26 20:54 UTC (permalink / raw)
To: aelder; +Cc: xfs
On Tue, 2011-04-26 at 15:46 -0500, Alex Elder wrote:
> On Thu, 2011-04-21 at 14:08 -0700, Joe Perches wrote:
> > The xfs_printk in xfs_alert_tag doesn't need an XFS: prefix
> > as it's added by xfs_printk.
> > Add format checking to the non-debug inline function xfs_debug.
> > Miscellaneous function prototype argument alignment.
[]
> I'll highlight the fact that this was the last caller of
> xfs_printk(). As such I think it should just be eliminated,
> and make the use of xfs_info() or xfs_debug() mandatory.
> They are clean, easy, and have meaningful enough names
> that this should be fine. (What do others think?)
I only wanted to point out the unnecessary "XFS:" duplication.
Taking out xfs_printk would save some text & data.
Do what you think appropriate.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-04-26 20:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-21 21:08 [PATCH] xfs: Remove duplicate XFS from xfs_alert_tag, neatening Joe Perches
2011-04-26 20:46 ` Alex Elder
2011-04-26 20: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