Thread (31 messages) flat view 31 messages, 4 authors, 2021-01-21

Re: [PATCH net-next v2 08/17] ethernet: ucc_geth: remove {rx,tx}_glbl_pram_offset from struct ucc_geth_private

From: Rasmus Villemoes <hidden>
Date: 2021-01-20 12:48:44

On 20/01/2021 07.57, Christophe Leroy wrote:

Le 19/01/2021 à 16:07, Rasmus Villemoes a écrit :
quoted
These fields are only used within ucc_geth_startup(), so they might as
well be local variables in that function rather than being stashed in
struct ucc_geth_private.

Aside from making that struct a tiny bit smaller, it also shortens
some lines (getting rid of pointless casts while here), and fixes the
problems with using IS_ERR_VALUE() on a u32 as explained in commit
800cd6fb76f0 ("soc: fsl: qe: change return type of cpm_muram_alloc()
to s32").

Signed-off-by: Rasmus Villemoes <redacted>
---
  drivers/net/ethernet/freescale/ucc_geth.c | 21 +++++++++------------
  drivers/net/ethernet/freescale/ucc_geth.h |  2 --
  2 files changed, 9 insertions(+), 14 deletions(-)
diff --git a/drivers/net/ethernet/freescale/ucc_geth.c
b/drivers/net/ethernet/freescale/ucc_geth.c
index 74ee2ed2fbbb..75466489bf9a 100644
--- a/drivers/net/ethernet/freescale/ucc_geth.c
+++ b/drivers/net/ethernet/freescale/ucc_geth.c
@@ -2351,6 +2351,7 @@ static int ucc_geth_startup(struct
ucc_geth_private *ugeth)
      u8 function_code = 0;
      u8 __iomem *endOfRing;
      u8 numThreadsRxNumerical, numThreadsTxNumerical;
+    s32 rx_glbl_pram_offset, tx_glbl_pram_offset;
That's still a quite long name for a local variable. 
True, but I wanted to keep this mechanical and easy to verify. If
somebody wants to clean up the local variable names
(numThreads[RT]xNumerical also stand out), that can be done later.

Rasmus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help