mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/1 linux-next] ACPICA: use swap() in acpi_ns_sort_list()
@ 2015-06-10 16:32 Fabian Frederick
  2015-06-10 16:48 ` Moore, Robert
  0 siblings, 1 reply; 2+ messages in thread
From: Fabian Frederick @ 2015-06-10 16:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Julia Lawall, Fabian Frederick, Robert Moore, Lv Zheng,
	Rafael J. Wysocki, Len Brown, linux-acpi, devel

Use kernel.h macro definition.

Thanks to Julia Lawall for Coccinelle scripting support.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 drivers/acpi/acpica/nsrepair2.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/acpi/acpica/nsrepair2.c b/drivers/acpi/acpica/nsrepair2.c
index c30672d..7513799 100644
--- a/drivers/acpi/acpica/nsrepair2.c
+++ b/drivers/acpi/acpica/nsrepair2.c
@@ -904,7 +904,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;
 
@@ -920,11 +919,8 @@ acpi_ns_sort_list(union acpi_operand_object **elements,
 			      obj_desc2->integer.value))
 			    || ((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;
-			}
+				    obj_desc2->integer.value)))
+				swap(elements[j - 1], elements[j]);
 		}
 	}
 }
-- 
2.4.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: [PATCH 1/1 linux-next] ACPICA: use swap() in acpi_ns_sort_list()
  2015-06-10 16:32 [PATCH 1/1 linux-next] ACPICA: use swap() in acpi_ns_sort_list() Fabian Frederick
@ 2015-06-10 16:48 ` Moore, Robert
  0 siblings, 0 replies; 2+ messages in thread
From: Moore, Robert @ 2015-06-10 16:48 UTC (permalink / raw)
  To: Fabian Frederick, linux-kernel
  Cc: Julia Lawall, Zheng, Lv, Wysocki, Rafael J, Len Brown, linux-acpi, devel

I don't think this is portable across operating systems. Which is a requirement for ACPICA.



> -----Original Message-----
> From: Fabian Frederick [mailto:fabf@skynet.be]
> Sent: Wednesday, June 10, 2015 9:33 AM
> To: linux-kernel@vger.kernel.org
> Cc: Julia Lawall; Fabian Frederick; Moore, Robert; Zheng, Lv; Wysocki,
> Rafael J; Len Brown; linux-acpi@vger.kernel.org; devel@acpica.org
> Subject: [PATCH 1/1 linux-next] ACPICA: use swap() in acpi_ns_sort_list()
> 
> Use kernel.h macro definition.
> 
> Thanks to Julia Lawall for Coccinelle scripting support.
> 
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
> ---
>  drivers/acpi/acpica/nsrepair2.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/acpi/acpica/nsrepair2.c
> b/drivers/acpi/acpica/nsrepair2.c index c30672d..7513799 100644
> --- a/drivers/acpi/acpica/nsrepair2.c
> +++ b/drivers/acpi/acpica/nsrepair2.c
> @@ -904,7 +904,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;
> 
> @@ -920,11 +919,8 @@ acpi_ns_sort_list(union acpi_operand_object
> **elements,
>  			      obj_desc2->integer.value))
>  			    || ((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;
> -			}
> +				    obj_desc2->integer.value)))
> +				swap(elements[j - 1], elements[j]);
>  		}
>  	}
>  }
> --
> 2.4.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-10 16:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-10 16:32 [PATCH 1/1 linux-next] ACPICA: use swap() in acpi_ns_sort_list() Fabian Frederick
2015-06-10 16:48 ` Moore, Robert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®