All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: ufs: fix itnull.cocci warnings
@ 2022-03-26  8:35 ` Julia Lawall
  0 siblings, 0 replies; 5+ messages in thread
From: Julia Lawall @ 2022-03-26  8:35 UTC (permalink / raw)
  To: Bart Van Assche; +Cc: linux-kernel, kbuild-all

From: kernel test robot <lkp@intel.com>

list_for_each_entry binds rgn to an entry, which cannot be NULL.  So
remove the first test.

Generated by: scripts/coccinelle/iterators/itnull.cocci

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
---

tree:   https://github.com/bvanassche/linux ufs-for-next
head:   b93e987f91a0c037fc4357107f5144110cd84d08
commit: b93e987f91a0c037fc4357107f5144110cd84d08 [324/324] scsi: ufs: Split the drivers/scsi/ufs directory
:::::: branch date: 11 hours ago
:::::: commit date: 11 hours ago

Please take the patch only if it's a positive warning. Thanks!

 drivers/scsi/ufs-core/ufshpb.c |    6 ------
 1 file changed, 6 deletions(-)

--- a/drivers/scsi/ufs-core/ufshpb.c
+++ b/drivers/scsi/ufs-core/ufshpb.c
@@ -875,12 +875,6 @@ static struct ufshpb_region *ufshpb_vict
 	struct ufshpb_region *rgn, *victim_rgn = NULL;

 	list_for_each_entry(rgn, &lru_info->lh_lru_rgn, list_lru_rgn) {
-		if (!rgn) {
-			dev_err(&hpb->sdev_ufs_lu->sdev_dev,
-				"%s: no region allocated\n",
-				__func__);
-			return NULL;
-		}
 		if (ufshpb_check_srgns_issue_state(hpb, rgn))
 			continue;


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

* [PATCH] scsi: ufs: fix itnull.cocci warnings
@ 2022-03-26  8:35 ` Julia Lawall
  0 siblings, 0 replies; 5+ messages in thread
From: Julia Lawall @ 2022-03-26  8:35 UTC (permalink / raw)
  To: kbuild-all

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

From: kernel test robot <lkp@intel.com>

list_for_each_entry binds rgn to an entry, which cannot be NULL.  So
remove the first test.

Generated by: scripts/coccinelle/iterators/itnull.cocci

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
---

tree:   https://github.com/bvanassche/linux ufs-for-next
head:   b93e987f91a0c037fc4357107f5144110cd84d08
commit: b93e987f91a0c037fc4357107f5144110cd84d08 [324/324] scsi: ufs: Split the drivers/scsi/ufs directory
:::::: branch date: 11 hours ago
:::::: commit date: 11 hours ago

Please take the patch only if it's a positive warning. Thanks!

 drivers/scsi/ufs-core/ufshpb.c |    6 ------
 1 file changed, 6 deletions(-)

