[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211104011245.1027675-1-yang.guang5@zte.com.cn>
Date: Thu, 4 Nov 2021 09:12:45 +0800
From: davidcomponentone@...il.com
To: balbi@...nel.org
Cc: davidcomponentone@...il.com, gregkh@...uxfoundation.org,
colin.king@...onical.com, stern@...land.harvard.edu,
yang.guang5@....com.cn, linux-usb@...r.kernel.org,
linux-kernel@...r.kernel.org, Zeal Robot <zealci@....com.cn>
Subject: [PATCH] USB: UDC: use swap() to make code cleaner
From: Yang Guang <yang.guang5@....com.cn>
Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid
opencoding it.
Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: Yang Guang <yang.guang5@....com.cn>
---
drivers/usb/gadget/udc/net2280.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/usb/gadget/udc/net2280.c b/drivers/usb/gadget/udc/net2280.c
index 16e7d2db6411..71e02bcebecd 100644
--- a/drivers/usb/gadget/udc/net2280.c
+++ b/drivers/usb/gadget/udc/net2280.c
@@ -933,16 +933,13 @@ static inline void
queue_dma(struct net2280_ep *ep, struct net2280_request *req, int valid)
{
struct net2280_dma *end;
- dma_addr_t tmp;
/* swap new dummy for old, link; fill and maybe activate */
end = ep->dummy;
ep->dummy = req->td;
req->td = end;
- tmp = ep->td_dma;
- ep->td_dma = req->td_dma;
- req->td_dma = tmp;
+ swap(ep->td_dma, req->td_dma);
end->dmadesc = cpu_to_le32 (ep->td_dma);
--
2.30.2
Powered by blists - more mailing lists