* [PATCH] ACPICA: fix swap.cocci warning
@ 2021-11-09 13:47 Guo Zhengkui
2021-11-18 14:46 ` [Devel] " Rafael J. Wysocki
[not found] ` <AIwACwDlE6oYbcAnsFaroKpJ.9.1637246783998.Hmail.guozhengkui@vivo.com.@PENBSlo1djBpeHR2ek5pQXd3THRYWGdHLThGZHZ0V1l5N1JVaDBwRno2NXNqY215dU5kUUBtYWlsLmdtYWlsLmNvbT4=>
0 siblings, 2 replies; 6+ messages in thread
From: Guo Zhengkui @ 2021-11-09 13:47 UTC (permalink / raw)
To: Robert Moore, Rafael J. Wysocki, Len Brown, linux-acpi, devel,
linux-kernel
Cc: kernel, Guo Zhengkui
Fix following swap.cocci warning:
./drivers/acpi/acpica/nsrepair2.c:896:33-34: WARNING
opportunity for swap()
Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com>
---
drivers/acpi/acpica/nsrepair2.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/acpi/acpica/nsrepair2.c b/drivers/acpi/acpica/nsrepair2.c
index 14b71b41e845..02a904ca4caf 100644
--- a/drivers/acpi/acpica/nsrepair2.c
+++ b/drivers/acpi/acpica/nsrepair2.c
@@ -8,6 +8,7 @@
*
*****************************************************************************/
+#include <linux/minmax.h>
#include <acpi/acpi.h>
#include "accommon.h"
#include "acnamesp.h"
@@ -875,7 +876,6 @@ acpi_ns_sort_list(union acpi_operand_object **elements,
{
union acpi_operand_object *obj_desc1;
union acpi_operand_object *obj_desc2;
- union acpi_operand_object *temp_obj;
u32 i;
u32 j;
@@ -892,9 +892,7 @@ acpi_ns_sort_list(union acpi_operand_object **elements,
|| ((sort_direction == ACPI_SORT_DESCENDING)
&& (obj_desc1->integer.value <
obj_desc2->integer.value))) {
- temp_obj = elements[j - 1];
- elements[j - 1] = elements[j];
- elements[j] = temp_obj;
+ swap(elements[j - 1], elements[j]);
}
}
}
--
2.20.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] ACPICA: fix swap.cocci warning
@ 2021-11-18 14:46 ` Rafael J. Wysocki
0 siblings, 0 replies; 6+ messages in thread
From: Rafael J. Wysocki @ 2021-11-18 14:46 UTC (permalink / raw)
To: Guo Zhengkui
Cc: Robert Moore, Rafael J. Wysocki, Len Brown,
ACPI Devel Maling List,
open list:ACPI COMPONENT ARCHITECTURE (ACPICA),
Linux Kernel Mailing List, kernel
On Tue, Nov 9, 2021 at 2:47 PM Guo Zhengkui <guozhengkui@vivo.com> wrote:
>
> Fix following swap.cocci warning:
> ./drivers/acpi/acpica/nsrepair2.c:896:33-34: WARNING
> opportunity for swap()
>
> Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com>
This change needs to be submitted to the upstream ACPICA project via
https://github.com/acpica/acpica/
Thanks!
> ---
> drivers/acpi/acpica/nsrepair2.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/acpi/acpica/nsrepair2.c b/drivers/acpi/acpica/nsrepair2.c
> index 14b71b41e845..02a904ca4caf 100644
> --- a/drivers/acpi/acpica/nsrepair2.c
> +++ b/drivers/acpi/acpica/nsrepair2.c
> @@ -8,6 +8,7 @@
> *
> *****************************************************************************/
>
> +#include <linux/minmax.h>
> #include <acpi/acpi.h>
> #include "accommon.h"
> #include "acnamesp.h"
> @@ -875,7 +876,6 @@ acpi_ns_sort_list(union acpi_operand_object **elements,
> {
> union acpi_operand_object *obj_desc1;
> union acpi_operand_object *obj_desc2;
> - union acpi_operand_object *temp_obj;
> u32 i;
> u32 j;
>
> @@ -892,9 +892,7 @@ acpi_ns_sort_list(union acpi_operand_object **elements,
> || ((sort_direction == ACPI_SORT_DESCENDING)
> && (obj_desc1->integer.value <
> obj_desc2->integer.value))) {
> - temp_obj = elements[j - 1];
> - elements[j - 1] = elements[j];
> - elements[j] = temp_obj;
> + swap(elements[j - 1], elements[j]);
> }
> }
> }
> --
> 2.20.1
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Devel] Re: [PATCH] ACPICA: fix swap.cocci warning
@ 2021-11-18 14:46 ` Rafael J. Wysocki
0 siblings, 0 replies; 6+ messages in thread
From: Rafael J. Wysocki @ 2021-11-18 14:46 UTC (permalink / raw)
To: devel
[-- Attachment #1: Type: text/plain, Size: 1815 bytes --]
On Tue, Nov 9, 2021 at 2:47 PM Guo Zhengkui <guozhengkui(a)vivo.com> wrote:
>
> Fix following swap.cocci warning:
> ./drivers/acpi/acpica/nsrepair2.c:896:33-34: WARNING
> opportunity for swap()
>
> Signed-off-by: Guo Zhengkui <guozhengkui(a)vivo.com>
This change needs to be submitted to the upstream ACPICA project via
https://github.com/acpica/acpica/
Thanks!
> ---
> drivers/acpi/acpica/nsrepair2.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/acpi/acpica/nsrepair2.c b/drivers/acpi/acpica/nsrepair2.c
> index 14b71b41e845..02a904ca4caf 100644
> --- a/drivers/acpi/acpica/nsrepair2.c
> +++ b/drivers/acpi/acpica/nsrepair2.c
> @@ -8,6 +8,7 @@
> *
> *****************************************************************************/
>
> +#include <linux/minmax.h>
> #include <acpi/acpi.h>
> #include "accommon.h"
> #include "acnamesp.h"
> @@ -875,7 +876,6 @@ acpi_ns_sort_list(union acpi_operand_object **elements,
> {
> union acpi_operand_object *obj_desc1;
> union acpi_operand_object *obj_desc2;
> - union acpi_operand_object *temp_obj;
> u32 i;
> u32 j;
>
> @@ -892,9 +892,7 @@ acpi_ns_sort_list(union acpi_operand_object **elements,
> || ((sort_direction == ACPI_SORT_DESCENDING)
> && (obj_desc1->integer.value <
> obj_desc2->integer.value))) {
> - temp_obj = elements[j - 1];
> - elements[j - 1] = elements[j];
> - elements[j] = temp_obj;
> + swap(elements[j - 1], elements[j]);
> }
> }
> }
> --
> 2.20.1
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ACPICA: fix swap.cocci warning
[not found] ` <AIwACwDlE6oYbcAnsFaroKpJ.9.1637246783998.Hmail.guozhengkui@vivo.com.@PENBSlo1djBpeHR2ek5pQXd3THRYWGdHLThGZHZ0V1l5N1JVaDBwRno2NXNqY215dU5kUUBtYWlsLmdtYWlsLmNvbT4=>
@ 2021-11-19 6:30 ` Guo Zhengkui
2021-11-27 11:36 ` [Devel] " Moore, Robert
0 siblings, 1 reply; 6+ messages in thread
From: Guo Zhengkui @ 2021-11-19 6:30 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Robert Moore, Rafael J. Wysocki, Len Brown,
ACPI Devel Maling List,
open list:ACPI COMPONENT ARCHITECTURE (ACPICA),
Linux Kernel Mailing List, kernel
On 2021/11/18 22:46, Rafael J. Wysocki wrote:
> On Tue, Nov 9, 2021 at 2:47 PM Guo Zhengkui <guozhengkui@vivo.com> wrote:
>>
>> Fix following swap.cocci warning:
>> ./drivers/acpi/acpica/nsrepair2.c:896:33-34: WARNING
>> opportunity for swap()
>>
>> Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com>
>
> This change needs to be submitted to the upstream ACPICA project via
> https://github.com/acpica/acpica/
>
> Thanks!
So it means I need to submit this patch to upstream ACPICA project, not
linux-next?
>
>> ---
>> drivers/acpi/acpica/nsrepair2.c | 6 ++----
>> 1 file changed, 2 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/acpi/acpica/nsrepair2.c b/drivers/acpi/acpica/nsrepair2.c
>> index 14b71b41e845..02a904ca4caf 100644
>> --- a/drivers/acpi/acpica/nsrepair2.c
>> +++ b/drivers/acpi/acpica/nsrepair2.c
>> @@ -8,6 +8,7 @@
>> *
>> *****************************************************************************/
>>
>> +#include <linux/minmax.h>
>> #include <acpi/acpi.h>
>> #include "accommon.h"
>> #include "acnamesp.h"
>> @@ -875,7 +876,6 @@ acpi_ns_sort_list(union acpi_operand_object **elements,
>> {
>> union acpi_operand_object *obj_desc1;
>> union acpi_operand_object *obj_desc2;
>> - union acpi_operand_object *temp_obj;
>> u32 i;
>> u32 j;
>>
>> @@ -892,9 +892,7 @@ acpi_ns_sort_list(union acpi_operand_object **elements,
>> || ((sort_direction == ACPI_SORT_DESCENDING)
>> && (obj_desc1->integer.value <
>> obj_desc2->integer.value))) {
>> - temp_obj = elements[j - 1];
>> - elements[j - 1] = elements[j];
>> - elements[j] = temp_obj;
>> + swap(elements[j - 1], elements[j]);
>> }
>> }
>> }
>> --
>> 2.20.1
>>
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH] ACPICA: fix swap.cocci warning
@ 2021-11-27 11:36 ` Moore, Robert
0 siblings, 0 replies; 6+ messages in thread
From: Moore, Robert @ 2021-11-27 11:36 UTC (permalink / raw)
To: Guo Zhengkui, Rafael J. Wysocki
Cc: Wysocki, Rafael J, Len Brown, ACPI Devel Maling List,
open list:ACPI COMPONENT ARCHITECTURE (ACPICA),
Linux Kernel Mailing List, kernel
-----Original Message-----
From: Guo Zhengkui <guozhengkui@vivo.com>
Sent: Thursday, November 18, 2021 10:31 PM
To: Rafael J. Wysocki <rafael@kernel.org>
Cc: Moore, Robert <robert.moore@intel.com>; Wysocki, Rafael J <rafael.j.wysocki@intel.com>; Len Brown <lenb@kernel.org>; ACPI Devel Maling List <linux-acpi@vger.kernel.org>; open list:ACPI COMPONENT ARCHITECTURE (ACPICA) <devel@acpica.org>; Linux Kernel Mailing List <linux-kernel@vger.kernel.org>; kernel <kernel@vivo.com>
Subject: Re: [PATCH] ACPICA: fix swap.cocci warning
On 2021/11/18 22:46, Rafael J. Wysocki wrote:
> On Tue, Nov 9, 2021 at 2:47 PM Guo Zhengkui <guozhengkui@vivo.com> wrote:
>>
>> Fix following swap.cocci warning:
>> ./drivers/acpi/acpica/nsrepair2.c:896:33-34: WARNING opportunity for
>> swap()
>>
>> Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com>
>
> This change needs to be submitted to the upstream ACPICA project via
> https://github.com/acpica/acpica/
>
> Thanks!
So it means I need to submit this patch to upstream ACPICA project, not linux-next?
The answer is yes.
Bob
>
>> ---
>> drivers/acpi/acpica/nsrepair2.c | 6 ++----
>> 1 file changed, 2 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/acpi/acpica/nsrepair2.c
>> b/drivers/acpi/acpica/nsrepair2.c index 14b71b41e845..02a904ca4caf
>> 100644
>> --- a/drivers/acpi/acpica/nsrepair2.c
>> +++ b/drivers/acpi/acpica/nsrepair2.c
>> @@ -8,6 +8,7 @@
>> *
>>
>> *********************************************************************
>> ********/
>>
>> +#include <linux/minmax.h>
>> #include <acpi/acpi.h>
>> #include "accommon.h"
>> #include "acnamesp.h"
>> @@ -875,7 +876,6 @@ acpi_ns_sort_list(union acpi_operand_object **elements,
>> {
>> union acpi_operand_object *obj_desc1;
>> union acpi_operand_object *obj_desc2;
>> - union acpi_operand_object *temp_obj;
>> u32 i;
>> u32 j;
>>
>> @@ -892,9 +892,7 @@ acpi_ns_sort_list(union acpi_operand_object **elements,
>> || ((sort_direction == ACPI_SORT_DESCENDING)
>> && (obj_desc1->integer.value <
>> obj_desc2->integer.value))) {
>> - temp_obj = elements[j - 1];
>> - elements[j - 1] = elements[j];
>> - elements[j] = temp_obj;
>> + swap(elements[j - 1], elements[j]);
>> }
>> }
>> }
>> --
>> 2.20.1
>>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Devel] Re: [PATCH] ACPICA: fix swap.cocci warning
@ 2021-11-27 11:36 ` Moore, Robert
0 siblings, 0 replies; 6+ messages in thread
From: Moore, Robert @ 2021-11-27 11:36 UTC (permalink / raw)
To: devel
[-- Attachment #1: Type: text/plain, Size: 2639 bytes --]
-----Original Message-----
From: Guo Zhengkui <guozhengkui(a)vivo.com>
Sent: Thursday, November 18, 2021 10:31 PM
To: Rafael J. Wysocki <rafael(a)kernel.org>
Cc: Moore, Robert <robert.moore(a)intel.com>; Wysocki, Rafael J <rafael.j.wysocki(a)intel.com>; Len Brown <lenb(a)kernel.org>; ACPI Devel Maling List <linux-acpi(a)vger.kernel.org>; open list:ACPI COMPONENT ARCHITECTURE (ACPICA) <devel(a)acpica.org>; Linux Kernel Mailing List <linux-kernel(a)vger.kernel.org>; kernel <kernel(a)vivo.com>
Subject: Re: [PATCH] ACPICA: fix swap.cocci warning
On 2021/11/18 22:46, Rafael J. Wysocki wrote:
> On Tue, Nov 9, 2021 at 2:47 PM Guo Zhengkui <guozhengkui(a)vivo.com> wrote:
>>
>> Fix following swap.cocci warning:
>> ./drivers/acpi/acpica/nsrepair2.c:896:33-34: WARNING opportunity for
>> swap()
>>
>> Signed-off-by: Guo Zhengkui <guozhengkui(a)vivo.com>
>
> This change needs to be submitted to the upstream ACPICA project via
> https://github.com/acpica/acpica/
>
> Thanks!
So it means I need to submit this patch to upstream ACPICA project, not linux-next?
The answer is yes.
Bob
>
>> ---
>> drivers/acpi/acpica/nsrepair2.c | 6 ++----
>> 1 file changed, 2 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/acpi/acpica/nsrepair2.c
>> b/drivers/acpi/acpica/nsrepair2.c index 14b71b41e845..02a904ca4caf
>> 100644
>> --- a/drivers/acpi/acpica/nsrepair2.c
>> +++ b/drivers/acpi/acpica/nsrepair2.c
>> @@ -8,6 +8,7 @@
>> *
>>
>> *********************************************************************
>> ********/
>>
>> +#include <linux/minmax.h>
>> #include <acpi/acpi.h>
>> #include "accommon.h"
>> #include "acnamesp.h"
>> @@ -875,7 +876,6 @@ acpi_ns_sort_list(union acpi_operand_object **elements,
>> {
>> union acpi_operand_object *obj_desc1;
>> union acpi_operand_object *obj_desc2;
>> - union acpi_operand_object *temp_obj;
>> u32 i;
>> u32 j;
>>
>> @@ -892,9 +892,7 @@ acpi_ns_sort_list(union acpi_operand_object **elements,
>> || ((sort_direction == ACPI_SORT_DESCENDING)
>> && (obj_desc1->integer.value <
>> obj_desc2->integer.value))) {
>> - temp_obj = elements[j - 1];
>> - elements[j - 1] = elements[j];
>> - elements[j] = temp_obj;
>> + swap(elements[j - 1], elements[j]);
>> }
>> }
>> }
>> --
>> 2.20.1
>>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-11-27 11:38 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-09 13:47 [PATCH] ACPICA: fix swap.cocci warning Guo Zhengkui
2021-11-18 14:46 ` Rafael J. Wysocki
2021-11-18 14:46 ` [Devel] " Rafael J. Wysocki
[not found] ` <AIwACwDlE6oYbcAnsFaroKpJ.9.1637246783998.Hmail.guozhengkui@vivo.com.@PENBSlo1djBpeHR2ek5pQXd3THRYWGdHLThGZHZ0V1l5N1JVaDBwRno2NXNqY215dU5kUUBtYWlsLmdtYWlsLmNvbT4=>
2021-11-19 6:30 ` Guo Zhengkui
2021-11-27 11:36 ` Moore, Robert
2021-11-27 11:36 ` [Devel] " Moore, Robert
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.