[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d92e819f-f2bb-4737-8e79-2c60f5740971@roeck-us.net>
Date: Wed, 21 Feb 2024 05:26:36 -0800
From: Guenter Roeck <linux@...ck-us.net>
To: David Gow <davidgow@...gle.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Shuah Khan <skhan@...uxfoundation.org>, 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 8/9] drm/xe/tests: Fix printf format specifiers in
xe_migrate test
On Wed, Feb 21, 2024 at 05:27:21PM +0800, David Gow wrote:
> KUNIT_FAIL() is used to fail the xe_migrate test when an error occurs.
> However, there's a mismatch in the format specifier: '%li' is used to
> log 'err', which is an 'int'.
>
> Use '%i' instead of '%li', and for the case where we're printing an
> error pointer, just use '%pe', instead of extracting the error code
> manually with PTR_ERR(). (This also results in a nicer output when the
> error code is known.)
>
> Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
> Signed-off-by: David Gow <davidgow@...gle.com>
Tested-by: Guenter Roeck <linux@...ck-us.net>
> ---
> drivers/gpu/drm/xe/tests/xe_migrate.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/tests/xe_migrate.c b/drivers/gpu/drm/xe/tests/xe_migrate.c
> index a6523df0f1d3..c347e2c29f81 100644
> --- a/drivers/gpu/drm/xe/tests/xe_migrate.c
> +++ b/drivers/gpu/drm/xe/tests/xe_migrate.c
> @@ -114,21 +114,21 @@ static void test_copy(struct xe_migrate *m, struct xe_bo *bo,
> region |
> XE_BO_NEEDS_CPU_ACCESS);
> if (IS_ERR(remote)) {
> - KUNIT_FAIL(test, "Failed to allocate remote bo for %s: %li\n",
> - str, PTR_ERR(remote));
> + KUNIT_FAIL(test, "Failed to allocate remote bo for %s: %pe\n",
> + str, remote);
> return;
> }
>
> err = xe_bo_validate(remote, NULL, false);
> if (err) {
> - KUNIT_FAIL(test, "Failed to validate system bo for %s: %li\n",
> + KUNIT_FAIL(test, "Failed to validate system bo for %s: %i\n",
> str, err);
> goto out_unlock;
> }
>
> err = xe_bo_vmap(remote);
> if (err) {
> - KUNIT_FAIL(test, "Failed to vmap system bo for %s: %li\n",
> + KUNIT_FAIL(test, "Failed to vmap system bo for %s: %i\n",
> str, err);
> goto out_unlock;
> }
> --
> 2.44.0.rc0.258.g7320e95886-goog
>
Powered by blists - more mailing lists