lkml.org 
[lkml]   [2021]   [Nov]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [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

\
 
 \ /
  Last update: 2021-11-04 11:51    [W:0.030 / U:0.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site