drm/i915/gvt/scheduler: Remove unnecessary NULL checks in sr_oa_regs

Submitted by Gustavo A. R. Silva on March 22, 2018, 6:21 p.m.

Details

Message ID 20180322182154.GA21590@embeddedgus
State New
Headers show
Series "drm/i915/gvt/scheduler: Remove unnecessary NULL checks in sr_oa_regs" ( rev: 1 ) in Intel GVT devel

Not browsing as part of any series.

Commit Message

Gustavo A. R. Silva March 22, 2018, 6:21 p.m.
The checks are misleading and not required [1].

[1] https://lkml.org/lkml/2018/3/19/1792

Addresses-Coverity-ID: 1466017
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/gpu/drm/i915/gvt/scheduler.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/i915/gvt/scheduler.c b/drivers/gpu/drm/i915/gvt/scheduler.c
index 78588ef..b6da223 100644
--- a/drivers/gpu/drm/i915/gvt/scheduler.c
+++ b/drivers/gpu/drm/i915/gvt/scheduler.c
@@ -74,7 +74,7 @@  static void sr_oa_regs(struct intel_vgpu_workload *workload,
 		i915_mmio_reg_offset(EU_PERF_CNTL6),
 	};
 
-	if (!workload || !reg_state || workload->ring_id != RCS)
+	if (workload->ring_id != RCS)
 		return;
 
 	if (save) {

Comments

Quoting Gustavo A. R. Silva (2018-03-22 18:21:54)
> The checks are misleading and not required [1].
> 
> [1] https://lkml.org/lkml/2018/3/19/1792
> 
> Addresses-Coverity-ID: 1466017
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

Zhenyu?
-Chris
On 2018.03.22 21:31:33 +0000, Chris Wilson wrote:
> Quoting Gustavo A. R. Silva (2018-03-22 18:21:54)
> > The checks are misleading and not required [1].
> > 
> > [1] https://lkml.org/lkml/2018/3/19/1792
> > 
> > Addresses-Coverity-ID: 1466017
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
> 

Looks good to me, I will pick this up, thanks!