--- a/drivers/scsi/ufs-core/ufshpb.c
+++ b/drivers/scsi/ufs-core/ufshpb.c
@@ -875,12 +875,6 @@ static struct ufshpb_region *ufshpb_vict
 	struct ufshpb_region *rgn, *victim_rgn = NULL;

 	list_for_each_entry(rgn, &lru_info->lh_lru_rgn, list_lru_rgn) {
-		if (!rgn) {
-			dev_err(&hpb->sdev_ufs_lu->sdev_dev,
-				"%s: no region allocated\n",
-				__func__);
-			return NULL;
-		}
 		if (ufshpb_check_srgns_issue_state(hpb, rgn))
 			continue;

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

* [PATCH] scsi: ufs: fix itnull.cocci warnings
  2022-03-24 11:50 [bvanassche:ufs-for-next 324/324] drivers/scsi/ufs-core/ufshpb.c:878:7-10: ERROR: iterator variable bound on line 877 cannot be NULL kernel test robot
@ 2022-03-24 11:42 ` kernel test robot
  0 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2022-03-24 11:42 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Bart Van Assche <bvanassche@acm.org>

From: kernel test robot <lkp@intel.com>

drivers/scsi/ufs-core/ufshpb.c:878:7-10: ERROR: iterator variable bound on line 877 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

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://github.com/bvanassche/linux ufs-for-next
head:   b93e987f91a0c037fc4357107f5144110cd84d08
commit: b93e987f91a0c037fc4357107f5144110cd84d08 [324/324] scsi: ufs: Split the drivers/scsi/ufs directory
:::::: branch date: 11 hours ago
:::::: commit date: 11 hours ago

Please take the patch only if it's a positive warning. Thanks!

 drivers/scsi/ufs-core/ufshpb.c |    6 ------
 1 file changed, 6 deletions(-)

--- a/drivers/scsi/ufs-core/ufshpb.c
+++ b/drivers/scsi/ufs-core/ufshpb.c
@@ -875,12 +875,6 @@ static struct ufshpb_region *ufshpb_vict
 	struct ufshpb_region *rgn, *victim_rgn = NULL;
 
 	list_for_each_entry(rgn, &lru_info->lh_lru_rgn, list_lru_rgn) {
-		if (!rgn) {
-			dev_err(&hpb->sdev_ufs_lu->sdev_dev,
-				"%s: no region allocated\n",
-				__func__);
-			return NULL;
-		}
 		if (ufshpb_check_srgns_issue_state(hpb, rgn))
 			continue;
 

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

* [PATCH] scsi: ufs: fix itnull.cocci warnings
@ 2021-04-29 20:53 Julia Lawall
  0 siblings, 0 replies; 5+ messages in thread
From: Julia Lawall @ 2021-04-29 20:53 UTC (permalink / raw)
  To: kbuild-all

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

From: kernel test robot <lkp@intel.com>

The entry should not be NULL, so drop the NULL test.

Generated by: scripts/coccinelle/iterators/itnull.cocci

CC: Daejun Park <daejun7.park@samsung.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
---

url:    https://github.com/0day-ci/linux/commits/Daejun-Park/scsi-ufs-Introduce-HPB-feature/20210428-155927
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
:::::: branch date: 18 hours ago
:::::: commit date: 18 hours ago

 ufshpb.c |    6 ------
 1 file changed, 6 deletions(-)

--- a/drivers/scsi/ufs/ufshpb.c
+++ b/drivers/scsi/ufs/ufshpb.c
@@ -403,12 +403,6 @@ static struct ufshpb_region *ufshpb_vict
 	struct ufshpb_region *rgn, *victim_rgn = NULL;

 	list_for_each_entry(rgn, &lru_info->lh_lru_rgn, list_lru_rgn) {
-		if (!rgn) {
-			dev_err(&hpb->sdev_ufs_lu->sdev_dev,
-				"%s: no region allocated\n",
-				__func__);
-			return NULL;
-		}
 		if (ufshpb_check_srgns_issue_state(hpb, rgn))
 			continue;

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

* [PATCH] scsi: ufs: fix itnull.cocci warnings
  2021-04-29  2:21 [PATCH v33 2/4] scsi: ufs: L2P map management for HPB read kernel test robot
@ 2021-04-29  2:21 ` kernel test robot
  0 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2021-04-29  2:21 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
In-Reply-To: <20210428075716epcms2p2b2f54411913a85d40735e061434ffaf5@epcms2p2>
References: <20210428075716epcms2p2b2f54411913a85d40735e061434ffaf5@epcms2p2>
TO: Daejun Park <daejun7.park@samsung.com>
TO: Daejun Park <daejun7.park@samsung.com>
TO: Greg KH <greg@kroah.com>
TO: "avri.altman" <avri.altman@wdc.com>
TO: jejb <jejb@linux.ibm.com>
TO: "martin.petersen" <martin.petersen@oracle.com>
TO: asutoshd <asutoshd@codeaurora.org>
TO: "stanley.chu" <stanley.chu@mediatek.com>
TO: cang <cang@codeaurora.org>
TO: bvanassche <bvanassche@acm.org>
TO: huobean <huobean@gmail.com>

From: kernel test robot <lkp@intel.com>

drivers/scsi/ufs/ufshpb.c:406:7-10: ERROR: iterator variable bound on line 405 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

CC: Daejun Park <daejun7.park@samsung.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

url:    https://github.com/0day-ci/linux/commits/Daejun-Park/scsi-ufs-Introduce-HPB-feature/20210428-155927
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
:::::: branch date: 18 hours ago
:::::: commit date: 18 hours ago

Please take the patch only if it's a positive warning. Thanks!

 ufshpb.c |    6 ------
 1 file changed, 6 deletions(-)

--- a/drivers/scsi/ufs/ufshpb.c
+++ b/drivers/scsi/ufs/ufshpb.c
@@ -403,12 +403,6 @@ static struct ufshpb_region *ufshpb_vict
 	struct ufshpb_region *rgn, *victim_rgn = NULL;
 
 	list_for_each_entry(rgn, &lru_info->lh_lru_rgn, list_lru_rgn) {
-		if (!rgn) {
-			dev_err(&hpb->sdev_ufs_lu->sdev_dev,
-				"%s: no region allocated\n",
-				__func__);
-			return NULL;
-		}
 		if (ufshpb_check_srgns_issue_state(hpb, rgn))
 			continue;
 

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

end of thread, other threads:[~2022-03-26  8:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-26  8:35 [PATCH] scsi: ufs: fix itnull.cocci warnings Julia Lawall
2022-03-26  8:35 ` Julia Lawall
  -- strict thread matches above, loose matches on Subject: below --
2022-03-24 11:50 [bvanassche:ufs-for-next 324/324] drivers/scsi/ufs-core/ufshpb.c:878:7-10: ERROR: iterator variable bound on line 877 cannot be NULL kernel test robot
2022-03-24 11:42 ` [PATCH] scsi: ufs: fix itnull.cocci warnings kernel test robot
2021-04-29 20:53 Julia Lawall
2021-04-29  2:21 [PATCH v33 2/4] scsi: ufs: L2P map management for HPB read kernel test robot
2021-04-29  2:21 ` [PATCH] scsi: ufs: fix itnull.cocci warnings kernel test robot

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.