diff mbox

[boot-wrapper-aarch64,2/4] psci: remove sentinel from id_table

Message ID 1421115304-19580-3-git-send-email-zlim@broadcom.com (mailing list archive)
State New, archived
Headers show

Commit Message

Zi Shen Lim Jan. 13, 2015, 2:15 a.m. UTC
Tweak the limit check in find_logical_id so we can
do away with the sentinel from id_table.

While at it, also remove unused label and fix up spacing.

Signed-off-by: Zi Shen Lim <zlim@broadcom.com>
---
 psci.S | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Mark Rutland Jan. 14, 2015, 11:10 a.m. UTC | #1
Hi,

On Tue, Jan 13, 2015 at 02:15:02AM +0000, Zi Shen Lim wrote:
> Tweak the limit check in find_logical_id so we can
> do away with the sentinel from id_table.
> 
> While at it, also remove unused label and fix up spacing.
> 
> Signed-off-by: Zi Shen Lim <zlim@broadcom.com>

This looks like a nice cleanup to me.

So long as this passes build and boot testing I'll apply this shortly.

Thanks,
Mark.

> ---
>  psci.S | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/psci.S b/psci.S
> index 234493d..d045e56 100644
> --- a/psci.S
> +++ b/psci.S
> @@ -69,7 +69,6 @@ vector:
>  id_table:
>  	.quad CPU_IDS
>  __id_end:
> -	.quad MPIDR_INVALID
>  
>  .equ	nr_cpus, ((__id_end - id_table) / 8)
>  
> @@ -159,17 +158,16 @@ psci_cpu_on:
>   * Clobbers x1, x2, x3
>   */
>  find_logical_id:
> -__find_logical_index:
>  	adr	x2, id_table
>  	mov	x1, xzr
>  1:	mov	x3, #nr_cpus	// check we haven't walked off the end of the array
>  	cmp	x1, x3
> -	b.gt	3f
> +	b.ge	3f
>  	ldr	x3, [x2, x1, lsl #3]
>  	cmp	x3, x0
>  	b.eq	2f
>  	add	x1, x1, #1
> -	b 1b
> +	b	1b
>  2:	mov	x0, x1
>  	ret
>  3:	mov	x0, #MPIDR_INVALID
> -- 
> 2.1.0
> 
>
diff mbox

Patch

diff --git a/psci.S b/psci.S
index 234493d..d045e56 100644
--- a/psci.S
+++ b/psci.S
@@ -69,7 +69,6 @@  vector:
 id_table:
 	.quad CPU_IDS
 __id_end:
-	.quad MPIDR_INVALID
 
 .equ	nr_cpus, ((__id_end - id_table) / 8)
 
@@ -159,17 +158,16 @@  psci_cpu_on:
  * Clobbers x1, x2, x3
  */
 find_logical_id:
-__find_logical_index:
 	adr	x2, id_table
 	mov	x1, xzr
 1:	mov	x3, #nr_cpus	// check we haven't walked off the end of the array
 	cmp	x1, x3
-	b.gt	3f
+	b.ge	3f
 	ldr	x3, [x2, x1, lsl #3]
 	cmp	x3, x0
 	b.eq	2f
 	add	x1, x1, #1
-	b 1b
+	b	1b
 2:	mov	x0, x1
 	ret
 3:	mov	x0, #MPIDR_INVALID