mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
w1: w1_therm: use swap() to make code cleaner
Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid opencoding it. Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: David Yang <davidcomponentone@gmail.com> Signed-off-by: Yang Guang <yang.guang5@zte.com.cn> Link: https://lore.kernel.org/r/cb14f9e6e86cf8494ed2ddce6eec8ebd988908d9.1640077704.git.yang.guang5@zte.com.cn Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
c95cc0d957
commit
e233897b1f
1 changed files with 3 additions and 4 deletions
|
@ -1785,7 +1785,7 @@ static ssize_t alarms_store(struct device *device,
|
||||||
u8 new_config_register[3]; /* array of data to be written */
|
u8 new_config_register[3]; /* array of data to be written */
|
||||||
int temp, ret;
|
int temp, ret;
|
||||||
char *token = NULL;
|
char *token = NULL;
|
||||||
s8 tl, th, tt; /* 1 byte per value + temp ring order */
|
s8 tl, th; /* 1 byte per value + temp ring order */
|
||||||
char *p_args, *orig;
|
char *p_args, *orig;
|
||||||
|
|
||||||
p_args = orig = kmalloc(size, GFP_KERNEL);
|
p_args = orig = kmalloc(size, GFP_KERNEL);
|
||||||
|
@ -1836,9 +1836,8 @@ static ssize_t alarms_store(struct device *device,
|
||||||
th = int_to_short(temp);
|
th = int_to_short(temp);
|
||||||
|
|
||||||
/* Reorder if required th and tl */
|
/* Reorder if required th and tl */
|
||||||
if (tl > th) {
|
if (tl > th)
|
||||||
tt = tl; tl = th; th = tt;
|
swap(tl, th);
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Read the scratchpad to change only the required bits
|
* Read the scratchpad to change only the required bits
|
||||||
|
|
Loading…
Add table
Reference in a new issue