Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1490297 > unrolled thread
| Started by | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| First post | 2016-09-23 18:10 +0200 |
| Last post | 2016-09-26 19:20 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] btrfs: fix btrfs_no_printk stub helper Arnd Bergmann <arnd@arndb.de> - 2016-09-23 18:10 +0200
Re: [PATCH] btrfs: fix btrfs_no_printk stub helper David Sterba <dsterba@suse.cz> - 2016-09-26 19:20 +0200
| From | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| Date | 2016-09-23 18:10 +0200 |
| Subject | [PATCH] btrfs: fix btrfs_no_printk stub helper |
| Message-ID | <skBcZ-62t-17@gated-at.bofh.it> |
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 <arnd@arndb.de>
---
fs/btrfs/ctree.h | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index e5621268c9fe..63bf4cc34626 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -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...) \
--
2.9.0
[toc] | [next] | [standalone]
| From | David Sterba <dsterba@suse.cz> |
|---|---|
| Date | 2016-09-26 19:20 +0200 |
| Message-ID | <slHJn-6CT-3@gated-at.bofh.it> |
| In reply to | #1490297 |
On Fri, Sep 23, 2016 at 06:05:21PM +0200, Arnd Bergmann wrote:
> 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 <arnd@arndb.de>
Reviewed-by: David Sterba <dsterba@suse.com>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web