s390/irq: use assignment instead of cast
authorHeiko Carstens <hca@linux.ibm.com>
Sun, 6 Mar 2022 10:11:05 +0000 (11:11 +0100)
committerVasily Gorbik <gor@linux.ibm.com>
Mon, 7 Mar 2022 23:33:01 +0000 (00:33 +0100)
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>
arch/s390/include/asm/irq.h
arch/s390/kernel/irq.c

index 9f75d67..89902f7 100644 (file)
@@ -81,8 +81,13 @@ static __always_inline void inc_irq_stat(enum interruption_class irq)
 }
 
 struct ext_code {
-       unsigned short subcode;
-       unsigned short code;
+       union {
+               struct {
+                       unsigned short subcode;
+                       unsigned short code;
+               };
+               unsigned int int_code;
+       };
 };
 
 typedef void (*ext_int_handler_t)(struct ext_code, unsigned int, unsigned long);
index cb70996..3033f61 100644 (file)
@@ -342,7 +342,7 @@ static irqreturn_t do_ext_interrupt(int irq, void *dummy)
        struct ext_int_info *p;
        int index;
 
-       ext_code = *(struct ext_code *) &regs->int_code;
+       ext_code.int_code = regs->int_code;
        if (ext_code.code != EXT_IRQ_CLK_COMP)
                set_cpu_flag(CIF_NOHZ_DELAY);