Messages in this thread | | | From | Andy Shevchenko <> | Date | Thu, 4 Nov 2021 12:50:30 +0200 | Subject | Re: [PATCH] USB: UDC: use swap() to make code cleaner |
| |
On Thu, Nov 4, 2021 at 3:14 AM <davidcomponentone@gmail.com> wrote:
> Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid > opencoding it.
Same comment as per all your valuable contributions: think about the code you are modifying a little bit more. Okay?
> 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);
Interestingly, why the previous paragraph was not detected by you as an opportunity to convert as well?
-- With Best Regards, Andy Shevchenko
| |