Skip to content

Commit 4a0342c

Browse files
Ian Campbelldavem330
authored andcommitted
sparc: fix array bounds error setting up PCIC NMI trap
CC arch/sparc/kernel/pcic.o arch/sparc/kernel/pcic.c: In function 'pcic_probe': arch/sparc/kernel/pcic.c:359:33: error: array subscript is above array bounds [-Werror=array-bounds] arch/sparc/kernel/pcic.c:359:8: error: array subscript is above array bounds [-Werror=array-bounds] arch/sparc/kernel/pcic.c:360:33: error: array subscript is above array bounds [-Werror=array-bounds] arch/sparc/kernel/pcic.c:360:8: error: array subscript is above array bounds [-Werror=array-bounds] arch/sparc/kernel/pcic.c:361:33: error: array subscript is above array bounds [-Werror=array-bounds] arch/sparc/kernel/pcic.c:361:8: error: array subscript is above array bounds [-Werror=array-bounds] cc1: all warnings being treated as errors I'm not particularly familiar with sparc but t_nmi (defined in head_32.S via the TRAP_ENTRY macro) and pcic_nmi_trap_patch (defined in entry.S) both appear to be 4 instructions long and I presume from the usage that instructions are int sized. Signed-off-by: Ian Campbell <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: [email protected] Reviewed-by: Sam Ravnborg <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 178a296 commit 4a0342c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/sparc/kernel/pcic.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,8 @@ int __init pcic_probe(void)
352352
strcpy(pbm->prom_name, namebuf);
353353

354354
{
355-
extern volatile int t_nmi[1];
356-
extern int pcic_nmi_trap_patch[1];
355+
extern volatile int t_nmi[4];
356+
extern int pcic_nmi_trap_patch[4];
357357

358358
t_nmi[0] = pcic_nmi_trap_patch[0];
359359
t_nmi[1] = pcic_nmi_trap_patch[1];

0 commit comments

Comments
 (0)