On Fri, 16 Feb 2018 20:16:02 +0200 Claudiu Beznea <Claudiu.Beznea@xxxxxxxxxxxxx> wrote: > Or you could use: > unsigned long expected_irqs, unexpected_irqs; > > expected_irqs = val & GENMASK(g_spi.int - 1, 0); > unexpected_irq = val & GENMASK(MAX_NUM_INT - 1, g_spi.int); > > for (i = 0; i < g_spi.nint && expected_irqs; i++) { > if (expected_irqs & BIT(i)) { > ret = wilc_spi_write_reg(wilc, 0x10c8 + i * 4, 1); > if (ret) { > dev_err(...); > goto _fail_; > } > } > } > > for (i = g_spi.nint; i < MAX_NUM_INT && unexpected_irq; i++) { > if (unexpected_irqs & BIT(i)) > dev_err(...); > Thanks for suggestion. I will take this input and make use of GENMASK macro to modify the function. In a separate patch will submit these changes. As there are other functions,where same macro can be used so will include them together in separate patch.