From: kernel test robot <lkp@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org, kbuild-all@lists.01.org,
Matthew Auld <matthew.auld@intel.com>,
dri-devel@lists.freedesktop.org
Subject: [PATCH] drm/i915/gt: fix itnull.cocci warnings
Date: Wed, 12 Aug 2020 03:41:08 +0800 [thread overview]
Message-ID: <20200811194108.GA12904@295007ce90c4> (raw)
In-Reply-To: <202008120355.g31CBwfF%lkp@intel.com>
From: kernel test robot <lkp@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@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);
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
prev parent reply other threads:[~2020-08-11 19:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-11 19:41 [drm-intel:drm-intel-next-queued 27/28] drivers/gpu/drm/i915/gt/gen6_ppgtt.c:263:6-8: ERROR: iterator variable bound on line 262 cannot be NULL kernel test robot
2020-08-11 19:41 ` kernel test robot [this message]
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=20200811194108.GA12904@295007ce90c4 \
--to=lkp@intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=kbuild-all@lists.01.org \
--cc=matthew.auld@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