[1/5] ARM: use unified assembler in macros
diff mbox series

Message ID 5b710816f634307d6a67ffcf7e4b538818dcb2a3.1549532513.git.stefan@agner.ch
State New
Headers show
Series
  • ARM: convert to unified syntax
Related show

Commit Message

Stefan Agner Feb. 7, 2019, 9:48 a.m. UTC
Use unified assembler syntax (UAL) in macros. Divided syntax is
considered depricated. This will also allow to build the kernel
using LLVM's integrated assembler.

Signed-off-by: Stefan Agner <stefan@agner.ch>
---
 arch/arm/lib/copy_from_user.S | 2 +-
 arch/arm/lib/copy_to_user.S   | 2 +-
 arch/arm/lib/memcpy.S         | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

Comments

Ard Biesheuvel Feb. 7, 2019, 1:34 p.m. UTC | #1
Hi Stefan,

On Thu, 7 Feb 2019 at 10:46, Stefan Agner <stefan@agner.ch> wrote:
>
> Use unified assembler syntax (UAL) in macros. Divided syntax is
> considered depricated.

'deprecated'

> This will also allow to build the kernel
> using LLVM's integrated assembler.
>
> Signed-off-by: Stefan Agner <stefan@agner.ch>
> ---
>  arch/arm/lib/copy_from_user.S | 2 +-
>  arch/arm/lib/copy_to_user.S   | 2 +-
>  arch/arm/lib/memcpy.S         | 4 ++--
>  3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/lib/copy_from_user.S b/arch/arm/lib/copy_from_user.S
> index 0d4c189c7f4f..712ca399f559 100644
> --- a/arch/arm/lib/copy_from_user.S
> +++ b/arch/arm/lib/copy_from_user.S
> @@ -91,7 +91,7 @@
>         .endm
>
>         .macro str1b ptr reg cond=al abort
> -       str\cond\()b \reg, [\ptr], #1
> +       strb\cond\() \reg, [\ptr], #1

You can drop the null token here, you only need that in the middle of
a word. Same below.


>         .endm
>
>         .macro enter reg1 reg2
> diff --git a/arch/arm/lib/copy_to_user.S b/arch/arm/lib/copy_to_user.S
> index 97a6ff4b7e3c..2e402b815e13 100644
> --- a/arch/arm/lib/copy_to_user.S
> +++ b/arch/arm/lib/copy_to_user.S
> @@ -49,7 +49,7 @@
>         .endm
>
>         .macro ldr1b ptr reg cond=al abort
> -       ldr\cond\()b \reg, [\ptr], #1
> +       ldrb\cond\() \reg, [\ptr], #1
>         .endm
>
>  #ifdef CONFIG_CPU_USE_DOMAINS
> diff --git a/arch/arm/lib/memcpy.S b/arch/arm/lib/memcpy.S
> index 64111bd4440b..1c9e625148ca 100644
> --- a/arch/arm/lib/memcpy.S
> +++ b/arch/arm/lib/memcpy.S
> @@ -30,7 +30,7 @@
>         .endm
>
>         .macro ldr1b ptr reg cond=al abort
> -       ldr\cond\()b \reg, [\ptr], #1
> +       ldrb\cond\() \reg, [\ptr], #1
>         .endm
>
>         .macro str1w ptr reg abort
> @@ -42,7 +42,7 @@
>         .endm
>
>         .macro str1b ptr reg cond=al abort
> -       str\cond\()b \reg, [\ptr], #1
> +       strb\cond\() \reg, [\ptr], #1
>         .endm
>
>         .macro enter reg1 reg2
> --
> 2.20.1
>
Nicolas Pitre Feb. 7, 2019, 3:52 p.m. UTC | #2
On Thu, 7 Feb 2019, Stefan Agner wrote:

> Use unified assembler syntax (UAL) in macros. Divided syntax is
> considered depricated. This will also allow to build the kernel
> using LLVM's integrated assembler.
> 
> Signed-off-by: Stefan Agner <stefan@agner.ch>
> ---
>  arch/arm/lib/copy_from_user.S | 2 +-
>  arch/arm/lib/copy_to_user.S   | 2 +-
>  arch/arm/lib/memcpy.S         | 4 ++--
>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/lib/copy_from_user.S b/arch/arm/lib/copy_from_user.S
> index 0d4c189c7f4f..712ca399f559 100644
> --- a/arch/arm/lib/copy_from_user.S
> +++ b/arch/arm/lib/copy_from_user.S
> @@ -91,7 +91,7 @@
>  	.endm
>  
>  	.macro str1b ptr reg cond=al abort
> -	str\cond\()b \reg, [\ptr], #1
> +	strb\cond\() \reg, [\ptr], #1

You don't need the \() any longer. This was used simply to separate the 
b suffix from the cond parameter name. 


Nicolas

Patch
diff mbox series

diff --git a/arch/arm/lib/copy_from_user.S b/arch/arm/lib/copy_from_user.S
index 0d4c189c7f4f..712ca399f559 100644
--- a/arch/arm/lib/copy_from_user.S
+++ b/arch/arm/lib/copy_from_user.S
@@ -91,7 +91,7 @@ 
 	.endm
 
 	.macro str1b ptr reg cond=al abort
-	str\cond\()b \reg, [\ptr], #1
+	strb\cond\() \reg, [\ptr], #1
 	.endm
 
 	.macro enter reg1 reg2
diff --git a/arch/arm/lib/copy_to_user.S b/arch/arm/lib/copy_to_user.S
index 97a6ff4b7e3c..2e402b815e13 100644
--- a/arch/arm/lib/copy_to_user.S
+++ b/arch/arm/lib/copy_to_user.S
@@ -49,7 +49,7 @@ 
 	.endm
 
 	.macro ldr1b ptr reg cond=al abort
-	ldr\cond\()b \reg, [\ptr], #1
+	ldrb\cond\() \reg, [\ptr], #1
 	.endm
 
 #ifdef CONFIG_CPU_USE_DOMAINS
diff --git a/arch/arm/lib/memcpy.S b/arch/arm/lib/memcpy.S
index 64111bd4440b..1c9e625148ca 100644
--- a/arch/arm/lib/memcpy.S
+++ b/arch/arm/lib/memcpy.S
@@ -30,7 +30,7 @@ 
 	.endm
 
 	.macro ldr1b ptr reg cond=al abort
-	ldr\cond\()b \reg, [\ptr], #1
+	ldrb\cond\() \reg, [\ptr], #1
 	.endm
 
 	.macro str1w ptr reg abort
@@ -42,7 +42,7 @@ 
 	.endm
 
 	.macro str1b ptr reg cond=al abort
-	str\cond\()b \reg, [\ptr], #1
+	strb\cond\() \reg, [\ptr], #1
 	.endm
 
 	.macro enter reg1 reg2