@@ -1472,19 +1472,19 @@ static void rtl8168_driver_stop(struct rtl8169_private *tp)
1472
1472
}
1473
1473
}
1474
1474
1475
- static int r8168dp_check_dash (struct rtl8169_private * tp )
1475
+ static bool r8168dp_check_dash (struct rtl8169_private * tp )
1476
1476
{
1477
1477
u16 reg = rtl8168_get_ocp_reg (tp );
1478
1478
1479
- return (ocp_read (tp , 0x0f , reg ) & 0x00008000 ) ? 1 : 0 ;
1479
+ return !! (ocp_read (tp , 0x0f , reg ) & 0x00008000 );
1480
1480
}
1481
1481
1482
- static int r8168ep_check_dash (struct rtl8169_private * tp )
1482
+ static bool r8168ep_check_dash (struct rtl8169_private * tp )
1483
1483
{
1484
- return (ocp_read (tp , 0x0f , 0x128 ) & 0x00000001 ) ? 1 : 0 ;
1484
+ return !! (ocp_read (tp , 0x0f , 0x128 ) & 0x00000001 );
1485
1485
}
1486
1486
1487
- static int r8168_check_dash (struct rtl8169_private * tp )
1487
+ static bool r8168_check_dash (struct rtl8169_private * tp )
1488
1488
{
1489
1489
switch (tp -> mac_version ) {
1490
1490
case RTL_GIGA_MAC_VER_27 :
@@ -1496,7 +1496,7 @@ static int r8168_check_dash(struct rtl8169_private *tp)
1496
1496
case RTL_GIGA_MAC_VER_51 :
1497
1497
return r8168ep_check_dash (tp );
1498
1498
default :
1499
- return 0 ;
1499
+ return false ;
1500
1500
}
1501
1501
}
1502
1502
@@ -4982,15 +4982,8 @@ static void r8168_pll_power_down(struct rtl8169_private *tp)
4982
4982
{
4983
4983
void __iomem * ioaddr = tp -> mmio_addr ;
4984
4984
4985
- if ((tp -> mac_version == RTL_GIGA_MAC_VER_27 ||
4986
- tp -> mac_version == RTL_GIGA_MAC_VER_28 ||
4987
- tp -> mac_version == RTL_GIGA_MAC_VER_31 ||
4988
- tp -> mac_version == RTL_GIGA_MAC_VER_49 ||
4989
- tp -> mac_version == RTL_GIGA_MAC_VER_50 ||
4990
- tp -> mac_version == RTL_GIGA_MAC_VER_51 ) &&
4991
- r8168_check_dash (tp )) {
4985
+ if (r8168_check_dash (tp ))
4992
4986
return ;
4993
- }
4994
4987
4995
4988
if ((tp -> mac_version == RTL_GIGA_MAC_VER_23 ||
4996
4989
tp -> mac_version == RTL_GIGA_MAC_VER_24 ) &&
@@ -8202,15 +8195,8 @@ static void rtl_remove_one(struct pci_dev *pdev)
8202
8195
struct net_device * dev = pci_get_drvdata (pdev );
8203
8196
struct rtl8169_private * tp = netdev_priv (dev );
8204
8197
8205
- if ((tp -> mac_version == RTL_GIGA_MAC_VER_27 ||
8206
- tp -> mac_version == RTL_GIGA_MAC_VER_28 ||
8207
- tp -> mac_version == RTL_GIGA_MAC_VER_31 ||
8208
- tp -> mac_version == RTL_GIGA_MAC_VER_49 ||
8209
- tp -> mac_version == RTL_GIGA_MAC_VER_50 ||
8210
- tp -> mac_version == RTL_GIGA_MAC_VER_51 ) &&
8211
- r8168_check_dash (tp )) {
8198
+ if (r8168_check_dash (tp ))
8212
8199
rtl8168_driver_stop (tp );
8213
- }
8214
8200
8215
8201
netif_napi_del (& tp -> napi );
8216
8202
@@ -8640,15 +8626,8 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
8640
8626
rtl_chip_infos [chipset ].jumbo_tx_csum ? "ok" : "ko" );
8641
8627
}
8642
8628
8643
- if ((tp -> mac_version == RTL_GIGA_MAC_VER_27 ||
8644
- tp -> mac_version == RTL_GIGA_MAC_VER_28 ||
8645
- tp -> mac_version == RTL_GIGA_MAC_VER_31 ||
8646
- tp -> mac_version == RTL_GIGA_MAC_VER_49 ||
8647
- tp -> mac_version == RTL_GIGA_MAC_VER_50 ||
8648
- tp -> mac_version == RTL_GIGA_MAC_VER_51 ) &&
8649
- r8168_check_dash (tp )) {
8629
+ if (r8168_check_dash (tp ))
8650
8630
rtl8168_driver_start (tp );
8651
- }
8652
8631
8653
8632
netif_carrier_off (dev );
8654
8633
0 commit comments