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) ...@@ -1006,14 +1006,9 @@ irqreturn_t trtl_irq_handler_in(int irq_core_base, void *arg)
dispatch_irq: dispatch_irq:
n_disp++; n_disp++;
i = -1; for_each_set_bit(i, &status, TRTL_MAX_MQ_CHAN * TRTL_MAX_CPU) {
while (status && i < TRTL_MAX_MQ_CHAN * TRTL_MAX_CPU) { hmq = &trtl->cpu[i / TRTL_MAX_MQ_CHAN].hmq[i % TRTL_MAX_MQ_CHAN];
++i; trtl_irq_handler_input(hmq);
if (status & 0x1) {
hmq = &trtl->cpu[i / TRTL_MAX_MQ_CHAN].hmq[i % TRTL_MAX_MQ_CHAN];
trtl_irq_handler_input(hmq);
}
status >>= 1;
} }
status = trtl_hmq_irq_status_in(trtl); status = trtl_hmq_irq_status_in(trtl);
...@@ -1123,15 +1118,7 @@ irqreturn_t trtl_irq_handler_out(int irq_core_base, void *arg) ...@@ -1123,15 +1118,7 @@ irqreturn_t trtl_irq_handler_out(int irq_core_base, void *arg)
if (!status) if (!status)
return IRQ_NONE; return IRQ_NONE;
i = -1; for_each_set_bit(i, &status, TRTL_MAX_MQ_CHAN * TRTL_MAX_CPU) {
while (status && i < TRTL_MAX_MQ_CHAN * TRTL_MAX_CPU) {
++i;
if (!(status & 0x1)) {
status >>= 1;
continue;
}
status >>= 1;
hmq = &trtl->cpu[i / TRTL_MAX_MQ_CHAN].hmq[i % TRTL_MAX_MQ_CHAN]; 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