Skip to content

Commit 7d8484c

Browse files
hcahcaVasily Gorbik
authored andcommitted
s390/irq: use assignment instead of cast
Change struct ext_code to contain a union which allows to simply assign the int_code instead of using a cast. In order to keep the patch small the anonymous union is embedded within the existing struct instead of changing the struct ext_code to a union. Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
1 parent 998e780 commit 7d8484c

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

arch/s390/include/asm/irq.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,13 @@ static __always_inline void inc_irq_stat(enum interruption_class irq)
8181
}
8282

8383
struct ext_code {
84-
unsigned short subcode;
85-
unsigned short code;
84+
union {
85+
struct {
86+
unsigned short subcode;
87+
unsigned short code;
88+
};
89+
unsigned int int_code;
90+
};
8691
};
8792

8893
typedef void (*ext_int_handler_t)(struct ext_code, unsigned int, unsigned long);

arch/s390/kernel/irq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ static irqreturn_t do_ext_interrupt(int irq, void *dummy)
342342
struct ext_int_info *p;
343343
int index;
344344

345-
ext_code = *(struct ext_code *) &regs->int_code;
345+
ext_code.int_code = regs->int_code;
346346
if (ext_code.code != EXT_IRQ_CLK_COMP)
347347
set_cpu_flag(CIF_NOHZ_DELAY);
348348

0 commit comments

Comments
 (0)