public inbox for intel-xe@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Jonathan Cavitt <jonathan.cavitt@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: jonathan.cavitt@intel.com, saurabhg.gupta@intel.com, alex.zuo@intel.com
Subject: [PATCH] drm/xe/pf: Streamline fair scheduling error reporting
Date: Tue, 14 Apr 2026 22:04:10 +0000	[thread overview]
Message-ID: <20260414220409.119614-2-jonathan.cavitt@intel.com> (raw)

The function xe_gt_sriov_pf_config_set_fair_sched returns the first
error result it encounters, or zero if the function succeeds.  The way
the function accomplishes this is by only overwriting the result value
if it is already zero.

The function checks this three times, but the first time it does this is
unnecessary because the result value defaults to zero, meaning the
result is always overwritten.  We can streamline this by just directly
assigning result to the return value of pf_bulk_set_exec_quantum instead
of assinging it to err, eliminating the superfluous check.  This also
means we don't need to initialize result separately from err.

Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
---
 drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
index e112aa148dab..bb9811bc64d4 100644
--- a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
+++ b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
@@ -2725,8 +2725,7 @@ static bool pf_needs_provision_sched(struct xe_gt *gt, unsigned int num_vfs)
  */
 int xe_gt_sriov_pf_config_set_fair_sched(struct xe_gt *gt, unsigned int num_vfs)
 {
-	int result = 0;
-	int err;
+	int result, err;
 
 	xe_gt_assert(gt, num_vfs);
 	xe_gt_assert(gt, XE_FAIR_EXEC_QUANTUM_MS);
@@ -2737,8 +2736,7 @@ int xe_gt_sriov_pf_config_set_fair_sched(struct xe_gt *gt, unsigned int num_vfs)
 	if (!pf_needs_provision_sched(gt, num_vfs))
 		return 0;
 
-	err = pf_bulk_set_exec_quantum(gt, XE_FAIR_EXEC_QUANTUM_MS, PFID, 1 + num_vfs);
-	result = result ?: err;
+	result = pf_bulk_set_exec_quantum(gt, XE_FAIR_EXEC_QUANTUM_MS, PFID, 1 + num_vfs);
 	err = pf_bulk_set_preempt_timeout(gt, XE_FAIR_PREEMPT_TIMEOUT_US, PFID, 1 + num_vfs);
 	result = result ?: err;
 
-- 
2.43.0


             reply	other threads:[~2026-04-14 22:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-14 22:04 Jonathan Cavitt [this message]
2026-04-14 23:18 ` ✓ CI.KUnit: success for drm/xe/pf: Streamline fair scheduling error reporting Patchwork
2026-04-15  0:58 ` ✓ Xe.CI.FULL: " Patchwork
2026-04-15 10:19 ` [PATCH] " Michal Wajdeczko
2026-04-15 14:24   ` Cavitt, Jonathan

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=20260414220409.119614-2-jonathan.cavitt@intel.com \
    --to=jonathan.cavitt@intel.com \
    --cc=alex.zuo@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=saurabhg.gupta@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