Commit 6cfbd97b authored by Jeff Kirsher's avatar Jeff Kirsher

e1000: fix whitespace issues and multi-line comments

Fixes whitespace issues, such as lines exceeding 80 chars, needless blank
lines and the use of spaces where tabs are needed.  In addition, fix
multi-line comments to align with the networking standard.
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
parent efd9450e
...@@ -142,7 +142,8 @@ struct e1000_adapter; ...@@ -142,7 +142,8 @@ struct e1000_adapter;
#define E1000_MNG_VLAN_NONE (-1) #define E1000_MNG_VLAN_NONE (-1)
/* wrapper around a pointer to a socket buffer, /* wrapper around a pointer to a socket buffer,
* so a DMA handle can be stored along with the buffer */ * so a DMA handle can be stored along with the buffer
*/
struct e1000_buffer { struct e1000_buffer {
struct sk_buff *skb; struct sk_buff *skb;
dma_addr_t dma; dma_addr_t dma;
......
...@@ -161,8 +161,8 @@ static int e1000_get_settings(struct net_device *netdev, ...@@ -161,8 +161,8 @@ static int e1000_get_settings(struct net_device *netdev,
ethtool_cmd_speed_set(ecmd, adapter->link_speed); ethtool_cmd_speed_set(ecmd, adapter->link_speed);
/* unfortunately FULL_DUPLEX != DUPLEX_FULL /* unfortunately FULL_DUPLEX != DUPLEX_FULL
* and HALF_DUPLEX != DUPLEX_HALF */ * and HALF_DUPLEX != DUPLEX_HALF
*/
if (adapter->link_duplex == FULL_DUPLEX) if (adapter->link_duplex == FULL_DUPLEX)
ecmd->duplex = DUPLEX_FULL; ecmd->duplex = DUPLEX_FULL;
else else
...@@ -179,8 +179,7 @@ static int e1000_get_settings(struct net_device *netdev, ...@@ -179,8 +179,7 @@ static int e1000_get_settings(struct net_device *netdev,
if ((hw->media_type == e1000_media_type_copper) && if ((hw->media_type == e1000_media_type_copper) &&
netif_carrier_ok(netdev)) netif_carrier_ok(netdev))
ecmd->eth_tp_mdix = (!!adapter->phy_info.mdix_mode ? ecmd->eth_tp_mdix = (!!adapter->phy_info.mdix_mode ?
ETH_TP_MDI_X : ETH_TP_MDI_X : ETH_TP_MDI);
ETH_TP_MDI);
else else
ecmd->eth_tp_mdix = ETH_TP_MDI_INVALID; ecmd->eth_tp_mdix = ETH_TP_MDI_INVALID;
...@@ -197,8 +196,7 @@ static int e1000_set_settings(struct net_device *netdev, ...@@ -197,8 +196,7 @@ static int e1000_set_settings(struct net_device *netdev,
struct e1000_adapter *adapter = netdev_priv(netdev); struct e1000_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
/* /* MDI setting is only allowed when autoneg enabled because
* MDI setting is only allowed when autoneg enabled because
* some hardware doesn't allow MDI setting when speed or * some hardware doesn't allow MDI setting when speed or
* duplex is forced. * duplex is forced.
*/ */
...@@ -260,8 +258,7 @@ static u32 e1000_get_link(struct net_device *netdev) ...@@ -260,8 +258,7 @@ static u32 e1000_get_link(struct net_device *netdev)
{ {
struct e1000_adapter *adapter = netdev_priv(netdev); struct e1000_adapter *adapter = netdev_priv(netdev);
/* /* If the link is not reported up to netdev, interrupts are disabled,
* If the link is not reported up to netdev, interrupts are disabled,
* and so the physical link state may have changed since we last * and so the physical link state may have changed since we last
* looked. Set get_link_status to make sure that the true link * looked. Set get_link_status to make sure that the true link
* state is interrogated, rather than pulling a cached and possibly * state is interrogated, rather than pulling a cached and possibly
...@@ -517,15 +514,17 @@ static int e1000_set_eeprom(struct net_device *netdev, ...@@ -517,15 +514,17 @@ static int e1000_set_eeprom(struct net_device *netdev,
ptr = (void *)eeprom_buff; ptr = (void *)eeprom_buff;
if (eeprom->offset & 1) { if (eeprom->offset & 1) {
/* need read/modify/write of first changed EEPROM word */ /* need read/modify/write of first changed EEPROM word
/* only the second byte of the word is being modified */ * only the second byte of the word is being modified
*/
ret_val = e1000_read_eeprom(hw, first_word, 1, ret_val = e1000_read_eeprom(hw, first_word, 1,
&eeprom_buff[0]); &eeprom_buff[0]);
ptr++; ptr++;
} }
if (((eeprom->offset + eeprom->len) & 1) && (ret_val == 0)) { if (((eeprom->offset + eeprom->len) & 1) && (ret_val == 0)) {
/* need read/modify/write of last changed EEPROM word */ /* need read/modify/write of last changed EEPROM word
/* only the first byte of the word is being modified */ * only the first byte of the word is being modified
*/
ret_val = e1000_read_eeprom(hw, last_word, 1, ret_val = e1000_read_eeprom(hw, last_word, 1,
&eeprom_buff[last_word - first_word]); &eeprom_buff[last_word - first_word]);
} }
...@@ -606,11 +605,13 @@ static int e1000_set_ringparam(struct net_device *netdev, ...@@ -606,11 +605,13 @@ static int e1000_set_ringparam(struct net_device *netdev,
rx_old = adapter->rx_ring; rx_old = adapter->rx_ring;
err = -ENOMEM; err = -ENOMEM;
txdr = kcalloc(adapter->num_tx_queues, sizeof(struct e1000_tx_ring), GFP_KERNEL); txdr = kcalloc(adapter->num_tx_queues, sizeof(struct e1000_tx_ring),
GFP_KERNEL);
if (!txdr) if (!txdr)
goto err_alloc_tx; goto err_alloc_tx;
rxdr = kcalloc(adapter->num_rx_queues, sizeof(struct e1000_rx_ring), GFP_KERNEL); rxdr = kcalloc(adapter->num_rx_queues, sizeof(struct e1000_rx_ring),
GFP_KERNEL);
if (!rxdr) if (!rxdr)
goto err_alloc_rx; goto err_alloc_rx;
...@@ -642,7 +643,8 @@ static int e1000_set_ringparam(struct net_device *netdev, ...@@ -642,7 +643,8 @@ static int e1000_set_ringparam(struct net_device *netdev,
goto err_setup_tx; goto err_setup_tx;
/* save the new, restore the old in order to free it, /* save the new, restore the old in order to free it,
* then restore the new back again */ * then restore the new back again
*/
adapter->rx_ring = rx_old; adapter->rx_ring = rx_old;
adapter->tx_ring = tx_old; adapter->tx_ring = tx_old;
...@@ -784,7 +786,6 @@ static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data) ...@@ -784,7 +786,6 @@ static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data)
REG_SET_AND_CHECK(TCTL, 0xFFFFFFFF, 0x00000000); REG_SET_AND_CHECK(TCTL, 0xFFFFFFFF, 0x00000000);
if (hw->mac_type >= e1000_82543) { if (hw->mac_type >= e1000_82543) {
REG_SET_AND_CHECK(RCTL, before, 0xFFFFFFFF); REG_SET_AND_CHECK(RCTL, before, 0xFFFFFFFF);
REG_PATTERN_TEST(RDBAL, 0xFFFFFFF0, 0xFFFFFFFF); REG_PATTERN_TEST(RDBAL, 0xFFFFFFF0, 0xFFFFFFFF);
REG_PATTERN_TEST(TXCW, 0xC000FFFF, 0x0000FFFF); REG_PATTERN_TEST(TXCW, 0xC000FFFF, 0x0000FFFF);
...@@ -795,14 +796,11 @@ static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data) ...@@ -795,14 +796,11 @@ static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data)
REG_PATTERN_TEST(RA + (((i << 1) + 1) << 2), 0x8003FFFF, REG_PATTERN_TEST(RA + (((i << 1) + 1) << 2), 0x8003FFFF,
0xFFFFFFFF); 0xFFFFFFFF);
} }
} else { } else {
REG_SET_AND_CHECK(RCTL, 0xFFFFFFFF, 0x01FFFFFF); REG_SET_AND_CHECK(RCTL, 0xFFFFFFFF, 0x01FFFFFF);
REG_PATTERN_TEST(RDBAL, 0xFFFFF000, 0xFFFFFFFF); REG_PATTERN_TEST(RDBAL, 0xFFFFF000, 0xFFFFFFFF);
REG_PATTERN_TEST(TXCW, 0x0000FFFF, 0x0000FFFF); REG_PATTERN_TEST(TXCW, 0x0000FFFF, 0x0000FFFF);
REG_PATTERN_TEST(TDBAL, 0xFFFFF000, 0xFFFFFFFF); REG_PATTERN_TEST(TDBAL, 0xFFFFF000, 0xFFFFFFFF);
} }
value = E1000_MC_TBL_SIZE; value = E1000_MC_TBL_SIZE;
...@@ -858,8 +856,9 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data) ...@@ -858,8 +856,9 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data)
*data = 0; *data = 0;
/* NOTE: we don't test MSI interrupts here, yet */ /* NOTE: we don't test MSI interrupts here, yet
/* Hook up test interrupt handler just for this test */ * Hook up test interrupt handler just for this test
*/
if (!request_irq(irq, e1000_test_intr, IRQF_PROBE_SHARED, netdev->name, if (!request_irq(irq, e1000_test_intr, IRQF_PROBE_SHARED, netdev->name,
netdev)) netdev))
shared_int = false; shared_int = false;
...@@ -1260,7 +1259,8 @@ static int e1000_integrated_phy_loopback(struct e1000_adapter *adapter) ...@@ -1260,7 +1259,8 @@ static int e1000_integrated_phy_loopback(struct e1000_adapter *adapter)
ctrl_reg |= E1000_CTRL_ILOS; /* Invert Loss of Signal */ ctrl_reg |= E1000_CTRL_ILOS; /* Invert Loss of Signal */
else { else {
/* Set the ILOS bit on the fiber Nic is half /* Set the ILOS bit on the fiber Nic is half
* duplex link is detected. */ * duplex link is detected.
*/
stat_reg = er32(STATUS); stat_reg = er32(STATUS);
if ((stat_reg & E1000_STATUS_FD) == 0) if ((stat_reg & E1000_STATUS_FD) == 0)
ctrl_reg |= (E1000_CTRL_ILOS | E1000_CTRL_SLU); ctrl_reg |= (E1000_CTRL_ILOS | E1000_CTRL_SLU);
...@@ -1493,7 +1493,8 @@ static int e1000_link_test(struct e1000_adapter *adapter, u64 *data) ...@@ -1493,7 +1493,8 @@ static int e1000_link_test(struct e1000_adapter *adapter, u64 *data)
hw->serdes_has_link = false; hw->serdes_has_link = false;
/* On some blade server designs, link establishment /* On some blade server designs, link establishment
* could take as long as 2-3 minutes */ * could take as long as 2-3 minutes
*/
do { do {
e1000_check_for_link(hw); e1000_check_for_link(hw);
if (hw->serdes_has_link) if (hw->serdes_has_link)
...@@ -1545,7 +1546,8 @@ static void e1000_diag_test(struct net_device *netdev, ...@@ -1545,7 +1546,8 @@ static void e1000_diag_test(struct net_device *netdev,
e_info(hw, "offline testing starting\n"); e_info(hw, "offline testing starting\n");
/* Link test performed before hardware reset so autoneg doesn't /* Link test performed before hardware reset so autoneg doesn't
* interfere with test result */ * interfere with test result
*/
if (e1000_link_test(adapter, &data[4])) if (e1000_link_test(adapter, &data[4]))
eth_test->flags |= ETH_TEST_FL_FAILED; eth_test->flags |= ETH_TEST_FL_FAILED;
...@@ -1639,7 +1641,8 @@ static int e1000_wol_exclusion(struct e1000_adapter *adapter, ...@@ -1639,7 +1641,8 @@ static int e1000_wol_exclusion(struct e1000_adapter *adapter,
default: default:
/* dual port cards only support WoL on port A from now on /* dual port cards only support WoL on port A from now on
* unless it was enabled in the eeprom for port B * unless it was enabled in the eeprom for port B
* so exclude FUNC_1 ports from having WoL enabled */ * so exclude FUNC_1 ports from having WoL enabled
*/
if (er32(STATUS) & E1000_STATUS_FUNC_1 && if (er32(STATUS) & E1000_STATUS_FUNC_1 &&
!adapter->eeprom_wol) { !adapter->eeprom_wol) {
wol->supported = 0; wol->supported = 0;
...@@ -1663,7 +1666,8 @@ static void e1000_get_wol(struct net_device *netdev, ...@@ -1663,7 +1666,8 @@ static void e1000_get_wol(struct net_device *netdev,
wol->wolopts = 0; wol->wolopts = 0;
/* this function will set ->supported = 0 and return 1 if wol is not /* this function will set ->supported = 0 and return 1 if wol is not
* supported by this hardware */ * supported by this hardware
*/
if (e1000_wol_exclusion(adapter, wol) || if (e1000_wol_exclusion(adapter, wol) ||
!device_can_wakeup(&adapter->pdev->dev)) !device_can_wakeup(&adapter->pdev->dev))
return; return;
...@@ -1859,7 +1863,7 @@ static void e1000_get_strings(struct net_device *netdev, u32 stringset, ...@@ -1859,7 +1863,7 @@ static void e1000_get_strings(struct net_device *netdev, u32 stringset,
ETH_GSTRING_LEN); ETH_GSTRING_LEN);
p += ETH_GSTRING_LEN; p += ETH_GSTRING_LEN;
} }
/* BUG_ON(p - data != E1000_STATS_LEN * ETH_GSTRING_LEN); */ /* BUG_ON(p - data != E1000_STATS_LEN * ETH_GSTRING_LEN); */
break; break;
} }
} }
......
This diff is collapsed.
...@@ -267,7 +267,6 @@ static void e1000_check_copper_options(struct e1000_adapter *adapter); ...@@ -267,7 +267,6 @@ static void e1000_check_copper_options(struct e1000_adapter *adapter);
* value exists, a default value is used. The final value is stored * value exists, a default value is used. The final value is stored
* in a variable in the adapter structure. * in a variable in the adapter structure.
**/ **/
void e1000_check_options(struct e1000_adapter *adapter) void e1000_check_options(struct e1000_adapter *adapter)
{ {
struct e1000_option opt; struct e1000_option opt;
...@@ -319,7 +318,8 @@ void e1000_check_options(struct e1000_adapter *adapter) ...@@ -319,7 +318,8 @@ void e1000_check_options(struct e1000_adapter *adapter)
.def = E1000_DEFAULT_RXD, .def = E1000_DEFAULT_RXD,
.arg = { .r = { .arg = { .r = {
.min = E1000_MIN_RXD, .min = E1000_MIN_RXD,
.max = mac_type < e1000_82544 ? E1000_MAX_RXD : E1000_MAX_82544_RXD .max = mac_type < e1000_82544 ? E1000_MAX_RXD :
E1000_MAX_82544_RXD
}} }}
}; };
...@@ -488,7 +488,8 @@ void e1000_check_options(struct e1000_adapter *adapter) ...@@ -488,7 +488,8 @@ void e1000_check_options(struct e1000_adapter *adapter)
/* save the setting, because the dynamic bits /* save the setting, because the dynamic bits
* change itr. * change itr.
* clear the lower two bits because they are * clear the lower two bits because they are
* used as control */ * used as control
*/
adapter->itr_setting = adapter->itr & ~3; adapter->itr_setting = adapter->itr & ~3;
break; break;
} }
...@@ -533,7 +534,6 @@ void e1000_check_options(struct e1000_adapter *adapter) ...@@ -533,7 +534,6 @@ void e1000_check_options(struct e1000_adapter *adapter)
* *
* Handles speed and duplex options on fiber adapters * Handles speed and duplex options on fiber adapters
**/ **/
static void e1000_check_fiber_options(struct e1000_adapter *adapter) static void e1000_check_fiber_options(struct e1000_adapter *adapter)
{ {
int bd = adapter->bd_number; int bd = adapter->bd_number;
...@@ -559,7 +559,6 @@ static void e1000_check_fiber_options(struct e1000_adapter *adapter) ...@@ -559,7 +559,6 @@ static void e1000_check_fiber_options(struct e1000_adapter *adapter)
* *
* Handles speed and duplex options on copper adapters * Handles speed and duplex options on copper adapters
**/ **/
static void e1000_check_copper_options(struct e1000_adapter *adapter) static void e1000_check_copper_options(struct e1000_adapter *adapter)
{ {
struct e1000_option opt; struct e1000_option opt;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment