lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 14 Jul 2022 12:12:34 +0200
From:   Paolo Abeni <pabeni@...hat.com>
To:     Junxiao Chang <junxiao.chang@...el.com>, peppe.cavallaro@...com,
        alexandre.torgue@...s.st.com, joabreu@...opsys.com,
        netdev@...r.kernel.org
Subject: Re: [PATCH 2/2] net: stmmac: remove duplicate dma queue channel
 macros

On Wed, 2022-07-13 at 16:47 +0800, Junxiao Chang wrote:
> It doesn't need extra macros for queue 0 & 4. Same macro could
> be used for all 8 queues.
> 
> Signed-off-by: Junxiao Chang <junxiao.chang@...el.com>

This looks like a net-next cleanup for the previous patch, which
instead looks like a proper -net candidate. Would you mind re-posting
the two patch separatelly, waiting for the fix to land into net-next
before posting the cleanup?

> ---
>  drivers/net/ethernet/stmicro/stmmac/dwmac4.h      |  4 +---
>  drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 11 ++++-------
>  2 files changed, 5 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4.h b/drivers/net/ethernet/stmicro/stmmac/dwmac4.h
> index 462ca7ed095a2..a7b725a7519bb 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4.h
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4.h
> @@ -330,9 +330,7 @@ enum power_event {
>  
>  #define MTL_RXQ_DMA_MAP0		0x00000c30 /* queue 0 to 3 */
>  #define MTL_RXQ_DMA_MAP1		0x00000c34 /* queue 4 to 7 */
> -#define MTL_RXQ_DMA_Q04MDMACH_MASK	GENMASK(3, 0)
> -#define MTL_RXQ_DMA_Q04MDMACH(x)	((x) << 0)
> -#define MTL_RXQ_DMA_QXMDMACH_MASK(x)	GENMASK(11 + (8 * ((x) - 1)), 8 * (x))
> +#define MTL_RXQ_DMA_QXMDMACH_MASK(x)	GENMASK(3 + (8 * (x)), 8 * (x))
>  #define MTL_RXQ_DMA_QXMDMACH(chan, q)	((chan) << (8 * (q)))

if you here use ((x) & 0x3) instead of (x) and ((q) & 0x3) instead of
(q), you can avoid the if statement below. 
>  
cheers,

Paolo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