Commit d488046d authored by Federico Vaga's avatar Federico Vaga

sw:drv: use for_each_set_bit instead of custom logic

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent ebdd2b16
......@@ -1006,14 +1006,9 @@ irqreturn_t trtl_irq_handler_in(int irq_core_base, void *arg)
dispatch_irq:
n_disp++;
i = -1;
while (status && i < TRTL_MAX_MQ_CHAN * TRTL_MAX_CPU) {
++i;
if (status & 0x1) {
hmq = &trtl->cpu[i / TRTL_MAX_MQ_CHAN].hmq[i % TRTL_MAX_MQ_CHAN];
trtl_irq_handler_input(hmq);
}
status >>= 1;
for_each_set_bit(i, &status, TRTL_MAX_MQ_CHAN * TRTL_MAX_CPU) {
hmq = &trtl->cpu[i / TRTL_MAX_MQ_CHAN].hmq[i % TRTL_MAX_MQ_CHAN];
trtl_irq_handler_input(hmq);
}
status = trtl_hmq_irq_status_in(trtl);
......@@ -1123,15 +1118,7 @@ irqreturn_t trtl_irq_handler_out(int irq_core_base, void *arg)
if (!status)
return IRQ_NONE;
i = -1;
while (status && i < TRTL_MAX_MQ_CHAN * TRTL_MAX_CPU) {
++i;
if (!(status & 0x1)) {
status >>= 1;
continue;
}
status >>= 1;
for_each_set_bit(i, &status, TRTL_MAX_MQ_CHAN * TRTL_MAX_CPU) {
hmq = &trtl->cpu[i / TRTL_MAX_MQ_CHAN].hmq[i % TRTL_MAX_MQ_CHAN];
/*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment