diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-08-08 14:35:17 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-08-08 14:35:17 -0400 |
| commit | c3ad996246dc5fd6e3df473c5fc1ba6d53e1d402 (patch) | |
| tree | b23aa171847cd48832f6cd0c10c10a195c2b888e | |
| parent | 638a8439096c582bdb523fcea9d875d3e1fed38a (diff) | |
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>
| -rw-r--r-- | fs/autofs4/autofs_i.h | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/fs/autofs4/autofs_i.h b/fs/autofs4/autofs_i.h index 475f9c597cb7..326dc08d3e3f 100644 --- a/fs/autofs4/autofs_i.h +++ b/fs/autofs4/autofs_i.h | |||
| @@ -39,27 +39,17 @@ | |||
| 39 | 39 | ||
| 40 | /* #define DEBUG */ | 40 | /* #define DEBUG */ |
| 41 | 41 | ||
| 42 | #ifdef DEBUG | 42 | #define DPRINTK(fmt, ...) \ |
| 43 | #define DPRINTK(fmt, args...) \ | 43 | pr_debug("pid %d: %s: " fmt "\n", \ |
| 44 | do { \ | 44 | current->pid, __func__, ##__VA_ARGS__) |
| 45 | printk(KERN_DEBUG "pid %d: %s: " fmt "\n", \ | 45 | |
| 46 | current->pid, __func__, ##args); \ | 46 | #define AUTOFS_WARN(fmt, ...) \ |
| 47 | } while (0) | ||
| 48 | #else | ||
| 49 | #define DPRINTK(fmt, args...) do {} while (0) | ||
| 50 | #endif | ||
| 51 | |||
| 52 | #define AUTOFS_WARN(fmt, args...) \ | ||
| 53 | do { \ | ||
| 54 | printk(KERN_WARNING "pid %d: %s: " fmt "\n", \ | 47 | printk(KERN_WARNING "pid %d: %s: " fmt "\n", \ |
| 55 | current->pid, __func__, ##args); \ | 48 | current->pid, __func__, ##__VA_ARGS__) |
| 56 | } while (0) | ||
| 57 | 49 | ||
| 58 | #define AUTOFS_ERROR(fmt, args...) \ | 50 | #define AUTOFS_ERROR(fmt, ...) \ |
| 59 | do { \ | ||
| 60 | printk(KERN_ERR "pid %d: %s: " fmt "\n", \ | 51 | printk(KERN_ERR "pid %d: %s: " fmt "\n", \ |
| 61 | current->pid, __func__, ##args); \ | 52 | current->pid, __func__, ##__VA_ARGS__) |
| 62 | } while (0) | ||
| 63 | 53 | ||
| 64 | /* Unified info structure. This is pointed to by both the dentry and | 54 | /* Unified info structure. This is pointed to by both the dentry and |
| 65 | inode structures. Each file in the filesystem has an instance of this | 55 | inode structures. Each file in the filesystem has an instance of this |
