Re: [PATCH] USB: UDC: use swap() to make code cleaner

From: Andy Shevchenko
Date: Thu Nov 04 2021 - 06:51:22 EST


On Thu, Nov 4, 2021 at 3:14 AM <davidcomponentone@xxxxxxxxx> 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