diff mbox

[-next] HID: intel-ish-hid: use list_move_tail instead of list_del/list_add_tail

Message ID 1471793249-23714-1-git-send-email-weiyj.lk@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wei Yongjun Aug. 21, 2016, 3:27 p.m. UTC
From: Wei Yongjun <weiyongjun1@huawei.com>

Using list_move_tail() instead of list_del() + list_add_tail().

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/hid/intel-ish-hid/ipc/ipc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)




--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Srinivas Pandruvada Aug. 26, 2016, 7:04 p.m. UTC | #1
On Sun, 2016-08-21 at 15:27 +0000, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> Using list_move_tail() instead of list_del() + list_add_tail().
> 
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

> ---
>  drivers/hid/intel-ish-hid/ipc/ipc.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/hid/intel-ish-hid/ipc/ipc.c b/drivers/hid/intel-
> ish-hid/ipc/ipc.c
> index 851029b..e2517c1 100644
> --- a/drivers/hid/intel-ish-hid/ipc/ipc.c
> +++ b/drivers/hid/intel-ish-hid/ipc/ipc.c
> @@ -448,8 +448,7 @@ static int ish_fw_reset_handler(struct
> ishtp_device *dev)
>  	spin_lock_irqsave(&dev->wr_processing_spinlock, flags);
>  	list_for_each_entry_safe(processing, next,
>  			&dev->wr_processing_list_head.link, link) {
> -		list_del(&processing->link);
> -		list_add_tail(&processing->link, &dev-
> >wr_free_list_head.link);
> +		list_move_tail(&processing->link, &dev-
> >wr_free_list_head.link);
>  	}
>  	spin_unlock_irqrestore(&dev->wr_processing_spinlock, flags);
>  
> 
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/hid/intel-ish-hid/ipc/ipc.c b/drivers/hid/intel-ish-hid/ipc/ipc.c
index 851029b..e2517c1 100644
--- a/drivers/hid/intel-ish-hid/ipc/ipc.c
+++ b/drivers/hid/intel-ish-hid/ipc/ipc.c
@@ -448,8 +448,7 @@  static int ish_fw_reset_handler(struct ishtp_device *dev)
 	spin_lock_irqsave(&dev->wr_processing_spinlock, flags);
 	list_for_each_entry_safe(processing, next,
 			&dev->wr_processing_list_head.link, link) {
-		list_del(&processing->link);
-		list_add_tail(&processing->link, &dev->wr_free_list_head.link);
+		list_move_tail(&processing->link, &dev->wr_free_list_head.link);
 	}
 	spin_unlock_irqrestore(&dev->wr_processing_spinlock, flags);