Commit 6c6a07fc authored by Sven Schnelle's avatar Sven Schnelle Committed by Vasily Gorbik
Browse files

s390/irq: add union/struct to access external interrupt parameters



gcc-11 warns:

arch/s390/kernel/irq.c: In function do_ext_irq:
arch/s390/kernel/irq.c:175:9: warning: memcpy reading 4 bytes from a region of size 0 [-Wstringop-overread]
  175 |         memcpy(&regs->int_code, &S390_lowcore.ext_cpu_addr, 4);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fix this by adding a struct for int_code to struct lowcore.

Signed-off-by: default avatarSven Schnelle <svens@linux.ibm.com>
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
parent 17e89e13
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -22,8 +22,13 @@ struct lowcore {
	__u32	ipl_parmblock_ptr;		/* 0x0014 */
	__u8	pad_0x0018[0x0080-0x0018];	/* 0x0018 */
	__u32	ext_params;			/* 0x0080 */
	union {
		struct {
			__u16 ext_cpu_addr;	/* 0x0084 */
			__u16 ext_int_code;	/* 0x0086 */
		} __packed;
		__u32 ext_int_code_addr;
	} __packed;
	__u32	svc_int_code;			/* 0x0088 */
	__u16	pgm_ilc;			/* 0x008c */
	__u16	pgm_code;			/* 0x008e */
+1 −1
Original line number Diff line number Diff line
@@ -172,7 +172,7 @@ void noinstr do_ext_irq(struct pt_regs *regs)
	if (user_mode(regs))
		update_timer_sys();

	memcpy(&regs->int_code, &S390_lowcore.ext_cpu_addr, 4);
	regs->int_code = S390_lowcore.ext_int_code_addr;
	regs->int_parm = S390_lowcore.ext_params;
	regs->int_parm_long = S390_lowcore.ext_params2;