[PATCH net-next v2 11/17] ethernet: ucc_geth: don't statically allocate eight ucc_geth_info

2021-01-19 Thread Rasmus Villemoes
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

Re: [PATCH net-next v2 11/17] ethernet: ucc_geth: don't statically allocate eight ucc_geth_info

2021-01-19 Thread Christophe Leroy
Le 19/01/2021 à 16:07, Rasmus Villemoes a écrit : 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

Re: [PATCH net-next v2 11/17] ethernet: ucc_geth: don't statically allocate eight ucc_geth_info

2021-01-20 Thread Rasmus Villemoes
On 20/01/2021 08.02, Christophe Leroy wrote: > >> @@ -3715,25 +3713,23 @@ static int ucc_geth_probe(struct >> platform_device* ofdev) >>   if ((ucc_num < 0) || (ucc_num > 7)) >>   return -ENODEV; >>   -    ug_info = &ugeth_info[ucc_num]; >> -    if (ug_info == NULL) { >> -    if (ne

Re: [PATCH net-next v2 11/17] ethernet: ucc_geth: don't statically allocate eight ucc_geth_info

2021-01-20 Thread Christophe Leroy
Le 20/01/2021 à 12:25, Rasmus Villemoes a écrit : On 20/01/2021 08.02, Christophe Leroy wrote: @@ -3715,25 +3713,23 @@ static int ucc_geth_probe(struct platform_device* ofdev)   if ((ucc_num < 0) || (ucc_num > 7))   return -ENODEV;   -    ug_info = &ugeth_info[ucc_num]; -