Re: [PATCH] w1: w1_therm: use swap() to make code cleaner

From: Dan Carpenter
Date: Thu Nov 04 2021 - 07:09:44 EST


On Thu, Nov 04, 2021 at 09:11:23AM +0800, davidcomponentone@xxxxxxxxx wrote:
> From: Yang Guang <yang.guang5@xxxxxxxxxx>
>
> Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid
> opencoding it.
>
> Reported-by: Zeal Robot <zealci@xxxxxxxxxx>
> Signed-off-by: Yang Guang <yang.guang5@xxxxxxxxxx>
> ---

I'm confused by the signed-off-by list. Are you Yang Guang and David is
your "English name"? If so then this is fine, but if you are different
people then everyone who handles the patch needs to add their own
signed-off-by.


> @@ -1837,7 +1837,7 @@ static ssize_t alarms_store(struct device *device,
>
> /* Reorder if required th and tl */
> if (tl > th) {
> - tt = tl; tl = th; th = tt;
> + swap(tl, th);
> }

Remove the curly {} braces as well because they are no longer required.

regards,
dan carpenter