All of lore.kernel.org
 help / color / mirror / Atom feed
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

WARNING: multiple messages have this Message-ID (diff)
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: [Intel-gfx] [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);
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.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>

[-- Attachment #1: Type: text/plain, Size: 1874 bytes --]

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);

  reply	other threads:[~2020-08-11 19:41 UTC|newest]

Thread overview: 6+ 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
2020-08-11 19:41 ` [Intel-gfx] " kernel test robot
2020-08-11 19:41 ` kernel test robot [this message]
2020-08-11 19:41   ` [PATCH] drm/i915/gt: fix itnull.cocci warnings kernel test robot
2020-08-11 19:41   ` [Intel-gfx] " kernel test robot

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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.