Skip to contentSkip to conversation

ARM:alignment:correct variable type of nr_regs

PATCH In review [email protected] 2 participants 2 messages Jan 5, 2020 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM:alignment:correct variable type of nr_regs

From: hanter Liu <[email protected]>

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.

---
 arch/arm/mm/alignment.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mm/alignment.c +2 -1
index 788c5cf..d8e3bd9 100644
@@ -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))
Signature · 7 lines
2.7.4


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#1 lore raw
Quoted 7 lines · On Sun, Jan 05, 2020 at 10:17:36AM +0800, [email protected] wrote:

From: hanter Liu <[email protected]>

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.

Hi,

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

Thanks.

Quoted 22 lines
---
 arch/arm/mm/alignment.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mm/alignment.c +2 -1
index 788c5cf..d8e3bd9 100644
@@ -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))
Signature · 1 line
2.7.4
Signature · 8 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel