mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-03 00:54:09 +08:00
ACPI: processor idle: Use swap() instead of open coding it
Address the following coccicheck warning: ./drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c:914:40-41: WARNING opportunity for swap(). by using swap() for the swapping of variable values and drop the tmp variable that is not needed any more. Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com> [ rjw: Subject and changelog rewrite ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
6fd13452c1
commit
0e6078c3c6
@ -20,6 +20,7 @@
|
|||||||
#include <linux/tick.h>
|
#include <linux/tick.h>
|
||||||
#include <linux/cpuidle.h>
|
#include <linux/cpuidle.h>
|
||||||
#include <linux/cpu.h>
|
#include <linux/cpu.h>
|
||||||
|
#include <linux/minmax.h>
|
||||||
#include <acpi/processor.h>
|
#include <acpi/processor.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -400,13 +401,10 @@ static int acpi_cst_latency_cmp(const void *a, const void *b)
|
|||||||
static void acpi_cst_latency_swap(void *a, void *b, int n)
|
static void acpi_cst_latency_swap(void *a, void *b, int n)
|
||||||
{
|
{
|
||||||
struct acpi_processor_cx *x = a, *y = b;
|
struct acpi_processor_cx *x = a, *y = b;
|
||||||
u32 tmp;
|
|
||||||
|
|
||||||
if (!(x->valid && y->valid))
|
if (!(x->valid && y->valid))
|
||||||
return;
|
return;
|
||||||
tmp = x->latency;
|
swap(x->latency, y->latency);
|
||||||
x->latency = y->latency;
|
|
||||||
y->latency = tmp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int acpi_processor_power_verify(struct acpi_processor *pr)
|
static int acpi_processor_power_verify(struct acpi_processor *pr)
|
||||||
|
Loading…
Reference in New Issue
Block a user