Skip to content

Commit a4328dd

Browse files
hkallweitdavem330
authored andcommitted
r8169: drop member txd_version from struct rtl8169_private
txd_version is used in rtl_init_one() only, so we can drop member txd_version from struct rtl8169_private. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 90b989c commit a4328dd

File tree

1 file changed

+7
-5
lines changed
  • drivers/net/ethernet/realtek

1 file changed

+7
-5
lines changed

drivers/net/ethernet/realtek/r8169.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,6 @@ struct rtl8169_private {
776776
struct net_device *dev;
777777
struct napi_struct napi;
778778
u32 msg_enable;
779-
u16 txd_version;
780779
u16 mac_version;
781780
u32 cur_rx; /* Index into the Rx descriptor buffer of next Rx pkt. */
782781
u32 cur_tx; /* Index into the Tx descriptor buffer of next Rx pkt. */
@@ -8214,7 +8213,6 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
82148213
rtl8169_print_mac_version(tp);
82158214

82168215
chipset = tp->mac_version;
8217-
tp->txd_version = rtl_chip_infos[chipset].txd_version;
82188216

82198217
rc = rtl_alloc_irq(tp);
82208218
if (rc < 0) {
@@ -8299,13 +8297,17 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
82998297
/* Disallow toggling */
83008298
dev->hw_features &= ~NETIF_F_HW_VLAN_CTAG_RX;
83018299

8302-
if (tp->txd_version == RTL_TD_0)
8300+
switch (rtl_chip_infos[chipset].txd_version) {
8301+
case RTL_TD_0:
83038302
tp->tso_csum = rtl8169_tso_csum_v1;
8304-
else if (tp->txd_version == RTL_TD_1) {
8303+
break;
8304+
case RTL_TD_1:
83058305
tp->tso_csum = rtl8169_tso_csum_v2;
83068306
dev->hw_features |= NETIF_F_IPV6_CSUM | NETIF_F_TSO6;
8307-
} else
8307+
break;
8308+
default:
83088309
WARN_ON_ONCE(1);
8310+
}
83098311

83108312
dev->hw_features |= NETIF_F_RXALL;
83118313
dev->hw_features |= NETIF_F_RXFCS;

0 commit comments

Comments
 (0)