All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: arm: list_for_each() -> list_for_each_entry()
@ 2020-02-23  5:42 ` qiwuchen55
  0 siblings, 0 replies; 5+ messages in thread
From: qiwuchen55 @ 2020-02-23  5:42 UTC (permalink / raw)
  To: linux, jejb, martin.petersen; +Cc: linux-arm-kernel, linux-scsi, chenqiwu

From: chenqiwu <chenqiwu@xiaomi.com>

Use list_for_each_entry() instead of list_for_each() to
simplify code.

Signed-off-by: chenqiwu <chenqiwu@xiaomi.com>
---
 drivers/scsi/arm/queue.c | 25 ++++++++++---------------
 1 file changed, 10 insertions(+), 15 deletions(-)

diff --git a/drivers/scsi/arm/queue.c b/drivers/scsi/arm/queue.c
index e5559f2..da39597 100644
--- a/drivers/scsi/arm/queue.c
+++ b/drivers/scsi/arm/queue.c
@@ -158,12 +158,11 @@ static struct scsi_cmnd *__queue_remove(Queue_t *queue, struct list_head *ent)
 struct scsi_cmnd *queue_remove_exclude(Queue_t *queue, unsigned long *exclude)
 {
 	unsigned long flags;
-	struct list_head *l;
+	QE_t *q;
 	struct scsi_cmnd *SCpnt = NULL;
 
 	spin_lock_irqsave(&queue->queue_lock, flags);
-	list_for_each(l, &queue->head) {
-		QE_t *q = list_entry(l, QE_t, list);
+	list_for_each_entry(q, &queue->head, list) {
 		if (!test_bit(q->SCpnt->device->id * 8 +
 			      (u8)(q->SCpnt->device->lun & 0x7), exclude)) {
 			SCpnt = __queue_remove(queue, l);
@@ -207,12 +206,11 @@ struct scsi_cmnd *queue_remove_tgtluntag(Queue_t *queue, int target, int lun,
 					 int tag)
 {
 	unsigned long flags;
-	struct list_head *l;
+	QE_t *q;
 	struct scsi_cmnd *SCpnt = NULL;
 
 	spin_lock_irqsave(&queue->queue_lock, flags);
-	list_for_each(l, &queue->head) {
-		QE_t *q = list_entry(l, QE_t, list);
+	list_for_each_entry(q, &queue->head, list) {
 		if (q->SCpnt->device->id == target && q->SCpnt->device->lun == lun &&
 		    q->SCpnt->tag == tag) {
 			SCpnt = __queue_remove(queue, l);
@@ -234,11 +232,10 @@ struct scsi_cmnd *queue_remove_tgtluntag(Queue_t *queue, int target, int lun,
 void queue_remove_all_target(Queue_t *queue, int target)
 {
 	unsigned long flags;
-	struct list_head *l;
+	QE_t *q;
 
 	spin_lock_irqsave(&queue->queue_lock, flags);
-	list_for_each(l, &queue->head) {
-		QE_t *q = list_entry(l, QE_t, list);
+	list_for_each_entry(q, &queue->head, list) {
 		if (q->SCpnt->device->id == target)
 			__queue_remove(queue, l);
 	}
@@ -257,12 +254,11 @@ void queue_remove_all_target(Queue_t *queue, int target)
 int queue_probetgtlun (Queue_t *queue, int target, int lun)
 {
 	unsigned long flags;
-	struct list_head *l;
+	QE_t *q;
 	int found = 0;
 
 	spin_lock_irqsave(&queue->queue_lock, flags);
-	list_for_each(l, &queue->head) {
-		QE_t *q = list_entry(l, QE_t, list);
+	list_for_each_entry(q, &queue->head, list) {
 		if (q->SCpnt->device->id == target && q->SCpnt->device->lun == lun) {
 			found = 1;
 			break;
@@ -283,12 +279,11 @@ int queue_probetgtlun (Queue_t *queue, int target, int lun)
 int queue_remove_cmd(Queue_t *queue, struct scsi_cmnd *SCpnt)
 {
 	unsigned long flags;
-	struct list_head *l;
+	QE_t *q;
 	int found = 0;
 
 	spin_lock_irqsave(&queue->queue_lock, flags);
-	list_for_each(l, &queue->head) {
-		QE_t *q = list_entry(l, QE_t, list);
+	list_for_each_entry(q, &queue->head, list) {
 		if (q->SCpnt == SCpnt) {
 			__queue_remove(queue, l);
 			found = 1;
-- 
1.9.1


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

* [PATCH] scsi: arm: list_for_each() -> list_for_each_entry()
@ 2020-02-23  5:42 ` qiwuchen55
  0 siblings, 0 replies; 5+ messages in thread
