Skip to contentSkip to conversation

btrfs: unify __printf and __cold annotations on error reporting definitions

PATCH New Adrián García Casado 1 participant 1 message Oct 21 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 btrfs: unify __printf and __cold annotations on error reporting definitions

In fs/btrfs/messages.h, _btrfs_printk(), __btrfs_handle_fs_error(), and __btrfs_panic() are all declared with both __printf() and __cold attributes.

However, in fs/btrfs/messages.c, only _btrfs_printk() has both __printf(3, 4) and __cold on its definition, while __btrfs_handle_fs_error() and __btrfs_panic() only have __cold.

Add __printf(5, 6) to the definitions of __btrfs_handle_fs_error() and __btrfs_panic() in fs/btrfs/messages.c so that all three functions have consistent __printf() and __cold annotations on both their declarations and definitions.

---
 fs/btrfs/messages.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/btrfs/messages.c +2 -2
index 0704be7be..73acb69c3 100644
@@ -116,7 +116,7 @@ const char * __attribute_const__ btrfs_decode_error(int error)
  * Decodes expected errors from the caller and invokes the appropriate error
  * response.
  */
-__cold
+__printf(5, 6) __cold
 void __btrfs_handle_fs_error(struct btrfs_fs_info *fs_info, const char *function,
 		       unsigned int line, int error, const char *fmt, ...)
 {
@@ -276,7 +276,7 @@ void __cold btrfs_err_32bit_limit(struct btrfs_fs_info *fs_info)
  * Decode unexpected, fatal errors from the caller, issue an alert, and either
  * panic or BUGs, depending on mount options.
  */
-__cold
+__printf(5, 6) __cold
 void __btrfs_panic(const struct btrfs_fs_info *fs_info, const char *function,
 		   unsigned int line, int error, const char *fmt, ...)
 {
Signature · 1 line
2.56.0