net: ethernet: mediatek: get hw lro capability by the chip id instead of by the dtsi
Subsystems (3)
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:[email protected]]
Sent: Wednesday, October 05, 2016 9:07 PM
To: Nelson Chang (張家祥); [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]
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
Quoted 7 lines
Sent: 05 October 2016 13:46
Review
Quoted 5 lines
(quoted diff) +5
-0+static bool mtk_is_hwlro_supported(struct mtk_eth *eth) { + if (eth->chip_id == MT7623_ETH) + return true; + else + return false;
Quoted 8 lines
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