From: Michal Wajdeczko Date: Wed, 15 Nov 2023 11:58:16 +0000 (+0100) Subject: drm/xe/kunit: Return number of iterated devices X-Git-Tag: v6.8-rc1~111^2~7^2~134 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5bb83841a3b9cecc49ae1f02e85909b426a6facc;p=thirdparty%2Flinux.git drm/xe/kunit: Return number of iterated devices In xe_call_for_each_device() we are already counting number of iterated devices. Lets make that available to the caller too. We will use that functionality in upcoming patches. Reviewed-by: Lucas De Marchi Link: https://lore.kernel.org/r/20231115115816.1993-1-michal.wajdeczko@intel.com Signed-off-by: Michal Wajdeczko Signed-off-by: Rodrigo Vivi --- diff --git a/drivers/gpu/drm/xe/tests/xe_pci.c b/drivers/gpu/drm/xe/tests/xe_pci.c index a40879da2fbe1..306ff8cb35cb1 100644 --- a/drivers/gpu/drm/xe/tests/xe_pci.c +++ b/drivers/gpu/drm/xe/tests/xe_pci.c @@ -42,8 +42,8 @@ static int dev_to_xe_device_fn(struct device *dev, void *__data) * function. Across each function call, drm_dev_enter() / drm_dev_exit() is * called for the corresponding drm device. * - * Return: Zero or the error code of a call to @xe_fn returning an error - * code. + * Return: Number of devices iterated or + * the error code of a call to @xe_fn returning an error code. */ int xe_call_for_each_device(xe_device_fn xe_fn) { @@ -59,7 +59,7 @@ int xe_call_for_each_device(xe_device_fn xe_fn) if (!data.ndevs) kunit_skip(current->kunit_test, "test runs only on hardware\n"); - return ret; + return ret ?: data.ndevs; } /**