ethernet: ucc_geth: add helper to replace repeated switch statements
authorRasmus Villemoes <rasmus.villemoes@prevas.dk>
Tue, 19 Jan 2021 15:08:00 +0000 (16:08 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 21 Jan 2021 20:19:56 +0000 (12:19 -0800)
commit634b5bd7318725202ffad6cbf034b006970b1112
tree9ac568c38c8fa70acf9704f82260ca22fc65ae58
parent33deb13c87e561c3b566c60aede124a5e23981c1
ethernet: ucc_geth: add helper to replace repeated switch statements

The translation from the ucc_geth_num_of_threads enum value to the
actual count can be written somewhat more compactly with a small
lookup table, allowing us to replace the four switch statements.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/freescale/ucc_geth.c