Skip to contentSkip to conversation

btrfs: fix btrfs_no_printk stub helper

PATCH In review Arnd Bergmann 2 participants 2 messages Sep 23, 2016 – Sep 26, 2016 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 btrfs: fix btrfs_no_printk stub helper

The addition of btrfs_no_printk() caused a build failure when CONFIG_PRINTK is disabled:

fs/btrfs/send.c: In function 'send_rename':
fs/btrfs/ctree.h:3367:2: error: implicit declaration of function 'btrfs_no_printk' [-Werror=implicit-function-declaration]

This moves the helper outside of that #ifdef so it is always defined, and changes the existing #ifdef to refer to that helper as well for consistency.

Fixes 47c57058ff2c ("btrfs: btrfs_debug should consume fs_info when DEBUG is not defined")
---
 fs/btrfs/ctree.h | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)
fs/btrfs/ctree.h +7 -10
index e5621268c9fe..63bf4cc34626 100644
@@ -3241,20 +3241,17 @@ int btrfs_parse_options(struct btrfs_root *root, char *options,
 			unsigned long new_flags);
 int btrfs_sync_fs(struct super_block *sb, int wait);
 
+static inline __printf(2, 3)
+void btrfs_no_printk(const struct btrfs_fs_info *fs_info, const char *fmt, ...)
+{
+}
+
 #ifdef CONFIG_PRINTK
 __printf(2, 3)
 void btrfs_printk(const struct btrfs_fs_info *fs_info, const char *fmt, ...);
-__printf(2, 3)
-static inline int btrfs_no_printk(const struct btrfs_fs_info *fs_info,
-				   const char *fmt, ...)
-{
-	return 0;
-}
 #else
-static inline __printf(2, 3)
-void btrfs_printk(const struct btrfs_fs_info *fs_info, const char *fmt, ...)
-{
-}
+#define btrfs_printk(fs_info, fmt, args...) \
+	btrfs_no_printk(fs_info, fmt, ##args)
 #endif
 
 #define btrfs_emerg(fs_info, fmt, args...) \
Signature · 1 line
2.9.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Arnd Bergmann

The addition of btrfs_no_printk() caused a build failure when CONFIG_PRINTK is disabled:

fs/btrfs/send.c: In function 'send_rename':
fs/btrfs/ctree.h:3367:2: error: implicit declaration of function 'btrfs_no_printk' [-Werror=implicit-function-declaration]

Quoted 6 lines

This moves the helper outside of that #ifdef so it is always defined, and changes the existing #ifdef to refer to that helper as well for consistency.

Fixes 47c57058ff2c ("btrfs: btrfs_debug should consume fs_info when DEBUG is not defined")