* [PATCH 1/1 linux-next] fs/affs/amigaffs.c: use va_format instead of buffer/vnsprintf
@ 2014-10-13 20:39 Fabian Frederick
2014-10-13 20:51 ` Joe Perches
0 siblings, 1 reply; 2+ messages in thread
From: Fabian Frederick @ 2014-10-13 20:39 UTC (permalink / raw)
To: linux-kernel; +Cc: Fabian Frederick, Joe Perches, Andrew Morton
Remove ErrorBuffer and use %pV
Cc: Joe Perches <joe@perches.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
fs/affs/amigaffs.c | 28 +++++++++++++---------------
1 file changed, 13 insertions(+), 15 deletions(-)
diff --git a/fs/affs/amigaffs.c b/fs/affs/amigaffs.c
index abc8539..9643bdd 100644
--- a/fs/affs/amigaffs.c
+++ b/fs/affs/amigaffs.c
@@ -10,8 +10,6 @@
#include "affs.h"
-static char ErrorBuffer[256];
-
/*
* Functions for accessing Amiga-FFS structures.
*/
@@ -444,30 +442,30 @@ mode_to_prot(struct inode *inode)
void
affs_error(struct super_block *sb, const char *function, const char *fmt, ...)
{
- va_list args;
-
- va_start(args,fmt);
- vsnprintf(ErrorBuffer,sizeof(ErrorBuffer),fmt,args);
- va_end(args);
+ struct va_format vaf;
+ va_list args;
- pr_crit("error (device %s): %s(): %s\n", sb->s_id,
- function,ErrorBuffer);
+ va_start(args, fmt);
+ vaf.fmt = fmt;
+ vaf.va = &args;
+ pr_crit("error (device %s): %s(): %pV\n", sb->s_id, function, &vaf);
if (!(sb->s_flags & MS_RDONLY))
pr_warn("Remounting filesystem read-only\n");
sb->s_flags |= MS_RDONLY;
+ va_end(args);
}
void
affs_warning(struct super_block *sb, const char *function, const char *fmt, ...)
{
- va_list args;
+ struct va_format vaf;
+ va_list args;
- va_start(args,fmt);
- vsnprintf(ErrorBuffer,sizeof(ErrorBuffer),fmt,args);
+ va_start(args, fmt);
+ vaf.fmt = fmt;
+ vaf.va = &args;
+ pr_warn("(device %s): %s(): %pV\n", sb->s_id, function, &vaf);
va_end(args);
-
- pr_warn("(device %s): %s(): %s\n", sb->s_id,
- function,ErrorBuffer);
}
bool
--
1.9.3
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 1/1 linux-next] fs/affs/amigaffs.c: use va_format instead of buffer/vnsprintf
2014-10-13 20:39 [PATCH 1/1 linux-next] fs/affs/amigaffs.c: use va_format instead of buffer/vnsprintf Fabian Frederick
@ 2014-10-13 20:51 ` Joe Perches
0 siblings, 0 replies; 2+ messages in thread
From: Joe Perches @ 2014-10-13 20:51 UTC (permalink / raw)
To: Fabian Frederick; +Cc: linux-kernel, Andrew Morton
On Mon, 2014-10-13 at 22:39 +0200, Fabian Frederick wrote:
> Remove ErrorBuffer and use %pV
Maybe fix the format/argument mismatches too.
https://lkml.org/lkml/2010/11/10/544
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-10-13 20:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-13 20:39 [PATCH 1/1 linux-next] fs/affs/amigaffs.c: use va_format instead of buffer/vnsprintf Fabian Frederick
2014-10-13 20:51 ` 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®