public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tamir Duberstein <tamird@kernel.org>
To: Petr Mladek <pmladek@suse.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	 Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	 Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	 Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Kees Cook <kees@kernel.org>,
	linux-kernel@vger.kernel.org,  oe-kbuild-all@lists.linux.dev,
	Tamir Duberstein <tamird@gmail.com>,
	 kernel test robot <lkp@intel.com>
Subject: [PATCH] printf: add __printf attribute
Date: Sat, 06 Dec 2025 08:19:09 -0500	[thread overview]
Message-ID: <20251206-printf-kunit-printf-attr-v1-1-1682808b51d0@gmail.com> (raw)

From: Tamir Duberstein <tamird@gmail.com>

This produces better diagnostics when incorrect inputs are passed.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202512061600.89CKQ3ag-lkp@intel.com/
Signed-off-by: Tamir Duberstein <tamird@gmail.com>
---
 lib/tests/printf_kunit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/tests/printf_kunit.c b/lib/tests/printf_kunit.c
index 7617e5b8b02c..13e2e9afae3b 100644
--- a/lib/tests/printf_kunit.c
+++ b/lib/tests/printf_kunit.c
@@ -266,7 +266,7 @@ hash_pointer(struct kunit *kunittest)
 	KUNIT_EXPECT_MEMNEQ(kunittest, buf, PTR_STR, PTR_WIDTH);
 }
 
-static void
+static void __printf(2, 3)
 test_hashed(struct kunit *kunittest, const char *fmt, const void *p)
 {
 	char buf[PLAIN_BUF_SIZE];

---
base-commit: 559e608c46553c107dbba19dae0854af7b219400
change-id: 20251206-printf-kunit-printf-attr-19369fc57bf0

Best regards,
--  
Tamir Duberstein <tamird@gmail.com>


             reply	other threads:[~2025-12-06 13:19 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-06 13:19 Tamir Duberstein [this message]
2025-12-06 16:11 ` [PATCH] printf: add __printf attribute Andy Shevchenko
2025-12-06 17:13   ` Tamir Duberstein
2025-12-06 17:49     ` Andy Shevchenko
2025-12-06 17:52       ` Tamir Duberstein
2025-12-06 19:43         ` Andy Shevchenko
2025-12-06 19:57           ` Tamir Duberstein
2025-12-06 21:45             ` Andy Shevchenko
2025-12-08  1:32               ` Tamir Duberstein
2025-12-08 13:30                 ` Andy Shevchenko
2025-12-08 14:05                   ` Petr Mladek
2025-12-08 21:07                     ` Tamir Duberstein
2025-12-16 10:13                       ` Petr Mladek
2026-01-15 14:53                         ` Tamir Duberstein
2026-01-16  9:31                           ` Petr Mladek
2026-01-16 16:26                             ` Tamir Duberstein
2025-12-07  1:16 ` kernel test robot
2025-12-07  2:21 ` kernel test robot

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=20251206-printf-kunit-printf-attr-v1-1-1682808b51d0@gmail.com \
    --to=tamird@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=senozhatsky@chromium.org \
    --cc=tamird@gmail.com \
    /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