[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240221212624.w4r2w6acijkwn7qg@google.com>
Date: Wed, 21 Feb 2024 21:26:24 +0000
From: Justin Stitt <justinstitt@...gle.com>
To: David Gow <davidgow@...gle.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Shuah Khan <skhan@...uxfoundation.org>,
Guenter Roeck <linux@...ck-us.net>, Rae Moar <rmoar@...gle.com>,
Matthew Auld <matthew.auld@...el.com>,
Arunpravin Paneer Selvam <arunpravin.paneerselvam@....com>,
Christian König <christian.koenig@....com>,
Kees Cook <keescook@...omium.org>,
Maíra Canal <mcanal@...lia.com>,
Rodrigo Vivi <rodrigo.vivi@...el.com>,
Matthew Brost <matthew.brost@...el.com>,
Willem de Bruijn <willemb@...gle.com>,
Florian Westphal <fw@...len.de>,
Cassio Neri <cassio.neri@...il.com>,
Javier Martinez Canillas <javierm@...hat.com>,
Arthur Grillo <arthur.grillo@....br>,
Brendan Higgins <brendan.higgins@...ux.dev>,
Daniel Latypov <dlatypov@...gle.com>,
Stephen Boyd <sboyd@...nel.org>, David Airlie <airlied@...il.com>,
Maxime Ripard <mripard@...nel.org>,
"David S . Miller" <davem@...emloft.net>,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
intel-xe@...ts.freedesktop.org, linux-rtc@...r.kernel.org,
linux-kselftest@...r.kernel.org, kunit-dev@...glegroups.com,
linux-hardening@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH 6/9] net: test: Fix printf format specifier in
skb_segment kunit test
Hi,
On Wed, Feb 21, 2024 at 05:27:19PM +0800, David Gow wrote:
> KUNIT_FAIL() accepts a printf-style format string, but previously did
> not let gcc validate it with the __printf() attribute. The use of %lld
> for the result of PTR_ERR() is not correct.
>
> Instead, use %pe and pass the actual error pointer. printk() will format
> it correctly (and give a symbolic name rather than a number if
> available, which should make the output more readable, too).
>
> Fixes: b3098d32ed6e ("net: add skb_segment kunit test")
> Signed-off-by: David Gow <davidgow@...gle.com>
Looks good.
For those wondering, %pe has a special meaning in the kernel which can
be seen in lib/vsprintf.c.
Reviewed-by: Justin Stitt <justinstitt@...gle.com>
> ---
> net/core/gso_test.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/core/gso_test.c b/net/core/gso_test.c
> index 4c2e77bd12f4..358c44680d91 100644
> --- a/net/core/gso_test.c
> +++ b/net/core/gso_test.c
> @@ -225,7 +225,7 @@ static void gso_test_func(struct kunit *test)
>
> segs = skb_segment(skb, features);
> if (IS_ERR(segs)) {
> - KUNIT_FAIL(test, "segs error %lld", PTR_ERR(segs));
> + KUNIT_FAIL(test, "segs error %pe", segs);
> goto free_gso_skb;
> } else if (!segs) {
> KUNIT_FAIL(test, "no segments");
> --
> 2.44.0.rc0.258.g7320e95886-goog
>
Thanks
Justin
Powered by blists - more mailing lists