[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <3fdc015b-33e5-4c10-88b0-964e95fb22b2@gmail.com>
Date: Sun, 7 Jan 2024 23:17:10 -0500
From: Luben Tuikov <ltuikov89@...il.com>
To: Markus Elfring <Markus.Elfring@....de>, dri-devel@...ts.freedesktop.org,
kernel-janitors@...r.kernel.org, Daniel Vetter <daniel@...ll.ch>,
David Airlie <airlied@...il.com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>
Cc: LKML <linux-kernel@...r.kernel.org>, cocci@...ia.fr
Subject: Re: [PATCH 2/2] drm/sched: Return an error code only as a constant in
drm_sched_init()
On 2023-12-26 10:58, Markus Elfring wrote:
> From: Markus Elfring <elfring@...rs.sourceforge.net>
> Date: Tue, 26 Dec 2023 16:37:37 +0100
>
> Return an error code without storing it in an intermediate variable.
>
> Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
Thank you Markus for this patch.
Reviewed-by: Luben Tuikov <ltuikov89@...il.com>
Pushed to drm-misc-next.
--
Regards,
Luben
> ---
> drivers/gpu/drm/scheduler/sched_main.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c
> index b99d4e9ff109..1abbcdf38430 100644
> --- a/drivers/gpu/drm/scheduler/sched_main.c
> +++ b/drivers/gpu/drm/scheduler/sched_main.c
> @@ -1249,7 +1249,7 @@ int drm_sched_init(struct drm_gpu_scheduler *sched,
> long timeout, struct workqueue_struct *timeout_wq,
> atomic_t *score, const char *name, struct device *dev)
> {
> - int i, ret;
> + int i;
>
> sched->ops = ops;
> sched->credit_limit = credit_limit;
> @@ -1285,7 +1285,7 @@ int drm_sched_init(struct drm_gpu_scheduler *sched,
>
> sched->own_submit_wq = true;
> }
> - ret = -ENOMEM;
> +
> sched->sched_rq = kmalloc_array(num_rqs, sizeof(*sched->sched_rq),
> GFP_KERNEL | __GFP_ZERO);
> if (!sched->sched_rq)
> @@ -1321,7 +1321,7 @@ int drm_sched_init(struct drm_gpu_scheduler *sched,
> if (sched->own_submit_wq)
> destroy_workqueue(sched->submit_wq);
> drm_err(sched, "%s: Failed to setup GPU scheduler--out of memory\n", __func__);
> - return ret;
> + return -ENOMEM;
> }
> EXPORT_SYMBOL(drm_sched_init);
>
> --
> 2.43.0
>
Download attachment "OpenPGP_0x4C15479431A334AF.asc" of type "application/pgp-keys" (665 bytes)
Download attachment "OpenPGP_signature.asc" of type "application/pgp-signature" (237 bytes)
Powered by blists - more mailing lists