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] [day] [month] [year] [list]
Message-ID: <53C8F3BC.4060607@gmail.com>
Date:	Fri, 18 Jul 2014 15:45:24 +0530
From:	Varka Bhadram <varkabhadram@...il.com>
To:	Neil Armstrong <superna9999@...il.com>,
	Nicolas Ferre <nicolas.ferre@...el.com>,
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] net: macb: Separate rx and tx ring init function

On 07/18/2014 03:43 PM, Neil Armstrong wrote:
> Le 18/07/2014 12:10, Varka Bhadram a écrit :
>> On 07/18/2014 03:22 PM, Neil Armstrong wrote:
>>> A single method is called to initialize the TX and RX
>>> rings. Separate the methods into distinct ones for
>>> MACB and GEM context.
>>>
>>> Signed-off-by: Neil Armstrong <narmstrong@...tion.com>
>>> ---
>>>    drivers/net/ethernet/cadence/macb.c |   33 ++++++++++++++++++++++++---------
>>>    drivers/net/ethernet/cadence/macb.h |    3 ++-
>>>    2 files changed, 26 insertions(+), 10 deletions(-)
>>>
>>> diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
>>> index e9daa07..20ad483 100644
>>> --- a/drivers/net/ethernet/cadence/macb.c
>>> +++ b/drivers/net/ethernet/cadence/macb.c
>>> @@ -1219,7 +1219,14 @@ out_err:
>>>    	return -ENOMEM;
>>>    }
>>>    
>>> -static void gem_init_rings(struct macb *bp)
>>> +static void gem_init_rx_rings(struct macb *bp)
>>> +{
>>> +	bp->rx_tail = bp->rx_prepared_head = 0;
>>> +
>>> +	gem_rx_refill(bp);
>>> +}
>>> +
>>> +static void gem_init_tx_rings(struct macb *bp)
>>>    {
>>>    	int i;
>>>    
>>> @@ -1229,12 +1236,10 @@ static void gem_init_rings(struct macb *bp)
>>>    	}
>>>    	bp->tx_ring[TX_RING_SIZE - 1].ctrl |= MACB_BIT(TX_WRAP);
>>>    
>>> -	bp->rx_tail = bp->rx_prepared_head = bp->tx_head = bp->tx_tail = 0;
>>> -
>>> -	gem_rx_refill(bp);
>>> +	bp->tx_head = bp->tx_tail = 0;
>> This is not the preferred way of doing it....
>>
>> multiple assignments should be avoided
> Should I change it ? I only moved the lines, the logic hasn't changed.
>
Yes. we can change the logic also....  :-)

-- 
Regards,
Varka Bhadram.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