Quoting Antoine Tenart (2021-10-12 10:33:04)
Quoting Sean Anderson (2021-10-11 18:55:16)
quoted
As the number of interfaces grows, the number of if statements grows
ever more unweildy. Clean everything up a bit by using a switch
statement. No functional change intended.
I'm not 100% convinced this makes macb_validate more readable: there are
lots of conditions, and jumps, in the switch.
Maybe you could try a mixed approach; keeping the invalid modes checks
(bitmap_zero) at the beginning and once we know the mode is valid using
a switch statement. That might make it easier to read as this should
remove lots of conditionals. (We'll still have the one/_NA checks
though).
(Also having patch 1 first will improve things).
Patch 2 *