ARM: Fix warning with gcc 4.5.1 in alignment fixup
PATCH 1/1 ARM: Fix warning with gcc 4.5.1 in alignment fixup
With GCC 4.5.1 we get the following warning:
CC arch/arm/mm/alignment.o
arch/arm/mm/alignment.c: In function 'do_alignment':
arch/arm/mm/alignment.c:720:21: warning: 'offset.un' may be used uninitialized in this function
This warning is triggered for the LDM/STM instructions which don't have a register offset so set the offset to 0 to keep GCC happy.
--- arch/arm/mm/alignment.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
arch/arm/mm/alignment.c +3 -1
@@ -824,8 +824,10 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs)case 0x08000000 :/* ldm or stm, or thumb-2 32bit instruction */ if (thumb2_32b) handler =do_alignment_t32_to_handler (&instr, regs, &offset); -else +else { handler = do_alignment_ldmstm; + offset.un =0 ; + }break ;default :
Signature · 1 line
1.7.3.2
PATCH 1/1 ARM: Fix warning with gcc 4.5.1 in alignment fixup
Quoted 9 lines · Jamie Iles
With GCC 4.5.1 we get the following warning:
CC
arch/arm/mm/alignment.o
arch/arm/mm/alignment.c: In function 'do_alignment':
arch/arm/mm/alignment.c:720:21: warning: 'offset.un' may be used uninitialized in this functionThis warning is triggered for the LDM/STM instructions which don't have a register offset so set the offset to 0 to keep GCC happy.
Your change looks fine to me.
--
Regards,
George
Quoted 26 lines
Cc George G. Davis <[email protected]>Cc Min Zhang <[email protected]>Signed-off-by Jamie Iles <[email protected]>--- arch/arm/mm/alignment.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)arch/arm/mm/alignment.c +3
-1@@ -824,8 +824,10 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs)case 0x08000000 :/* ldm or stm, or thumb-2 32bit instruction */ if (thumb2_32b) handler =do_alignment_t32_to_handler (&instr, regs, &offset); -else +else { handler = do_alignment_ldmstm; + offset.un =0 ; + }break ;default :Signature · 1 line
1.7.3.2
PATCH 1/1 ARM: Fix warning with gcc 4.5.1 in alignment fixup
In reply to Jamie IlesQuoted 7 lines · Jamie Iles
With GCC 4.5.1 we get the following warning:
CC
arch/arm/mm/alignment.o
arch/arm/mm/alignment.c: In function 'do_alignment':
arch/arm/mm/alignment.c:720:21: warning: 'offset.un' may be used uninitialized in this function
Quoted 7 lines
This warning is triggered for the LDM/STM instructions which don't have a register offset so set the offset to 0 to keep GCC happy.
Cc George G. Davis <[email protected]>Cc Min Zhang <[email protected]>Signed-off-by Jamie Iles <[email protected]>---
Hi Russell,
Ok to send this one to the patch system?
Jamie