linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next v2] usb: gadget: function: printer: use list_move instead of list_del/list_add
@ 2021-06-09  7:06 Baokun Li
  0 siblings, 0 replies; only message in thread
From: Baokun Li @ 2021-06-09  7:06 UTC (permalink / raw)
  To: linux-kernel, Felipe Balbi, Greg Kroah-Hartman, Zqiang,
	Wei Ming Chen, Gustavo A. R. Silva, Michael R Sweet
  Cc: weiyongjun1, yuehaibing, yangjihong1, yukuai3, libaokun1,
	linux-usb, kernel-janitors, Hulk Robot

Using list_move() instead of list_del() + list_add().

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Baokun Li <libaokun1@huawei.com>
---
V1->V2:
	CC mailist

 drivers/usb/gadget/function/f_printer.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/function/f_printer.c b/drivers/usb/gadget/function/f_printer.c
index f47fdc1fa7f1..b5112f6974f2 100644
--- a/drivers/usb/gadget/function/f_printer.c
+++ b/drivers/usb/gadget/function/f_printer.c
@@ -667,8 +667,7 @@ printer_write(struct file *fd, const char __user *buf, size_t len, loff_t *ptr)
 		value = usb_ep_queue(dev->in_ep, req, GFP_ATOMIC);
 		spin_lock(&dev->lock);
 		if (value) {
-			list_del(&req->list);
-			list_add(&req->list, &dev->tx_reqs);
+			list_move(&req->list, &dev->tx_reqs);
 			spin_unlock_irqrestore(&dev->lock, flags);
 			mutex_unlock(&dev->lock_printer_io);
 			return -EAGAIN;


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

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

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-09  7:06 [PATCH -next v2] usb: gadget: function: printer: use list_move instead of list_del/list_add Baokun Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).