Commit 73cd78f1 authored by Alexander Duyck's avatar Alexander Duyck Committed by David S. Miller

igb: misc whitespace/formatting cleanups

This patch is intended to hold several whitespace, formatting, and
comment cleanups that have been found while cleaning up the igb driver.
Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@intel.com>
Acked-by: default avatarPeter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent eaf5d590
...@@ -1691,7 +1691,6 @@ static int igb_close(struct net_device *netdev) ...@@ -1691,7 +1691,6 @@ static int igb_close(struct net_device *netdev)
* *
* Return 0 on success, negative on failure * Return 0 on success, negative on failure
**/ **/
int igb_setup_tx_resources(struct igb_adapter *adapter, int igb_setup_tx_resources(struct igb_adapter *adapter,
struct igb_ring *tx_ring) struct igb_ring *tx_ring)
{ {
...@@ -1771,13 +1770,13 @@ static void igb_configure_tx(struct igb_adapter *adapter) ...@@ -1771,13 +1770,13 @@ static void igb_configure_tx(struct igb_adapter *adapter)
int i, j; int i, j;
for (i = 0; i < adapter->num_tx_queues; i++) { for (i = 0; i < adapter->num_tx_queues; i++) {
struct igb_ring *ring = &(adapter->tx_ring[i]); struct igb_ring *ring = &adapter->tx_ring[i];
j = ring->reg_idx; j = ring->reg_idx;
wr32(E1000_TDLEN(j), wr32(E1000_TDLEN(j),
ring->count * sizeof(struct e1000_tx_desc)); ring->count * sizeof(struct e1000_tx_desc));
tdba = ring->dma; tdba = ring->dma;
wr32(E1000_TDBAL(j), wr32(E1000_TDBAL(j),
tdba & 0x00000000ffffffffULL); tdba & 0x00000000ffffffffULL);
wr32(E1000_TDBAH(j), tdba >> 32); wr32(E1000_TDBAH(j), tdba >> 32);
ring->head = E1000_TDH(j); ring->head = E1000_TDH(j);
...@@ -1797,8 +1796,6 @@ static void igb_configure_tx(struct igb_adapter *adapter) ...@@ -1797,8 +1796,6 @@ static void igb_configure_tx(struct igb_adapter *adapter)
wr32(E1000_DCA_TXCTRL(j), txctrl); wr32(E1000_DCA_TXCTRL(j), txctrl);
} }
/* Use the default values for the Tx Inter Packet Gap (IPG) timer */ /* Use the default values for the Tx Inter Packet Gap (IPG) timer */
/* Program the Transmit Control Register */ /* Program the Transmit Control Register */
...@@ -1826,7 +1823,6 @@ static void igb_configure_tx(struct igb_adapter *adapter) ...@@ -1826,7 +1823,6 @@ static void igb_configure_tx(struct igb_adapter *adapter)
* *
* Returns 0 on success, negative on failure * Returns 0 on success, negative on failure
**/ **/
int igb_setup_rx_resources(struct igb_adapter *adapter, int igb_setup_rx_resources(struct igb_adapter *adapter,
struct igb_ring *rx_ring) struct igb_ring *rx_ring)
{ {
...@@ -1913,7 +1909,7 @@ static void igb_setup_rctl(struct igb_adapter *adapter) ...@@ -1913,7 +1909,7 @@ static void igb_setup_rctl(struct igb_adapter *adapter)
* enable stripping of CRC. It's unlikely this will break BMC * enable stripping of CRC. It's unlikely this will break BMC
* redirection as it did with e1000. Newer features require * redirection as it did with e1000. Newer features require
* that the HW strips the CRC. * that the HW strips the CRC.
*/ */
rctl |= E1000_RCTL_SECRC; rctl |= E1000_RCTL_SECRC;
/* /*
...@@ -1991,14 +1987,14 @@ static void igb_configure_rx(struct igb_adapter *adapter) ...@@ -1991,14 +1987,14 @@ static void igb_configure_rx(struct igb_adapter *adapter)
/* Setup the HW Rx Head and Tail Descriptor Pointers and /* Setup the HW Rx Head and Tail Descriptor Pointers and
* the Base and Length of the Rx Descriptor Ring */ * the Base and Length of the Rx Descriptor Ring */
for (i = 0; i < adapter->num_rx_queues; i++) { for (i = 0; i < adapter->num_rx_queues; i++) {
struct igb_ring *ring = &(adapter->rx_ring[i]); struct igb_ring *ring = &adapter->rx_ring[i];
j = ring->reg_idx; j = ring->reg_idx;
rdba = ring->dma; rdba = ring->dma;
wr32(E1000_RDBAL(j), wr32(E1000_RDBAL(j),
rdba & 0x00000000ffffffffULL); rdba & 0x00000000ffffffffULL);
wr32(E1000_RDBAH(j), rdba >> 32); wr32(E1000_RDBAH(j), rdba >> 32);
wr32(E1000_RDLEN(j), wr32(E1000_RDLEN(j),
ring->count * sizeof(union e1000_adv_rx_desc)); ring->count * sizeof(union e1000_adv_rx_desc));
ring->head = E1000_RDH(j); ring->head = E1000_RDH(j);
ring->tail = E1000_RDT(j); ring->tail = E1000_RDT(j);
...@@ -2136,6 +2132,7 @@ static void igb_unmap_and_free_tx_resource(struct igb_adapter *adapter, ...@@ -2136,6 +2132,7 @@ static void igb_unmap_and_free_tx_resource(struct igb_adapter *adapter,
buffer_info->skb = NULL; buffer_info->skb = NULL;
} }
buffer_info->time_stamp = 0; buffer_info->time_stamp = 0;
buffer_info->next_to_watch = 0;
/* buffer_info must be completely set up in the transmit path */ /* buffer_info must be completely set up in the transmit path */
} }
...@@ -2701,15 +2698,13 @@ static void igb_set_itr(struct igb_adapter *adapter) ...@@ -2701,15 +2698,13 @@ static void igb_set_itr(struct igb_adapter *adapter)
adapter->tx_itr, adapter->tx_itr,
adapter->tx_ring->total_packets, adapter->tx_ring->total_packets,
adapter->tx_ring->total_bytes); adapter->tx_ring->total_bytes);
current_itr = max(adapter->rx_itr, adapter->tx_itr); current_itr = max(adapter->rx_itr, adapter->tx_itr);
} else { } else {
current_itr = adapter->rx_itr; current_itr = adapter->rx_itr;
} }
/* conservative mode (itr 3) eliminates the lowest_latency setting */ /* conservative mode (itr 3) eliminates the lowest_latency setting */
if (adapter->itr_setting == 3 && if (adapter->itr_setting == 3 && current_itr == lowest_latency)
current_itr == lowest_latency)
current_itr = low_latency; current_itr = low_latency;
switch (current_itr) { switch (current_itr) {
...@@ -2827,7 +2822,7 @@ static inline int igb_tso_adv(struct igb_adapter *adapter, ...@@ -2827,7 +2822,7 @@ static inline int igb_tso_adv(struct igb_adapter *adapter,
mss_l4len_idx = (skb_shinfo(skb)->gso_size << E1000_ADVTXD_MSS_SHIFT); mss_l4len_idx = (skb_shinfo(skb)->gso_size << E1000_ADVTXD_MSS_SHIFT);
mss_l4len_idx |= (l4len << E1000_ADVTXD_L4LEN_SHIFT); mss_l4len_idx |= (l4len << E1000_ADVTXD_L4LEN_SHIFT);
/* Context index must be unique per ring. */ /* For 82575, context index must be unique per ring. */
if (adapter->flags & IGB_FLAG_NEED_CTX_IDX) if (adapter->flags & IGB_FLAG_NEED_CTX_IDX)
mss_l4len_idx |= tx_ring->queue_index << 4; mss_l4len_idx |= tx_ring->queue_index << 4;
...@@ -2911,8 +2906,6 @@ static inline bool igb_tx_csum_adv(struct igb_adapter *adapter, ...@@ -2911,8 +2906,6 @@ static inline bool igb_tx_csum_adv(struct igb_adapter *adapter,
return true; return true;
} }
return false; return false;
} }
...@@ -3136,7 +3129,6 @@ static int igb_xmit_frame_ring_adv(struct sk_buff *skb, ...@@ -3136,7 +3129,6 @@ static int igb_xmit_frame_ring_adv(struct sk_buff *skb,
tx_flags |= IGB_TX_FLAGS_IPV4; tx_flags |= IGB_TX_FLAGS_IPV4;
first = tx_ring->next_to_use; first = tx_ring->next_to_use;
tso = skb_is_gso(skb) ? igb_tso_adv(adapter, tx_ring, skb, tx_flags, tso = skb_is_gso(skb) ? igb_tso_adv(adapter, tx_ring, skb, tx_flags,
&hdr_len) : 0; &hdr_len) : 0;
...@@ -3210,8 +3202,7 @@ static void igb_reset_task(struct work_struct *work) ...@@ -3210,8 +3202,7 @@ static void igb_reset_task(struct work_struct *work)
* Returns the address of the device statistics structure. * Returns the address of the device statistics structure.
* The statistics are actually updated from the timer callback. * The statistics are actually updated from the timer callback.
**/ **/
static struct net_device_stats * static struct net_device_stats *igb_get_stats(struct net_device *netdev)
igb_get_stats(struct net_device *netdev)
{ {
struct igb_adapter *adapter = netdev_priv(netdev); struct igb_adapter *adapter = netdev_priv(netdev);
...@@ -3245,6 +3236,7 @@ static int igb_change_mtu(struct net_device *netdev, int new_mtu) ...@@ -3245,6 +3236,7 @@ static int igb_change_mtu(struct net_device *netdev, int new_mtu)
while (test_and_set_bit(__IGB_RESETTING, &adapter->state)) while (test_and_set_bit(__IGB_RESETTING, &adapter->state))
msleep(1); msleep(1);
/* igb_down has a dependency on max_frame_size */ /* igb_down has a dependency on max_frame_size */
adapter->max_frame_size = max_frame; adapter->max_frame_size = max_frame;
if (netif_running(netdev)) if (netif_running(netdev))
...@@ -3414,8 +3406,7 @@ void igb_update_stats(struct igb_adapter *adapter) ...@@ -3414,8 +3406,7 @@ void igb_update_stats(struct igb_adapter *adapter)
/* Phy Stats */ /* Phy Stats */
if (hw->phy.media_type == e1000_media_type_copper) { if (hw->phy.media_type == e1000_media_type_copper) {
if ((adapter->link_speed == SPEED_1000) && if ((adapter->link_speed == SPEED_1000) &&
(!igb_read_phy_reg(hw, PHY_1000T_STATUS, (!igb_read_phy_reg(hw, PHY_1000T_STATUS, &phy_tmp))) {
&phy_tmp))) {
phy_tmp &= PHY_IDLE_ERROR_COUNT_MASK; phy_tmp &= PHY_IDLE_ERROR_COUNT_MASK;
adapter->phy_stats.idle_errors += phy_tmp; adapter->phy_stats.idle_errors += phy_tmp;
} }
...@@ -3427,7 +3418,6 @@ void igb_update_stats(struct igb_adapter *adapter) ...@@ -3427,7 +3418,6 @@ void igb_update_stats(struct igb_adapter *adapter)
adapter->stats.mgpdc += rd32(E1000_MGTPDC); adapter->stats.mgpdc += rd32(E1000_MGTPDC);
} }
static irqreturn_t igb_msix_other(int irq, void *data) static irqreturn_t igb_msix_other(int irq, void *data)
{ {
struct net_device *netdev = data; struct net_device *netdev = data;
...@@ -3465,6 +3455,7 @@ static irqreturn_t igb_msix_tx(int irq, void *data) ...@@ -3465,6 +3455,7 @@ static irqreturn_t igb_msix_tx(int irq, void *data)
if (adapter->flags & IGB_FLAG_DCA_ENABLED) if (adapter->flags & IGB_FLAG_DCA_ENABLED)
igb_update_tx_dca(tx_ring); igb_update_tx_dca(tx_ring);
#endif #endif
tx_ring->total_bytes = 0; tx_ring->total_bytes = 0;
tx_ring->total_packets = 0; tx_ring->total_packets = 0;
...@@ -3485,13 +3476,11 @@ static void igb_write_itr(struct igb_ring *ring) ...@@ -3485,13 +3476,11 @@ static void igb_write_itr(struct igb_ring *ring)
if ((ring->adapter->itr_setting & 3) && ring->set_itr) { if ((ring->adapter->itr_setting & 3) && ring->set_itr) {
switch (hw->mac.type) { switch (hw->mac.type) {
case e1000_82576: case e1000_82576:
wr32(ring->itr_register, wr32(ring->itr_register, ring->itr_val |
ring->itr_val |
0x80000000); 0x80000000);
break; break;
default: default:
wr32(ring->itr_register, wr32(ring->itr_register, ring->itr_val |
ring->itr_val |
(ring->itr_val << 16)); (ring->itr_val << 16));
break; break;
} }
...@@ -3762,7 +3751,6 @@ static int igb_clean_rx_ring_msix(struct napi_struct *napi, int budget) ...@@ -3762,7 +3751,6 @@ static int igb_clean_rx_ring_msix(struct napi_struct *napi, int budget)
#endif #endif
igb_clean_rx_irq_adv(rx_ring, &work_done, budget); igb_clean_rx_irq_adv(rx_ring, &work_done, budget);
/* If not enough Rx work done, exit the polling mode */ /* If not enough Rx work done, exit the polling mode */
if ((work_done == 0) || !netif_running(netdev)) { if ((work_done == 0) || !netif_running(netdev)) {
napi_complete(napi); napi_complete(napi);
...@@ -3773,7 +3761,6 @@ static int igb_clean_rx_ring_msix(struct napi_struct *napi, int budget) ...@@ -3773,7 +3761,6 @@ static int igb_clean_rx_ring_msix(struct napi_struct *napi, int budget)
else else
igb_update_ring_itr(rx_ring); igb_update_ring_itr(rx_ring);
} }
if (!test_bit(__IGB_DOWN, &adapter->state)) if (!test_bit(__IGB_DOWN, &adapter->state))
wr32(E1000_EIMS, rx_ring->eims_value); wr32(E1000_EIMS, rx_ring->eims_value);
...@@ -3869,7 +3856,6 @@ static bool igb_clean_tx_irq(struct igb_ring *tx_ring) ...@@ -3869,7 +3856,6 @@ static bool igb_clean_tx_irq(struct igb_ring *tx_ring)
if (i == tx_ring->count) if (i == tx_ring->count)
i = 0; i = 0;
} }
eop = tx_ring->buffer_info[i].next_to_watch; eop = tx_ring->buffer_info[i].next_to_watch;
eop_desc = E1000_TX_DESC_ADV(*tx_ring, eop); eop_desc = E1000_TX_DESC_ADV(*tx_ring, eop);
} }
...@@ -3938,7 +3924,7 @@ static bool igb_clean_tx_irq(struct igb_ring *tx_ring) ...@@ -3938,7 +3924,7 @@ static bool igb_clean_tx_irq(struct igb_ring *tx_ring)
* igb_receive_skb - helper function to handle rx indications * igb_receive_skb - helper function to handle rx indications
* @ring: pointer to receive ring receving this packet * @ring: pointer to receive ring receving this packet
* @status: descriptor status field as written by hardware * @status: descriptor status field as written by hardware
* @vlan: descriptor vlan field as written by hardware (no le/be conversion) * @rx_desc: receive descriptor containing vlan and type information.
* @skb: pointer to sk_buff to be indicated to stack * @skb: pointer to sk_buff to be indicated to stack
**/ **/
static void igb_receive_skb(struct igb_ring *ring, u8 status, static void igb_receive_skb(struct igb_ring *ring, u8 status,
...@@ -3965,7 +3951,6 @@ static void igb_receive_skb(struct igb_ring *ring, u8 status, ...@@ -3965,7 +3951,6 @@ static void igb_receive_skb(struct igb_ring *ring, u8 status,
} }
} }
static inline void igb_rx_checksum_adv(struct igb_adapter *adapter, static inline void igb_rx_checksum_adv(struct igb_adapter *adapter,
u32 status_err, struct sk_buff *skb) u32 status_err, struct sk_buff *skb)
{ {
...@@ -3998,11 +3983,11 @@ static bool igb_clean_rx_irq_adv(struct igb_ring *rx_ring, ...@@ -3998,11 +3983,11 @@ static bool igb_clean_rx_irq_adv(struct igb_ring *rx_ring,
union e1000_adv_rx_desc *rx_desc , *next_rxd; union e1000_adv_rx_desc *rx_desc , *next_rxd;
struct igb_buffer *buffer_info , *next_buffer; struct igb_buffer *buffer_info , *next_buffer;
struct sk_buff *skb; struct sk_buff *skb;
unsigned int i;
u32 length, hlen, staterr;
bool cleaned = false; bool cleaned = false;
int cleaned_count = 0; int cleaned_count = 0;
unsigned int total_bytes = 0, total_packets = 0; unsigned int total_bytes = 0, total_packets = 0;
unsigned int i;
u32 length, hlen, staterr;
i = rx_ring->next_to_clean; i = rx_ring->next_to_clean;
buffer_info = &rx_ring->buffer_info[i]; buffer_info = &rx_ring->buffer_info[i];
...@@ -4050,8 +4035,7 @@ static bool igb_clean_rx_irq_adv(struct igb_ring *rx_ring, ...@@ -4050,8 +4035,7 @@ static bool igb_clean_rx_irq_adv(struct igb_ring *rx_ring,
if (!skb_shinfo(skb)->nr_frags) { if (!skb_shinfo(skb)->nr_frags) {
pci_unmap_single(pdev, buffer_info->dma, pci_unmap_single(pdev, buffer_info->dma,
adapter->rx_ps_hdr_size + adapter->rx_ps_hdr_size + NET_IP_ALIGN,
NET_IP_ALIGN,
PCI_DMA_FROMDEVICE); PCI_DMA_FROMDEVICE);
skb_put(skb, hlen); skb_put(skb, hlen);
} }
...@@ -4171,7 +4155,6 @@ static bool igb_clean_rx_irq_adv(struct igb_ring *rx_ring, ...@@ -4171,7 +4155,6 @@ static bool igb_clean_rx_irq_adv(struct igb_ring *rx_ring,
return cleaned; return cleaned;
} }
/** /**
* igb_alloc_rx_buffers_adv - Replace used receive buffers; packet split * igb_alloc_rx_buffers_adv - Replace used receive buffers; packet split
* @adapter: address of board private structure * @adapter: address of board private structure
...@@ -4619,7 +4602,6 @@ int igb_set_spd_dplx(struct igb_adapter *adapter, u16 spddplx) ...@@ -4619,7 +4602,6 @@ int igb_set_spd_dplx(struct igb_adapter *adapter, u16 spddplx)
return 0; return 0;
} }
static int igb_suspend(struct pci_dev *pdev, pm_message_t state) static int igb_suspend(struct pci_dev *pdev, pm_message_t state)
{ {
struct net_device *netdev = pci_get_drvdata(pdev); struct net_device *netdev = pci_get_drvdata(pdev);
......
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