mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH -next] scsi: esas2r: esas2r_int: Convert list_for_each to entry variant
@ 2021-06-15  6:57 Zou Wei
  0 siblings, 0 replies; only message in thread
From: Zou Wei @ 2021-06-15  6:57 UTC (permalink / raw)
  To: linuxdrivers, jejb, martin.petersen; +Cc: linux-scsi, linux-kernel, Zou Wei

convert list_for_each() to list_for_each_entry() where
applicable.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zou Wei <zou_wei@huawei.com>
---
 drivers/scsi/esas2r/esas2r_int.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/scsi/esas2r/esas2r_int.c b/drivers/scsi/esas2r/esas2r_int.c
index 5281d93..584c7c3 100644
--- a/drivers/scsi/esas2r/esas2r_int.c
+++ b/drivers/scsi/esas2r/esas2r_int.c
@@ -392,7 +392,6 @@ void esas2r_process_adapter_reset(struct esas2r_adapter *a)
 	struct esas2r_disc_context *dc;
 
 	LIST_HEAD(comp_list);
-	struct list_head *element;
 
 	esas2r_trace_enter();
 
@@ -429,9 +428,7 @@ void esas2r_process_adapter_reset(struct esas2r_adapter *a)
 	set_bit(AF_COMM_LIST_TOGGLE, &a->flags);
 
 	/* Kill all the requests on the active list */
-	list_for_each(element, &a->defer_list) {
-		rq = list_entry(element, struct esas2r_request, req_list);
-
+	list_for_each_entry(rq, &a->defer_list, req_list) {
 		if (rq->req_stat == RS_STARTED)
 			if (esas2r_ioreq_aborted(a, rq, RS_ABORTED))
 				list_add_tail(&rq->comp_list, &comp_list);
@@ -446,7 +443,6 @@ void esas2r_process_adapter_reset(struct esas2r_adapter *a)
 static void esas2r_process_bus_reset(struct esas2r_adapter *a)
 {
 	struct esas2r_request *rq;
-	struct list_head *element;
 	unsigned long flags;
 
 	LIST_HEAD(comp_list);
@@ -458,8 +454,7 @@ static void esas2r_process_bus_reset(struct esas2r_adapter *a)
 	spin_lock_irqsave(&a->queue_lock, flags);
 
 	/* kill all the requests on the deferred queue */
-	list_for_each(element, &a->defer_list) {
-		rq = list_entry(element, struct esas2r_request, req_list);
+	list_for_each_entry(rq, &a->defer_list, req_list) {
 		if (esas2r_ioreq_aborted(a, rq, RS_ABORTED))
 			list_add_tail(&rq->comp_list, &comp_list);
 	}
-- 
2.6.2


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-15  6:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-15  6:57 [PATCH -next] scsi: esas2r: esas2r_int: Convert list_for_each to entry variant Zou Wei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®