]> git.baikalelectronics.ru Git - kernel.git/commit
ethernet: ucc_geth: don't statically allocate eight ucc_geth_info
authorRasmus Villemoes <rasmus.villemoes@prevas.dk>
Tue, 19 Jan 2021 15:07:56 +0000 (16:07 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 21 Jan 2021 20:19:56 +0000 (12:19 -0800)
commitaea16cee5ac3bc639c0a6dcaeb29270f921d3f21
treef173ddc2e1e1f8b455a62e7cff853e623a340598
parent681bbe97c24b8e384c254e0636bf8164ba6c3f8c
ethernet: ucc_geth: don't statically allocate eight ucc_geth_info

struct ucc_geth_info is somewhat large, and on systems with only one
or two UCC instances, that just wastes a few KB of memory. So
allocate and populate a chunk of memory at probe time instead of
initializing them all during driver init.

Note that the existing "ug_info == NULL" check was dead code, as the
address of some static array element can obviously never be NULL.

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