dect
/
linux-2.6
Archived
13
0
Fork 0

autofs4: clean up uaotfs use of debug/info/warning printouts

Use 'pr_debug()' for DPRINTK, which will do the proper type checking on
the arguments (without generating code) even when DEBUG isn't #defined.

Also, use the standard __VA_ARGS__ for the macros, and stop the
pointless abuse of 'do { xyz } while (0)' when the macro is already a
perfectly well-formed single statement.

Reported-by: David Howells <dhowells@redhat.com>
Suggested-by: Joe Perches <joe@perches.com>
Cc: Ian Kent <raven@themaw.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Linus Torvalds 2011-08-08 11:35:17 -07:00
parent 638a843909
commit c3ad996246
1 changed files with 7 additions and 17 deletions

View File

@ -39,27 +39,17 @@
/* #define DEBUG */ /* #define DEBUG */
#ifdef DEBUG #define DPRINTK(fmt, ...) \
#define DPRINTK(fmt, args...) \ pr_debug("pid %d: %s: " fmt "\n", \
do { \ current->pid, __func__, ##__VA_ARGS__)
printk(KERN_DEBUG "pid %d: %s: " fmt "\n", \
current->pid, __func__, ##args); \
} while (0)
#else
#define DPRINTK(fmt, args...) do {} while (0)
#endif
#define AUTOFS_WARN(fmt, args...) \ #define AUTOFS_WARN(fmt, ...) \
do { \
printk(KERN_WARNING "pid %d: %s: " fmt "\n", \ printk(KERN_WARNING "pid %d: %s: " fmt "\n", \
current->pid, __func__, ##args); \ current->pid, __func__, ##__VA_ARGS__)
} while (0)
#define AUTOFS_ERROR(fmt, args...) \ #define AUTOFS_ERROR(fmt, ...) \
do { \
printk(KERN_ERR "pid %d: %s: " fmt "\n", \ printk(KERN_ERR "pid %d: %s: " fmt "\n", \
current->pid, __func__, ##args); \ current->pid, __func__, ##__VA_ARGS__)
} while (0)
/* Unified info structure. This is pointed to by both the dentry and /* Unified info structure. This is pointed to by both the dentry and
inode structures. Each file in the filesystem has an instance of this inode structures. Each file in the filesystem has an instance of this