From: Arnd Bergmann Date: Fri, 23 Sep 2016 16:05:21 +0000 (+0200) Subject: btrfs: fix btrfs_no_printk stub helper X-Git-Tag: v4.9-rc1~7^2~4 X-Git-Url: http://git.cascardo.eti.br/?a=commitdiff_plain;h=2fd57fcb16483d718043940fd6dfeb176d4dc09c;p=cascardo%2Flinux.git 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") Signed-off-by: Arnd Bergmann Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 5f1408b43e48..bf7cb6da78e6 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -3256,20 +3256,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...) \