[PATCH] staging: mt7621-eth: Remove unused variable

NeilBrown neil at brown.name
Tue May 15 00:41:36 UTC 2018


On Mon, May 14 2018, Kamal Heib wrote:

> Remove unused variable 'condition' which was set but not used.
>
> Signed-off-by: Kamal Heib <kamalheib1 at gmail.com>

Reviewed-by: NeilBrown <neil at brown.name>

This is the same patch as

Commit: f03b06f3bae8 ("net: ethernet: mediatek: remove useless code in mtk_poll_tx()")

which applies to drivers/net/ethernet/mediatek/mtk_eth_soc.c
It would be really good to migrate the staging driver to be close to
the main line drivers so that the differences become obvious.
My understanding is that the mainline driver is written/tested for
ARM SOCs, and the staging driver works on (nearly) the same ethernet
controller in MIPS SOCs.
One difference that I noticed is that in the ARM there appear to be
separate interrupts for send and receive.  In the MIPS there is just
one.
Also the MIPS driver has both "pdma" (paged DMA I think) and "qdma"
(which might be quick DMA).  The ARM only has qdma.
I couldn't make the MIPS work with qdma, though I didn't try very hard.
John Crispin wrote:

    There are 2 types of DMA engine, PDMA and the newer QDMA. PDMA uses a
    typical ring buffer while QDMA uses a linked list. Unfortunatley we have
    the MT7621 which has a few silicon issues. Due to these issues we need to
    PDMA for RX and QDMA for TX. All SoCs newer than the MT7621 can can run on
    QDMA exclusively.
    
so we would eventually need to add PDMA to the mainline driver, but and
make the QDMA in the staging drive looks exactly like the QDMA in th
mainline driver.

The other issue here is interfacing with drivers/net/dsa/mt7530.c 
That might not be difficult, but I haven't had a chance to look at the
code yet.

Thanks for your contributions and anything else you might contribute in
any of these areas.
NeilBrown


> ---
>  drivers/staging/mt7621-eth/mtk_eth_soc.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/staging/mt7621-eth/mtk_eth_soc.c b/drivers/staging/mt7621-eth/mtk_eth_soc.c
> index 86209b3d0a0e..2c7a2e666bfb 100644
> --- a/drivers/staging/mt7621-eth/mtk_eth_soc.c
> +++ b/drivers/staging/mt7621-eth/mtk_eth_soc.c
> @@ -1194,7 +1194,6 @@ static int mtk_qdma_tx_poll(struct mtk_eth *eth, int budget, bool *tx_again)
>  	int total = 0, done[MTK_MAX_DEVS];
>  	unsigned int bytes[MTK_MAX_DEVS];
>  	u32 cpu, dma;
> -	static int condition;
>  	int i;
>  
>  	memset(done, 0, sizeof(done));
> @@ -1219,10 +1218,8 @@ static int mtk_qdma_tx_poll(struct mtk_eth *eth, int budget, bool *tx_again)
>  
>  		tx_buf = mtk_desc_to_tx_buf(ring, desc);
>  		skb = tx_buf->skb;
> -		if (!skb) {
> -			condition = 1;
> +		if (!skb)
>  			break;
> -		}
>  
>  		if (skb != (struct sk_buff *)DMA_DUMMY_DESC) {
>  			bytes[mac] += skb->len;
> -- 
> 2.14.3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/attachments/20180515/fc571b99/attachment-0001.asc>


More information about the devel mailing list