From: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
To: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>,
<intel-xe@lists.freedesktop.org>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [PATCH v2 3/4] drm/xe: Incase of action add failure, free_gsc_pkt only once.
Date: Mon, 8 Apr 2024 10:32:32 -0700 [thread overview]
Message-ID: <2a7395fe-869b-4a96-a464-8e1f05614124@intel.com> (raw)
In-Reply-To: <20240408144944.604448-4-himal.prasad.ghimiray@intel.com>
On 4/8/2024 7:49 AM, Himal Prasad Ghimiray wrote:
> The drmm_add_action_or_reset function automatically invokes the
> action (free_gsc_pkt) in the event of a failure; therefore, there's no
> necessity to call it within the return check.
>
> Fixes: d8b1571312b7 ("drm/xe/huc: HuC authentication via GSC")
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Daniele
> ---
> drivers/gpu/drm/xe/xe_huc.c | 9 +--------
> 1 file changed, 1 insertion(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_huc.c b/drivers/gpu/drm/xe/xe_huc.c
> index 78318d73e4cf..39a484a57585 100644
> --- a/drivers/gpu/drm/xe/xe_huc.c
> +++ b/drivers/gpu/drm/xe/xe_huc.c
> @@ -53,7 +53,6 @@ static int huc_alloc_gsc_pkt(struct xe_huc *huc)
> struct xe_gt *gt = huc_to_gt(huc);
> struct xe_device *xe = gt_to_xe(gt);
> struct xe_bo *bo;
> - int err;
>
> /* we use a single object for both input and output */
> bo = xe_bo_create_pin_map(xe, gt_to_tile(gt), NULL,
> @@ -66,13 +65,7 @@ static int huc_alloc_gsc_pkt(struct xe_huc *huc)
>
> huc->gsc_pkt = bo;
>
> - err = drmm_add_action_or_reset(&xe->drm, free_gsc_pkt, huc);
> - if (err) {
> - free_gsc_pkt(&xe->drm, huc);
> - return err;
> - }
> -
> - return 0;
> + return drmm_add_action_or_reset(&xe->drm, free_gsc_pkt, huc);
> }
>
> int xe_huc_init(struct xe_huc *huc)
next prev parent reply other threads:[~2024-04-08 17:32 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-08 14:49 [PATCH 0/4] Cleanup and fixes in drmm_add_action_or_reset usage Himal Prasad Ghimiray
2024-04-08 14:49 ` [PATCH v2 1/4] drm/xe: Simplify function return using drmm_add_action_or_reset() Himal Prasad Ghimiray
2024-04-08 15:08 ` Jani Nikula
2024-04-09 19:48 ` Lucas De Marchi
2024-04-08 14:49 ` [PATCH v2 2/4] drm/xe: Incase of action add failure, remove sysfs only once Himal Prasad Ghimiray
2024-04-09 19:52 ` Lucas De Marchi
2024-04-10 8:16 ` Ghimiray, Himal Prasad
2024-04-10 13:49 ` Lucas De Marchi
2024-04-08 14:49 ` [PATCH v2 3/4] drm/xe: Incase of action add failure, free_gsc_pkt " Himal Prasad Ghimiray
2024-04-08 17:32 ` Daniele Ceraolo Spurio [this message]
2024-04-08 14:49 ` [PATCH v2 4/4] drm/xe: Return NULL incase of drmm_add_action_or_reset failure Himal Prasad Ghimiray
2024-04-09 19:55 ` Lucas De Marchi
2024-04-08 16:58 ` ✓ CI.Patch_applied: success for Cleanup and fixes in drmm_add_action_or_reset usage (rev2) Patchwork
2024-04-08 16:58 ` ✓ CI.checkpatch: " Patchwork
2024-04-08 16:59 ` ✓ CI.KUnit: " Patchwork
2024-04-08 17:11 ` ✓ CI.Build: " Patchwork
2024-04-08 17:14 ` ✓ CI.Hooks: " Patchwork
2024-04-08 17:15 ` ✓ CI.checksparse: " Patchwork
2024-04-08 17:42 ` ✓ CI.BAT: " Patchwork
2024-04-08 21:14 ` ✗ CI.FULL: failure " Patchwork
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=2a7395fe-869b-4a96-a464-8e1f05614124@intel.com \
--to=daniele.ceraolospurio@intel.com \
--cc=himal.prasad.ghimiray@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=rodrigo.vivi@intel.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