Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: "Adrián García Casado" <adriangarciacasado42@gmail.com>
To: David Sterba <dsterba@suse.com>
Cc: Filipe Manana <fdmanana@suse.com>, Chris Mason <mason@kernel.org>,
	linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] btrfs: unify __printf and __cold annotations on error reporting definitions
Date: Wed, 21 Oct 2026 01:35:30 +0200	[thread overview]
Message-ID: <6ad801a1.7e3d83f3.3d770c.7180@mx.google.com> (raw)

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



                 reply	other threads:[~2026-10-21  0:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6ad801a1.7e3d83f3.3d770c.7180@mx.google.com \
    --to=adriangarciacasado42@gmail.com \
    --cc=dsterba@suse.com \
    --cc=fdmanana@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mason@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox