public inbox for linux-mediatek@lists.infradead.org
 help / color / mirror / Atom feed
From: Nelson Chang <nelson.chang@mediatek.com>
To: David.Laight@ACULAB.COM, sergei.shtylyov@cogentembedded.com,
	john@phrozen.org, davem@davemloft.net
Cc: nbd@openwrt.org, netdev@vger.kernel.org,
	linux-mediatek@lists.infradead.org, nelsonch.tw@gmail.com
Subject: RE: [PATCH net-next v2 2/3] net: ethernet: mediatek: get hw lro capability by the chip id instead of by the dtsi
Date: Wed, 5 Oct 2016 21:21:18 +0800	[thread overview]
Message-ID: <1475673678.6101.11.camel@mtksdaap41> (raw)

Hi Sergei, David,

I think modifying that as below is clear and scalable. Agree?

static bool mtk_is_hwlro_supported(struct mtk_eth *eth)
{
	switch (eth->chip_id) {
	case MT7623_ETH:
		return true;
	}

	return false;
}

Thanks.


Nelson
-----Original Message-----
From: David Laight [mailto:David.Laight@ACULAB.COM] 
Sent: Wednesday, October 05, 2016 9:07 PM
To: Nelson Chang (張家祥); sergei.shtylyov@cogentembedded.com;
john@phrozen.org; davem@davemloft.net
Cc: nbd@openwrt.org; netdev@vger.kernel.org;
linux-mediatek@lists.infradead.org; nelsonch.tw@gmail.com
Subject: RE: [PATCH net-next v2 2/3] net: ethernet: mediatek: get hw lro
capability by the chip id instead of by the dtsi

From: Nelson Chang
> Sent: 05 October 2016 13:46
> > +static bool mtk_is_hwlro_supported(struct mtk_eth *eth) {
> > +     if (eth->chip_id == MT7623_ETH)
> > +             return true;
> > +     else
> > +             return false;
> 
>         return eth->chip_id == MT7623_ETH;
> 
> => Since there will be more chips support hw lro in the future, keep 
> the original codes to have the scalability like this:
> if (eth->chip_id == MTxxxx_ETH ||
>     eth->chip_id == MTyyyy_ETH ||
>     ....)
> 	return true;

Nothing wrong with:

	return eth->chip_id == MTxxxx_ETH ||
		eth->chip_id == MTyyyy_ETH;

	David

             reply	other threads:[~2016-10-05 13:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-05 13:21 Nelson Chang [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-10-05 12:46 [PATCH net-next v2 2/3] net: ethernet: mediatek: get hw lro capability by the chip id instead of by the dtsi Nelson Chang
2016-10-05 12:57 ` Sergei Shtylyov
2016-10-05 13:07 ` David Laight
2016-10-05 12:38 Nelson Chang
2016-10-05 12:12 [PATCH net-next v2 0/3] net: ethernet: mediatek: check the hw lro capability by the chip id instead of " Nelson Chang
2016-10-05 12:12 ` [PATCH net-next v2 2/3] net: ethernet: mediatek: get hw lro capability by the chip id instead of by " Nelson Chang
2016-10-05 12:18   ` Sergei Shtylyov

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=1475673678.6101.11.camel@mtksdaap41 \
    --to=nelson.chang@mediatek.com \
    --cc=David.Laight@ACULAB.COM \
    --cc=davem@davemloft.net \
    --cc=john@phrozen.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=nbd@openwrt.org \
    --cc=nelsonch.tw@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=sergei.shtylyov@cogentembedded.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