Skip to content

Commit a28e4b2

Browse files
JoePerchestorvalds
authored andcommitted
hpfs: hpfs_error: Remove static buffer, use vsprintf extension %pV instead
Removing unnecessary static buffers is good. Use the vsprintf %pV extension instead. Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Mikulas Patocka <[email protected]> Cc: [email protected] # v2.6.36+ Signed-off-by: Linus Torvalds <[email protected]>
1 parent ce65761 commit a28e4b2

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

fs/hpfs/super.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,20 @@ static void unmark_dirty(struct super_block *s)
5252
}
5353

5454
/* Filesystem error... */
55-
static char err_buf[1024];
56-
5755
void hpfs_error(struct super_block *s, const char *fmt, ...)
5856
{
57+
struct va_format vaf;
5958
va_list args;
6059

6160
va_start(args, fmt);
62-
vsnprintf(err_buf, sizeof(err_buf), fmt, args);
61+
62+
vaf.fmt = fmt;
63+
vaf.va = &args;
64+
65+
pr_err("filesystem error: %pV", &vaf);
66+
6367
va_end(args);
6468

65-
pr_err("filesystem error: %s", err_buf);
6669
if (!hpfs_sb(s)->sb_was_error) {
6770
if (hpfs_sb(s)->sb_err == 2) {
6871
pr_cont("; crashing the system because you wanted it\n");

0 commit comments

Comments
 (0)