* [PATCH] btrfs: unify __printf and __cold annotations on error reporting definitions
@ 2026-10-20 23:35 Adrián García Casado
0 siblings, 0 replies; only message in thread
From: Adrián García Casado @ 2026-10-20 23:35 UTC (permalink / raw)
To: David Sterba; +Cc: Filipe Manana, Chris Mason, linux-btrfs, linux-kernel
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.
Suggested-by: David Sterba <dsterba@suse.com>
Signed-off-by: Adrián García Casado <adriangarciacasado42@gmail.com>
---
fs/btrfs/messages.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/messages.c b/fs/btrfs/messages.c
index 0704be7be..73acb69c3 100644
--- a/fs/btrfs/messages.c
+++ b/fs/btrfs/messages.c
@@ -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, ...)
{
--
2.56.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-21 0:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-20 23:35 [PATCH] btrfs: unify __printf and __cold annotations on error reporting definitions Adrián García Casado
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox