|
Lee, Chun-Yi |
e17202 |
From: Guo Zhengkui <guozhengkui@vivo.com>
|
|
Lee, Chun-Yi |
e17202 |
Date: Tue, 9 Nov 2021 15:50:51 +0800
|
|
Lee, Chun-Yi |
e17202 |
Subject: ACPI: processor idle: Use swap() instead of open coding it
|
|
Lee, Chun-Yi |
e17202 |
Patch-mainline: v5.17-rc1
|
|
Lee, Chun-Yi |
e17202 |
Git-commit: 0e6078c3c6737df7d0bd0c890fbadf24a27fffbb
|
|
Lee, Chun-Yi |
e17202 |
References: jsc#PED-1408
|
|
Lee, Chun-Yi |
e17202 |
|
|
Lee, Chun-Yi |
e17202 |
Address the following coccicheck warning:
|
|
Lee, Chun-Yi |
e17202 |
|
|
Lee, Chun-Yi |
e17202 |
./drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c:914:40-41:
|
|
Lee, Chun-Yi |
e17202 |
WARNING opportunity for swap().
|
|
Lee, Chun-Yi |
e17202 |
|
|
Lee, Chun-Yi |
e17202 |
by using swap() for the swapping of variable values and drop
|
|
Lee, Chun-Yi |
e17202 |
the tmp variable that is not needed any more.
|
|
Lee, Chun-Yi |
e17202 |
|
|
Lee, Chun-Yi |
e17202 |
Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com>
|
|
Lee, Chun-Yi |
e17202 |
[ rjw: Subject and changelog rewrite ]
|
|
Lee, Chun-Yi |
e17202 |
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
|
|
Lee, Chun-Yi |
e17202 |
Acked-by: Lee, Chun-Yi <jlee@suse.com>
|
|
Lee, Chun-Yi |
e17202 |
---
|
|
Lee, Chun-Yi |
e17202 |
drivers/acpi/processor_idle.c | 6 ++----
|
|
Lee, Chun-Yi |
e17202 |
1 file changed, 2 insertions(+), 4 deletions(-)
|
|
Lee, Chun-Yi |
e17202 |
|
|
Lee, Chun-Yi |
e17202 |
--- a/drivers/acpi/processor_idle.c
|
|
Lee, Chun-Yi |
e17202 |
+++ b/drivers/acpi/processor_idle.c
|
|
Lee, Chun-Yi |
e17202 |
@@ -20,6 +20,7 @@
|
|
Lee, Chun-Yi |
e17202 |
#include <linux/tick.h>
|
|
Lee, Chun-Yi |
e17202 |
#include <linux/cpuidle.h>
|
|
Lee, Chun-Yi |
e17202 |
#include <linux/cpu.h>
|
|
Lee, Chun-Yi |
e17202 |
+#include <linux/minmax.h>
|
|
Lee, Chun-Yi |
e17202 |
#include <acpi/processor.h>
|
|
Lee, Chun-Yi |
e17202 |
|
|
Lee, Chun-Yi |
e17202 |
/*
|
|
Lee, Chun-Yi |
e17202 |
@@ -400,13 +401,10 @@ static int acpi_cst_latency_cmp(const vo
|
|
Lee, Chun-Yi |
e17202 |
static void acpi_cst_latency_swap(void *a, void *b, int n)
|
|
Lee, Chun-Yi |
e17202 |
{
|
|
Lee, Chun-Yi |
e17202 |
struct acpi_processor_cx *x = a, *y = b;
|
|
Lee, Chun-Yi |
e17202 |
- u32 tmp;
|
|
Lee, Chun-Yi |
e17202 |
|
|
Lee, Chun-Yi |
e17202 |
if (!(x->valid && y->valid))
|
|
Lee, Chun-Yi |
e17202 |
return;
|
|
Lee, Chun-Yi |
e17202 |
- tmp = x->latency;
|
|
Lee, Chun-Yi |
e17202 |
- x->latency = y->latency;
|
|
Lee, Chun-Yi |
e17202 |
- y->latency = tmp;
|
|
Lee, Chun-Yi |
e17202 |
+ swap(x->latency, y->latency);
|
|
Lee, Chun-Yi |
e17202 |
}
|
|
Lee, Chun-Yi |
e17202 |
|
|
Lee, Chun-Yi |
e17202 |
static int acpi_processor_power_verify(struct acpi_processor *pr)
|