This should be written as an inline function rather than a macro.  Same end result but it would make this much more readable.

I see why you're doing this but it does have a few unfortunate side-effects.  This results in allocating RAM for all possible IRQ handlers, regardless of how many are actually used.  It also means that we have to do a linear search on every DMA IRQ.

I'm just starting to look at the DMA code so maybe this is still the best way to handle things given your new use case.