netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Varka Bhadram <varkabhadram@gmail.com>
To: Neil Armstrong <superna9999@gmail.com>,
	Nicolas Ferre <nicolas.ferre@atmel.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] net: macb: Separate rx and tx ring init function
Date: Fri, 18 Jul 2014 15:45:24 +0530	[thread overview]
Message-ID: <53C8F3BC.4060607@gmail.com> (raw)
In-Reply-To: <53C8F34D.9090503@gmail.com>

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@neotion.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.

      reply	other threads:[~2014-07-18 10:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-18  9:52 [PATCH 1/2] net: macb: Separate rx and tx ring init function Neil Armstrong
2014-07-18 10:10 ` Varka Bhadram
2014-07-18 10:13   ` Neil Armstrong
2014-07-18 10:15     ` Varka Bhadram [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53C8F3BC.4060607@gmail.com \
    --to=varkabhadram@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.ferre@atmel.com \
    --cc=superna9999@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).