From: qiwuchen55 @ 2020-02-23  5:42 UTC (permalink / raw)
  To: linux, jejb, martin.petersen; +Cc: chenqiwu, linux-scsi, linux-arm-kernel

From: chenqiwu <chenqiwu@xiaomi.com>

Use list_for_each_entry() instead of list_for_each() to
simplify code.

Signed-off-by: chenqiwu <chenqiwu@xiaomi.com>
---
 drivers/scsi/arm/queue.c | 25 ++++++++++---------------
 1 file changed, 10 insertions(+), 15 deletions(-)

diff --git a/drivers/scsi/arm/queue.c b/drivers/scsi/arm/queue.c
index e5559f2..da39597 100644
--- a/drivers/scsi/arm/queue.c
+++ b/drivers/scsi/arm/queue.c
@@ -158,12 +158,11 @@ static struct scsi_cmnd *__queue_remove(Queue_t *queue, struct list_head *ent)
 struct scsi_cmnd *queue_remove_exclude(Queue_t *queue, unsigned long *exclude)
 {
 	unsigned long flags;
-	struct list_head *l;
+	QE_t *q;
 	struct scsi_cmnd *SCpnt = NULL;
 
 	spin_lock_irqsave(&queue->queue_lock, flags);
-	list_for_each(l, &queue->head) {
-		QE_t *q = list_entry(l, QE_t, list);
+	list_for_each_entry(q, &queue->head, list) {
 		if (!test_bit(q->SCpnt->device->id * 8 +
 			      (u8)(q->SCpnt->device->lun & 0x7), exclude)) {
 			SCpnt = __queue_remove(queue, l);
@@ -207,12 +206,11 @@ struct scsi_cmnd *queue_remove_tgtluntag(Queue_t *queue, int target, int lun,
 					 int tag)
 {
 	unsigned long flags;
-	struct list_head *l;
+	QE_t *q;
 	struct scsi_cmnd *SCpnt = NULL;
 
 	spin_lock_irqsave(&queue->queue_lock, flags);
-	list_for_each(l, &queue->head) {
-		QE_t *q = list_entry(l, QE_t, list);
+	list_for_each_entry(q, &queue->head, list) {
 		if (q->SCpnt->device->id == target && q->SCpnt->device->lun == lun &&
 		    q->SCpnt->tag == tag) {
 			SCpnt = __queue_remove(queue, l);
@@ -234,11 +232,10 @@ struct scsi_cmnd *queue_remove_tgtluntag(Queue_t *queue, int target, int lun,
 void queue_remove_all_target(Queue_t *queue, int target)
 {
 	unsigned long flags;
-	struct list_head *l;
+	QE_t *q;
 
 	spin_lock_irqsave(&queue->queue_lock, flags);
-	list_for_each(l, &queue->head) {
-		QE_t *q = list_entry(l, QE_t, list);
+	list_for_each_entry(q, &queue->head, list) {
 		if (q->SCpnt->device->id == target)
 			__queue_remove(queue, l);
 	}
@@ -257,12 +254,11 @@ void queue_remove_all_target(Queue_t *queue, int target)
 int queue_probetgtlun (Queue_t *queue, int target, int lun)
 {
 	unsigned long flags;
-	struct list_head *l;
+	QE_t *q;
 	int found = 0;
 
 	spin_lock_irqsave(&queue->queue_lock, flags);
-	list_for_each(l, &queue->head) {
-		QE_t *q = list_entry(l, QE_t, list);
+	list_for_each_entry(q, &queue->head, list) {
 		if (q->SCpnt->device->id == target && q->SCpnt->device->lun == lun) {
 			found = 1;
 			break;
@@ -283,12 +279,11 @@ int queue_probetgtlun (Queue_t *queue, int target, int lun)
 int queue_remove_cmd(Queue_t *queue, struct scsi_cmnd *SCpnt)
 {
 	unsigned long flags;
-	struct list_head *l;
+	QE_t *q;
 	int found = 0;
 
 	spin_lock_irqsave(&queue->queue_lock, flags);
-	list_for_each(l, &queue->head) {
-		QE_t *q = list_entry(l, QE_t, list);
+	list_for_each_entry(q, &queue->head, list) {
 		if (q->SCpnt == SCpnt) {
 			__queue_remove(queue, l);
 			found = 1;
-- 
1.9.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] scsi: arm: list_for_each() -> list_for_each_entry()
  2020-02-23  5:42 ` qiwuchen55
  (?)
@ 2020-02-24  2:53   ` kbuild test robot
  -1 siblings, 0 replies; 5+ messages in thread
From: kbuild test robot @ 2020-02-24  2:53 UTC (permalink / raw)
  To: qiwuchen55
  Cc: kbuild-all, linux, jejb, martin.petersen, linux-arm-kernel,
	linux-scsi, chenqiwu

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

Hi,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on mkp-scsi/for-next]
[also build test ERROR on scsi/for-next v5.6-rc2 next-20200221]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/qiwuchen55-gmail-com/scsi-arm-list_for_each-list_for_each_entry/20200223-140506
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
config: arm-rpc_defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 7.5.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.5.0 make.cross ARCH=arm 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/scsi/arm/queue.c: In function 'queue_remove_exclude':
>> drivers/scsi/arm/queue.c:168:34: error: 'l' undeclared (first use in this function)
       SCpnt = __queue_remove(queue, l);
                                     ^
   drivers/scsi/arm/queue.c:168:34: note: each undeclared identifier is reported only once for each function it appears in
   drivers/scsi/arm/queue.c: In function 'queue_remove_tgtluntag':
   drivers/scsi/arm/queue.c:216:34: error: 'l' undeclared (first use in this function)
       SCpnt = __queue_remove(queue, l);
                                     ^
   drivers/scsi/arm/queue.c: In function 'queue_remove_all_target':
   drivers/scsi/arm/queue.c:240:26: error: 'l' undeclared (first use in this function)
       __queue_remove(queue, l);
                             ^
   drivers/scsi/arm/queue.c: In function 'queue_remove_cmd':
   drivers/scsi/arm/queue.c:288:26: error: 'l' undeclared (first use in this function)
       __queue_remove(queue, l);
                             ^

vim +/l +168 drivers/scsi/arm/queue.c

^1da177e4c3f41 Linus Torvalds     2005-04-16  150  
^1da177e4c3f41 Linus Torvalds     2005-04-16  151  /*
ee0ca6bab394fe Henrik Kretzschmar 2006-10-01  152   * Function: struct scsi_cmnd *queue_remove_exclude (queue, exclude)
^1da177e4c3f41 Linus Torvalds     2005-04-16  153   * Purpose : remove a SCSI command from a queue
^1da177e4c3f41 Linus Torvalds     2005-04-16  154   * Params  : queue   - queue to remove command from
^1da177e4c3f41 Linus Torvalds     2005-04-16  155   *	     exclude - bit array of target&lun which is busy
ee0ca6bab394fe Henrik Kretzschmar 2006-10-01  156   * Returns : struct scsi_cmnd if successful (and a reference), or NULL if no command available
^1da177e4c3f41 Linus Torvalds     2005-04-16  157   */
ee0ca6bab394fe Henrik Kretzschmar 2006-10-01  158  struct scsi_cmnd *queue_remove_exclude(Queue_t *queue, unsigned long *exclude)
^1da177e4c3f41 Linus Torvalds     2005-04-16  159  {
^1da177e4c3f41 Linus Torvalds     2005-04-16  160  	unsigned long flags;
a88583c893a94c chenqiwu           2020-02-23  161  	QE_t *q;
ee0ca6bab394fe Henrik Kretzschmar 2006-10-01  162  	struct scsi_cmnd *SCpnt = NULL;
^1da177e4c3f41 Linus Torvalds     2005-04-16  163  
^1da177e4c3f41 Linus Torvalds     2005-04-16  164  	spin_lock_irqsave(&queue->queue_lock, flags);
a88583c893a94c chenqiwu           2020-02-23  165  	list_for_each_entry(q, &queue->head, list) {
9cb78c16f5dade Hannes Reinecke    2014-06-25  166  		if (!test_bit(q->SCpnt->device->id * 8 +
9cb78c16f5dade Hannes Reinecke    2014-06-25  167  			      (u8)(q->SCpnt->device->lun & 0x7), exclude)) {
^1da177e4c3f41 Linus Torvalds     2005-04-16 @168  			SCpnt = __queue_remove(queue, l);
^1da177e4c3f41 Linus Torvalds     2005-04-16  169  			break;
^1da177e4c3f41 Linus Torvalds     2005-04-16  170  		}
^1da177e4c3f41 Linus Torvalds     2005-04-16  171  	}
^1da177e4c3f41 Linus Torvalds     2005-04-16  172  	spin_unlock_irqrestore(&queue->queue_lock, flags);
^1da177e4c3f41 Linus Torvalds     2005-04-16  173  
^1da177e4c3f41 Linus Torvalds     2005-04-16  174  	return SCpnt;
^1da177e4c3f41 Linus Torvalds     2005-04-16  175  }
^1da177e4c3f41 Linus Torvalds     2005-04-16  176  

:::::: The code at line 168 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 14175 bytes --]

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

* Re: [PATCH] scsi: arm: list_for_each() -> list_for_each_entry()
@ 2020-02-24  2:53   ` kbuild test robot
  0 siblings, 0 replies; 5+ messages in thread
From: kbuild test robot @ 2020-02-24  2:53 UTC (permalink / raw)
  To: qiwuchen55
  Cc: kbuild-all, linux-scsi, martin.petersen, jejb, linux, chenqiwu,
	linux-arm-kernel

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

Hi,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on mkp-scsi/for-next]
[also build test ERROR on scsi/for-next v5.6-rc2 next-20200221]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/qiwuchen55-gmail-com/scsi-arm-list_for_each-list_for_each_entry/20200223-140506
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
config: arm-rpc_defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 7.5.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.5.0 make.cross ARCH=arm 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/scsi/arm/queue.c: In function 'queue_remove_exclude':
>> drivers/scsi/arm/queue.c:168:34: error: 'l' undeclared (first use in this function)
       SCpnt = __queue_remove(queue, l);
                                     ^
   drivers/scsi/arm/queue.c:168:34: note: each undeclared identifier is reported only once for each function it appears in
   drivers/scsi/arm/queue.c: In function 'queue_remove_tgtluntag':
   drivers/scsi/arm/queue.c:216:34: error: 'l' undeclared (first use in this function)
       SCpnt = __queue_remove(queue, l);
                                     ^
   drivers/scsi/arm/queue.c: In function 'queue_remove_all_target':
   drivers/scsi/arm/queue.c:240:26: error: 'l' undeclared (first use in this function)
       __queue_remove(queue, l);
                             ^
   drivers/scsi/arm/queue.c: In function 'queue_remove_cmd':
   drivers/scsi/arm/queue.c:288:26: error: 'l' undeclared (first use in this function)
       __queue_remove(queue, l);
                             ^

vim +/l +168 drivers/scsi/arm/queue.c

^1da177e4c3f41 Linus Torvalds     2005-04-16  150  
^1da177e4c3f41 Linus Torvalds     2005-04-16  151  /*
ee0ca6bab394fe Henrik Kretzschmar 2006-10-01  152   * Function: struct scsi_cmnd *queue_remove_exclude (queue, exclude)
^1da177e4c3f41 Linus Torvalds     2005-04-16  153   * Purpose : remove a SCSI command from a queue
^1da177e4c3f41 Linus Torvalds     2005-04-16  154   * Params  : queue   - queue to remove command from
^1da177e4c3f41 Linus Torvalds     2005-04-16  155   *	     exclude - bit array of target&lun which is busy
ee0ca6bab394fe Henrik Kretzschmar 2006-10-01  156   * Returns : struct scsi_cmnd if successful (and a reference), or NULL if no command available
^1da177e4c3f41 Linus Torvalds     2005-04-16  157   */
ee0ca6bab394fe Henrik Kretzschmar 2006-10-01  158  struct scsi_cmnd *queue_remove_exclude(Queue_t *queue, unsigned long *exclude)
^1da177e4c3f41 Linus Torvalds     2005-04-16  159  {
^1da177e4c3f41 Linus Torvalds     2005-04-16  160  	unsigned long flags;
a88583c893a94c chenqiwu           2020-02-23  161  	QE_t *q;
ee0ca6bab394fe Henrik Kretzschmar 2006-10-01  162  	struct scsi_cmnd *SCpnt = NULL;
^1da177e4c3f41 Linus Torvalds     2005-04-16  163  
^1da177e4c3f41 Linus Torvalds     2005-04-16  164  	spin_lock_irqsave(&queue->queue_lock, flags);
a88583c893a94c chenqiwu           2020-02-23  165  	list_for_each_entry(q, &queue->head, list) {
9cb78c16f5dade Hannes Reinecke    2014-06-25  166  		if (!test_bit(q->SCpnt->device->id * 8 +
9cb78c16f5dade Hannes Reinecke    2014-06-25  167  			      (u8)(q->SCpnt->device->lun & 0x7), exclude)) {
^1da177e4c3f41 Linus Torvalds     2005-04-16 @168  			SCpnt = __queue_remove(queue, l);
^1da177e4c3f41 Linus Torvalds     2005-04-16  169  			break;
^1da177e4c3f41 Linus Torvalds     2005-04-16  170  		}
^1da177e4c3f41 Linus Torvalds     2005-04-16  171  	}
^1da177e4c3f41 Linus Torvalds     2005-04-16  172  	spin_unlock_irqrestore(&queue->queue_lock, flags);
^1da177e4c3f41 Linus Torvalds     2005-04-16  173  
^1da177e4c3f41 Linus Torvalds     2005-04-16  174  	return SCpnt;
^1da177e4c3f41 Linus Torvalds     2005-04-16  175  }
^1da177e4c3f41 Linus Torvalds     2005-04-16  176  

:::::: The code at line 168 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 14175 bytes --]

[-- Attachment #3: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] scsi: arm: list_for_each() -> list_for_each_entry()
@ 2020-02-24  2:53   ` kbuild test robot
  0 siblings, 0 replies; 5+ messages in thread
From: kbuild test robot @ 2020-02-24  2:53 UTC (permalink / raw)
  To: kbuild-all

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

Hi,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on mkp-scsi/for-next]
[also build test ERROR on scsi/for-next v5.6-rc2 next-20200221]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/qiwuchen55-gmail-com/scsi-arm-list_for_each-list_for_each_entry/20200223-140506
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
config: arm-rpc_defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 7.5.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.5.0 make.cross ARCH=arm 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/scsi/arm/queue.c: In function 'queue_remove_exclude':
>> drivers/scsi/arm/queue.c:168:34: error: 'l' undeclared (first use in this function)
       SCpnt = __queue_remove(queue, l);
                                     ^
   drivers/scsi/arm/queue.c:168:34: note: each undeclared identifier is reported only once for each function it appears in
   drivers/scsi/arm/queue.c: In function 'queue_remove_tgtluntag':
   drivers/scsi/arm/queue.c:216:34: error: 'l' undeclared (first use in this function)
       SCpnt = __queue_remove(queue, l);
                                     ^
   drivers/scsi/arm/queue.c: In function 'queue_remove_all_target':
   drivers/scsi/arm/queue.c:240:26: error: 'l' undeclared (first use in this function)
       __queue_remove(queue, l);
                             ^
   drivers/scsi/arm/queue.c: In function 'queue_remove_cmd':
   drivers/scsi/arm/queue.c:288:26: error: 'l' undeclared (first use in this function)
       __queue_remove(queue, l);
                             ^

vim +/l +168 drivers/scsi/arm/queue.c

^1da177e4c3f41 Linus Torvalds     2005-04-16  150  
^1da177e4c3f41 Linus Torvalds     2005-04-16  151  /*
ee0ca6bab394fe Henrik Kretzschmar 2006-10-01  152   * Function: struct scsi_cmnd *queue_remove_exclude (queue, exclude)
^1da177e4c3f41 Linus Torvalds     2005-04-16  153   * Purpose : remove a SCSI command from a queue
^1da177e4c3f41 Linus Torvalds     2005-04-16  154   * Params  : queue   - queue to remove command from
^1da177e4c3f41 Linus Torvalds     2005-04-16  155   *	     exclude - bit array of target&lun which is busy
ee0ca6bab394fe Henrik Kretzschmar 2006-10-01  156   * Returns : struct scsi_cmnd if successful (and a reference), or NULL if no command available
^1da177e4c3f41 Linus Torvalds     2005-04-16  157   */
ee0ca6bab394fe Henrik Kretzschmar 2006-10-01  158  struct scsi_cmnd *queue_remove_exclude(Queue_t *queue, unsigned long *exclude)
^1da177e4c3f41 Linus Torvalds     2005-04-16  159  {
^1da177e4c3f41 Linus Torvalds     2005-04-16  160  	unsigned long flags;
a88583c893a94c chenqiwu           2020-02-23  161  	QE_t *q;
ee0ca6bab394fe Henrik Kretzschmar 2006-10-01  162  	struct scsi_cmnd *SCpnt = NULL;
^1da177e4c3f41 Linus Torvalds     2005-04-16  163  
^1da177e4c3f41 Linus Torvalds     2005-04-16  164  	spin_lock_irqsave(&queue->queue_lock, flags);
a88583c893a94c chenqiwu           2020-02-23  165  	list_for_each_entry(q, &queue->head, list) {
9cb78c16f5dade Hannes Reinecke    2014-06-25  166  		if (!test_bit(q->SCpnt->device->id * 8 +
9cb78c16f5dade Hannes Reinecke    2014-06-25  167  			      (u8)(q->SCpnt->device->lun & 0x7), exclude)) {
^1da177e4c3f41 Linus Torvalds     2005-04-16 @168  			SCpnt = __queue_remove(queue, l);
^1da177e4c3f41 Linus Torvalds     2005-04-16  169  			break;
^1da177e4c3f41 Linus Torvalds     2005-04-16  170  		}
^1da177e4c3f41 Linus Torvalds     2005-04-16  171  	}
^1da177e4c3f41 Linus Torvalds     2005-04-16  172  	spin_unlock_irqrestore(&queue->queue_lock, flags);
^1da177e4c3f41 Linus Torvalds     2005-04-16  173  
^1da177e4c3f41 Linus Torvalds     2005-04-16  174  	return SCpnt;
^1da177e4c3f41 Linus Torvalds     2005-04-16  175  }
^1da177e4c3f41 Linus Torvalds     2005-04-16  176  

:::::: The code at line 168 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 14175 bytes --]

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

end of thread, other threads:[~2020-02-24  2:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-23  5:42 [PATCH] scsi: arm: list_for_each() -> list_for_each_entry() qiwuchen55
2020-02-23  5:42 ` qiwuchen55
2020-02-24  2:53 ` kbuild test robot
2020-02-24  2:53   ` kbuild test robot
2020-02-24  2:53   ` kbuild 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.