linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: stmmac: Use bfsize1 in ndesc_init_rx_desc
@ 2019-04-17  1:49 Yue Haibing
  2019-04-17 12:14 ` Koskinen, Aaro (Nokia - FI/Espoo)
  2019-04-18  6:21 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Yue Haibing @ 2019-04-17  1:49 UTC (permalink / raw)
  To: peppe.cavallaro, alexandre.torgue, joabreu, davem,
	mcoquelin.stm32, aaro.koskinen
  Cc: linux-kernel, linux-arm-kernel, linux-stm32, netdev, YueHaibing

From: YueHaibing <yuehaibing@huawei.com>

gcc warn this:

drivers/net/ethernet/stmicro/stmmac/norm_desc.c: In function ndesc_init_rx_desc:
drivers/net/ethernet/stmicro/stmmac/norm_desc.c:138:6: warning: variable 'bfsize1' set but not used [-Wunused-but-set-variable]

Like enh_desc_init_rx_desc, we should use bfsize1
in ndesc_init_rx_desc to calculate 'p->des1'

Fixes: 583e63614149 ("net: stmmac: use correct DMA buffer size in the RX descriptor")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/net/ethernet/stmicro/stmmac/norm_desc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
index b7dd4e3..6d69067 100644
--- a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
+++ b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
@@ -140,7 +140,7 @@ static void ndesc_init_rx_desc(struct dma_desc *p, int disable_rx_ic, int mode,
 	p->des0 |= cpu_to_le32(RDES0_OWN);
 
 	bfsize1 = min(bfsize, BUF_SIZE_2KiB - 1);
-	p->des1 |= cpu_to_le32(bfsize & RDES1_BUFFER1_SIZE_MASK);
+	p->des1 |= cpu_to_le32(bfsize1 & RDES1_BUFFER1_SIZE_MASK);
 
 	if (mode == STMMAC_CHAIN_MODE)
 		ndesc_rx_set_on_chain(p, end);
-- 
2.7.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH] net: stmmac: Use bfsize1 in ndesc_init_rx_desc
  2019-04-17  1:49 [PATCH] net: stmmac: Use bfsize1 in ndesc_init_rx_desc Yue Haibing
@ 2019-04-17 12:14 ` Koskinen, Aaro (Nokia - FI/Espoo)
  2019-04-18  6:21 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Koskinen, Aaro (Nokia - FI/Espoo) @ 2019-04-17 12:14 UTC (permalink / raw)
  To: Yue Haibing, peppe.cavallaro, alexandre.torgue, joabreu, davem,
	mcoquelin.stm32
  Cc: linux-kernel, linux-arm-kernel, linux-stm32, netdev

Hi,

From: Yue Haibing [yuehaibing@huawei.com]
> gcc warn this:
>
> drivers/net/ethernet/stmicro/stmmac/norm_desc.c: In function ndesc_init_rx_desc:
> drivers/net/ethernet/stmicro/stmmac/norm_desc.c:138:6: warning: variable 'bfsize1' set but not used [-Wunused-but-set-variable]
>
> Like enh_desc_init_rx_desc, we should use bfsize1
> in ndesc_init_rx_desc to calculate 'p->des1'
>
> Fixes: 583e63614149 ("net: stmmac: use correct DMA buffer size in the RX descriptor")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Reviewed-by: Aaro Koskinen <aaro.koskinen@nokia.com>

Thanks, looks like GCC 6.3.0 missed this.

A.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] net: stmmac: Use bfsize1 in ndesc_init_rx_desc
  2019-04-17  1:49 [PATCH] net: stmmac: Use bfsize1 in ndesc_init_rx_desc Yue Haibing
  2019-04-17 12:14 ` Koskinen, Aaro (Nokia - FI/Espoo)
@ 2019-04-18  6:21 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2019-04-18  6:21 UTC (permalink / raw)
  To: yuehaibing
  Cc: peppe.cavallaro, alexandre.torgue, joabreu, mcoquelin.stm32,
	aaro.koskinen, linux-kernel, linux-arm-kernel, linux-stm32,
	netdev

From: Yue Haibing <yuehaibing@huawei.com>
Date: Wed, 17 Apr 2019 09:49:39 +0800

> From: YueHaibing <yuehaibing@huawei.com>
> 
> gcc warn this:
> 
> drivers/net/ethernet/stmicro/stmmac/norm_desc.c: In function ndesc_init_rx_desc:
> drivers/net/ethernet/stmicro/stmmac/norm_desc.c:138:6: warning: variable 'bfsize1' set but not used [-Wunused-but-set-variable]
> 
> Like enh_desc_init_rx_desc, we should use bfsize1
> in ndesc_init_rx_desc to calculate 'p->des1'
> 
> Fixes: 583e63614149 ("net: stmmac: use correct DMA buffer size in the RX descriptor")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Applied, thank you.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-04-18  6:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-17  1:49 [PATCH] net: stmmac: Use bfsize1 in ndesc_init_rx_desc Yue Haibing
2019-04-17 12:14 ` Koskinen, Aaro (Nokia - FI/Espoo)
2019-04-18  6:21 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).