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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux