[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ef465a6bde6c2845e7e2537c12efbab9a6fb5157.camel@redhat.com>
Date: Thu, 16 Nov 2023 12:23:38 +0100
From: Paolo Abeni <pabeni@...hat.com>
To: Baruch Siach <baruch@...s.co.il>, Alexandre Torgue
<alexandre.torgue@...s.st.com>, Jose Abreu <joabreu@...opsys.com>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH net-next v2 2/2] net: stmmac: reduce dma ring display
code duplication
On Tue, 2023-11-14 at 09:03 +0200, Baruch Siach wrote:
> The code to show extended descriptor is identical to normal one.
> Consolidate the code to remove duplication.
>
> Signed-off-by: Baruch Siach <baruch@...s.co.il>
> ---
> v2: Fix extended descriptor case, and properly test both cases
> ---
> .../net/ethernet/stmicro/stmmac/stmmac_main.c | 25 +++++++------------
> 1 file changed, 9 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index 39336fe5e89d..cf818a2bc9d5 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -6182,26 +6182,19 @@ static void sysfs_display_ring(void *head, int size, int extend_desc,
> int i;
> struct dma_extended_desc *ep = (struct dma_extended_desc *)head;
> struct dma_desc *p = (struct dma_desc *)head;
> + unsigned long desc_size = extend_desc ? sizeof(*ep) : sizeof(*p);
> dma_addr_t dma_addr;
Since this is a cleanup refactor, please reorganize the variables
declarations to respect the reverse xmas tree order.
WRT the ternary operator at initialization time, I also feel it should
be better move it out of the declaration.
Cheers,
Paolo
Powered by blists - more mailing lists