public inbox for intel-xe@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe/pf: Streamline fair scheduling error reporting
@ 2026-04-14 22:04 Jonathan Cavitt
  2026-04-14 23:18 ` ✓ CI.KUnit: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Jonathan Cavitt @ 2026-04-14 22:04 UTC (permalink / raw)
  To: intel-xe; +Cc: jonathan.cavitt, saurabhg.gupta, alex.zuo

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-04-15 14:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-14 22:04 [PATCH] drm/xe/pf: Streamline fair scheduling error reporting Jonathan Cavitt
2026-04-14 23:18 ` ✓ CI.KUnit: success for " 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox