From: kernel test robot <lkp(a)intel.com>
drivers/gpu/drm/i915/gt/gen6_ppgtt.c:263:6-8: ERROR: iterator variable bound on line 262
cannot be NULL
drivers/gpu/drm/i915/gt/gen6_ppgtt.c:322:7-9: ERROR: iterator variable bound on line 321
cannot be NULL
Many iterators have the property that the first argument is always bound
to a real list element, never NULL.
Semantic patch information:
False positives arise for some iterators that do not have this property,
or in cases when the loop cursor is reassigned. The latter should only
happen when the matched code is on the way to a loop exit (break, goto,
or return).
Generated by: scripts/coccinelle/iterators/itnull.cocci
Fixes: 1d567ec61933 ("drm/i915/gt: Switch to object allocations for page
directories")
Signed-off-by: kernel test robot <lkp(a)intel.com>
---
tree:
git://anongit.freedesktop.org/drm-intel drm-intel-next-queued
head: 06b108297b5cc24418e91c1103587ac7ca6fd03f
commit: 1d567ec619333e54283dcd02780ab9a71ef86e44 [27/28] drm/i915/gt: Switch to object
allocations for page directories
Please take the patch only if it's a positive warning. Thanks!
gen6_ppgtt.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
--- a/drivers/gpu/drm/i915/gt/gen6_ppgtt.c
+++ b/drivers/gpu/drm/i915/gt/gen6_ppgtt.c
@@ -260,8 +260,9 @@ static void gen6_ppgtt_free_pd(struct ge
u32 pde;
gen6_for_all_pdes(pt, pd, pde)
- if (pt)
- free_px(&ppgtt->base.vm, pt);
+ {
+ free_px(&ppgtt->base.vm, pt);
+ }
}
static void gen6_ppgtt_cleanup(struct i915_address_space *vm)
@@ -319,7 +320,7 @@ static void pd_vma_unbind(struct i915_ad
/* Free all no longer used page tables */
gen6_for_all_pdes(pt, ppgtt->base.pd, pde) {
- if (!pt || atomic_read(&pt->used))
+ if (atomic_read(&pt->used))
continue;
free_px(&ppgtt->base.vm, pt);