ARM:alignment:correct variable type of nr_regs
diff mbox series

Message ID 1578190656-19270-1-git-send-email-hanterliu@gmail.com
State New
Headers show
Series
  • ARM:alignment:correct variable type of nr_regs
Related show

Commit Message

hanterliu@gmail.com Jan. 5, 2020, 2:17 a.m. UTC
From: hanter Liu <hanterliu@gamil.com>

if ldmstm instruction U bit is unset, nr_regs
should be negative value, so change variable
type of nr_regs from unsigned int to int.

Signed-off-by: hanter Liu <hanterliu@gamil.com>
---
 arch/arm/mm/alignment.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Russell King - ARM Linux admin Jan. 5, 2020, 2 p.m. UTC | #1
On Sun, Jan 05, 2020 at 10:17:36AM +0800, hanterliu@gmail.com wrote:
> From: hanter Liu <hanterliu@gamil.com>
> 
> if ldmstm instruction U bit is unset, nr_regs
> should be negative value, so change variable
> type of nr_regs from unsigned int to int.
> 
> Signed-off-by: hanter Liu <hanterliu@gamil.com>

Hi,

What observable bug is this fixing, or is this just a clean up? Please
clarify.

Thanks.

> ---
>  arch/arm/mm/alignment.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c
> index 788c5cf..d8e3bd9 100644
> --- a/arch/arm/mm/alignment.c
> +++ b/arch/arm/mm/alignment.c
> @@ -499,7 +499,8 @@ do_alignment_ldrstr(unsigned long addr, u32 instr, struct pt_regs *regs)
>  static int
>  do_alignment_ldmstm(unsigned long addr, u32 instr, struct pt_regs *regs)
>  {
> -	unsigned int rd, rn, correction, nr_regs, regbits;
> +	int nr_regs;
> +	unsigned int rd, rn, correction, regbits;
>  	unsigned long eaddr, newaddr;
>  
>  	if (LDM_S_BIT(instr))
> -- 
> 2.7.4
> 
>

Patch
diff mbox series

diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c
index 788c5cf..d8e3bd9 100644
--- a/arch/arm/mm/alignment.c
+++ b/arch/arm/mm/alignment.c
@@ -499,7 +499,8 @@  do_alignment_ldrstr(unsigned long addr, u32 instr, struct pt_regs *regs)
 static int
 do_alignment_ldmstm(unsigned long addr, u32 instr, struct pt_regs *regs)
 {
-	unsigned int rd, rn, correction, nr_regs, regbits;
+	int nr_regs;
+	unsigned int rd, rn, correction, regbits;
 	unsigned long eaddr, newaddr;
 
 	if (LDM_S_BIT(instr))