Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 17e813ec authored by Bruce Allan's avatar Bruce Allan Committed by Jeff Kirsher
Browse files

e1000e: cleanup PARENTHESIS_ALIGNMENT checkpatch checks



CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis

Signed-off-by: default avatarBruce Allan <bruce.w.allan@intel.com>
Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 66501f56
Loading
Loading
Loading
Loading
+17 −22
Original line number Diff line number Diff line
@@ -666,9 +666,7 @@ static s32 e1000_get_link_up_info_80003es2lan(struct e1000_hw *hw, u16 *speed,
	s32 ret_val;

	if (hw->phy.media_type == e1000_media_type_copper) {
		ret_val = e1000e_get_speed_and_duplex_copper(hw,
								    speed,
								    duplex);
		ret_val = e1000e_get_speed_and_duplex_copper(hw, speed, duplex);
		hw->phy.ops.cfg_on_link_up(hw);
	} else {
		ret_val = e1000e_get_speed_and_duplex_fiber_serdes(hw,
@@ -890,7 +888,7 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
{
	struct e1000_phy_info *phy = &hw->phy;
	s32 ret_val;
	u32 ctrl_ext;
	u32 reg;
	u16 data;

	ret_val = e1e_rphy(hw, GG82563_PHY_MAC_SPEC_CTRL, &data);
@@ -953,22 +951,19 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
	}

	/* Bypass Rx and Tx FIFO's */
	ret_val = e1000_write_kmrn_reg_80003es2lan(hw,
					E1000_KMRNCTRLSTA_OFFSET_FIFO_CTRL,
					E1000_KMRNCTRLSTA_FIFO_CTRL_RX_BYPASS |
	reg = E1000_KMRNCTRLSTA_OFFSET_FIFO_CTRL;
	data = (E1000_KMRNCTRLSTA_FIFO_CTRL_RX_BYPASS |
		E1000_KMRNCTRLSTA_FIFO_CTRL_TX_BYPASS);
	ret_val = e1000_write_kmrn_reg_80003es2lan(hw, reg, data);
	if (ret_val)
		return ret_val;

	ret_val = e1000_read_kmrn_reg_80003es2lan(hw,
				       E1000_KMRNCTRLSTA_OFFSET_MAC2PHY_OPMODE,
				       &data);
	reg = E1000_KMRNCTRLSTA_OFFSET_MAC2PHY_OPMODE;
	ret_val = e1000_read_kmrn_reg_80003es2lan(hw, reg, &data);
	if (ret_val)
		return ret_val;
	data |= E1000_KMRNCTRLSTA_OPMODE_E_IDLE;
	ret_val = e1000_write_kmrn_reg_80003es2lan(hw,
					E1000_KMRNCTRLSTA_OFFSET_MAC2PHY_OPMODE,
					data);
	ret_val = e1000_write_kmrn_reg_80003es2lan(hw, reg, data);
	if (ret_val)
		return ret_val;

@@ -981,9 +976,9 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
	if (ret_val)
		return ret_val;

	ctrl_ext = er32(CTRL_EXT);
	ctrl_ext &= ~(E1000_CTRL_EXT_LINK_MODE_MASK);
	ew32(CTRL_EXT, ctrl_ext);
	reg = er32(CTRL_EXT);
	reg &= ~E1000_CTRL_EXT_LINK_MODE_MASK;
	ew32(CTRL_EXT, reg);

	ret_val = e1e_rphy(hw, GG82563_PHY_PWR_MGMT_CTRL, &data);
	if (ret_val)
+40 −31
Original line number Diff line number Diff line
@@ -499,8 +499,8 @@ static int e1000_get_eeprom(struct net_device *netdev,
	first_word = eeprom->offset >> 1;
	last_word = (eeprom->offset + eeprom->len - 1) >> 1;

	eeprom_buff = kmalloc(sizeof(u16) *
			(last_word - first_word + 1), GFP_KERNEL);
	eeprom_buff = kmalloc(sizeof(u16) * (last_word - first_word + 1),
			      GFP_KERNEL);
	if (!eeprom_buff)
		return -ENOMEM;

@@ -966,8 +966,8 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data)
	if (!request_irq(irq, e1000_test_intr, IRQF_PROBE_SHARED, netdev->name,
			 netdev)) {
		shared_int = 0;
	} else if (request_irq(irq, e1000_test_intr, IRQF_SHARED,
		 netdev->name, netdev)) {
	} else if (request_irq(irq, e1000_test_intr, IRQF_SHARED, netdev->name,
			       netdev)) {
		*data = 1;
		ret_val = -1;
		goto out;
@@ -1077,28 +1077,33 @@ static void e1000_free_desc_rings(struct e1000_adapter *adapter)
	struct e1000_ring *tx_ring = &adapter->test_tx_ring;
	struct e1000_ring *rx_ring = &adapter->test_rx_ring;
	struct pci_dev *pdev = adapter->pdev;
	struct e1000_buffer *buffer_info;
	int i;

	if (tx_ring->desc && tx_ring->buffer_info) {
		for (i = 0; i < tx_ring->count; i++) {
			if (tx_ring->buffer_info[i].dma)
			buffer_info = &tx_ring->buffer_info[i];

			if (buffer_info->dma)
				dma_unmap_single(&pdev->dev,
					tx_ring->buffer_info[i].dma,
					tx_ring->buffer_info[i].length,
						 buffer_info->dma,
						 buffer_info->length,
						 DMA_TO_DEVICE);
			if (tx_ring->buffer_info[i].skb)
				dev_kfree_skb(tx_ring->buffer_info[i].skb);
			if (buffer_info->skb)
				dev_kfree_skb(buffer_info->skb);
		}
	}

	if (rx_ring->desc && rx_ring->buffer_info) {
		for (i = 0; i < rx_ring->count; i++) {
			if (rx_ring->buffer_info[i].dma)
			buffer_info = &rx_ring->buffer_info[i];

			if (buffer_info->dma)
				dma_unmap_single(&pdev->dev,
					rx_ring->buffer_info[i].dma,
						 buffer_info->dma,
						 2048, DMA_FROM_DEVICE);
			if (rx_ring->buffer_info[i].skb)
				dev_kfree_skb(rx_ring->buffer_info[i].skb);
			if (buffer_info->skb)
				dev_kfree_skb(buffer_info->skb);
		}
	}

@@ -1572,6 +1577,7 @@ static int e1000_run_loopback_test(struct e1000_adapter *adapter)
	struct e1000_ring *rx_ring = &adapter->test_rx_ring;
	struct pci_dev *pdev = adapter->pdev;
	struct e1000_hw *hw = &adapter->hw;
	struct e1000_buffer *buffer_info;
	int i, j, k, l;
	int lc;
	int good_cnt;
@@ -1594,11 +1600,12 @@ static int e1000_run_loopback_test(struct e1000_adapter *adapter)
	l = 0;
	for (j = 0; j <= lc; j++) { /* loop count loop */
		for (i = 0; i < 64; i++) { /* send the packets */
			e1000_create_lbtest_frame(tx_ring->buffer_info[k].skb,
						  1024);
			buffer_info = &tx_ring->buffer_info[k];

			e1000_create_lbtest_frame(buffer_info->skb, 1024);
			dma_sync_single_for_device(&pdev->dev,
					tx_ring->buffer_info[k].dma,
					tx_ring->buffer_info[k].length,
						   buffer_info->dma,
						   buffer_info->length,
						   DMA_TO_DEVICE);
			k++;
			if (k == tx_ring->count)
@@ -1610,12 +1617,14 @@ static int e1000_run_loopback_test(struct e1000_adapter *adapter)
		time = jiffies; /* set the start time for the receive */
		good_cnt = 0;
		do { /* receive the sent packets */
			buffer_info = &rx_ring->buffer_info[l];

			dma_sync_single_for_cpu(&pdev->dev,
					rx_ring->buffer_info[l].dma, 2048,
						buffer_info->dma, 2048,
						DMA_FROM_DEVICE);

			ret_val = e1000_check_lbtest_frame(
					rx_ring->buffer_info[l].skb, 1024);
			ret_val = e1000_check_lbtest_frame(buffer_info->skb,
							   1024);
			if (!ret_val)
				good_cnt++;
			l++;
+21 −19
Original line number Diff line number Diff line
@@ -2653,7 +2653,8 @@ static s32 e1000_read_flash_data_ich8lan(struct e1000_hw *hw, u32 offset,

		ew32flash(ICH_FLASH_FADDR, flash_linear_addr);

		ret_val = e1000_flash_cycle_ich8lan(hw,
		ret_val =
		    e1000_flash_cycle_ich8lan(hw,
					      ICH_FLASH_READ_COMMAND_TIMEOUT);

		/* Check if FCERR is set to 1, if set to 1, clear it
@@ -3017,7 +3018,8 @@ static s32 e1000_write_flash_data_ich8lan(struct e1000_hw *hw, u32 offset,
		/* check if FCERR is set to 1 , if set to 1, clear it
		 * and try the whole sequence a few more times else done
		 */
		ret_val = e1000_flash_cycle_ich8lan(hw,
		ret_val =
		    e1000_flash_cycle_ich8lan(hw,
					      ICH_FLASH_WRITE_COMMAND_TIMEOUT);
		if (!ret_val)
			break;
@@ -3150,6 +3152,8 @@ static s32 e1000_erase_flash_bank_ich8lan(struct e1000_hw *hw, u32 bank)

	for (j = 0; j < iteration ; j++) {
		do {
			u32 timeout = ICH_FLASH_ERASE_COMMAND_TIMEOUT;

			/* Steps */
			ret_val = e1000_flash_cycle_init_ich8lan(hw);
			if (ret_val)
@@ -3169,8 +3173,7 @@ static s32 e1000_erase_flash_bank_ich8lan(struct e1000_hw *hw, u32 bank)
			flash_linear_addr += (j * sector_size);
			ew32flash(ICH_FLASH_FADDR, flash_linear_addr);

			ret_val = e1000_flash_cycle_ich8lan(hw,
					       ICH_FLASH_ERASE_COMMAND_TIMEOUT);
			ret_val = e1000_flash_cycle_ich8lan(hw, timeout);
			if (!ret_val)
				break;

@@ -3625,8 +3628,7 @@ static s32 e1000_setup_link_ich8lan(struct e1000_hw *hw)
	 */
	hw->fc.current_mode = hw->fc.requested_mode;

	e_dbg("After fix-ups FlowControl is now = %x\n",
		hw->fc.current_mode);
	e_dbg("After fix-ups FlowControl is now = %x\n", hw->fc.current_mode);

	/* Continue to configure the copper link. */
	ret_val = hw->mac.ops.setup_physical_interface(hw);
+49 −41
Original line number Diff line number Diff line
@@ -1496,6 +1496,7 @@ static bool e1000_clean_jumbo_rx_irq(struct e1000_ring *rx_ring, int *work_done,
	int cleaned_count = 0;
	bool cleaned = false;
	unsigned int total_rx_bytes = 0, total_rx_packets = 0;
	struct skb_shared_info *shinfo;

	i = rx_ring->next_to_clean;
	rx_desc = E1000_RX_DESC_EXT(*rx_ring, i);
@@ -1552,9 +1553,10 @@ static bool e1000_clean_jumbo_rx_irq(struct e1000_ring *rx_ring, int *work_done,
						   0, length);
			} else {
				/* this is the middle of a chain */
				skb_fill_page_desc(rxtop,
				    skb_shinfo(rxtop)->nr_frags,
				    buffer_info->page, 0, length);
				shinfo = skb_shinfo(rxtop);
				skb_fill_page_desc(rxtop, shinfo->nr_frags,
						   buffer_info->page, 0,
						   length);
				/* re-use the skb, only consumed the page */
				buffer_info->skb = skb;
			}
@@ -1563,9 +1565,10 @@ static bool e1000_clean_jumbo_rx_irq(struct e1000_ring *rx_ring, int *work_done,
		} else {
			if (rxtop) {
				/* end of the chain */
				skb_fill_page_desc(rxtop,
				    skb_shinfo(rxtop)->nr_frags,
				    buffer_info->page, 0, length);
				shinfo = skb_shinfo(rxtop);
				skb_fill_page_desc(rxtop, shinfo->nr_frags,
						   buffer_info->page, 0,
						   length);
				/* re-use the current skb, we only consumed the
				 * page
				 */
@@ -1719,7 +1722,8 @@ static void e1000_clean_rx_ring(struct e1000_ring *rx_ring)
static void e1000e_downshift_workaround(struct work_struct *work)
{
	struct e1000_adapter *adapter = container_of(work,
					struct e1000_adapter, downshift_task);
						     struct e1000_adapter,
						     downshift_task);

	if (test_bit(__E1000_DOWN, &adapter->state))
		return;
@@ -2044,7 +2048,8 @@ void e1000e_set_interrupt_capability(struct e1000_adapter *adapter)
		if (adapter->flags & FLAG_HAS_MSIX) {
			adapter->num_vectors = 3; /* RxQ0, TxQ0 and other */
			adapter->msix_entries = kcalloc(adapter->num_vectors,
						      sizeof(struct msix_entry),
							sizeof(struct
							       msix_entry),
							GFP_KERNEL);
			if (adapter->msix_entries) {
				for (i = 0; i < adapter->num_vectors; i++)
@@ -3854,13 +3859,13 @@ void e1000e_reset(struct e1000_adapter *adapter)
		if ((adapter->max_frame_size * 2) > (pba << 10)) {
			if (!(adapter->flags2 & FLAG2_DISABLE_AIM)) {
				dev_info(&adapter->pdev->dev,
					"Interrupt Throttle Rate turned off\n");
					 "Interrupt Throttle Rate off\n");
				adapter->flags2 |= FLAG2_DISABLE_AIM;
				e1000e_write_itr(adapter, 0);
			}
		} else if (adapter->flags2 & FLAG2_DISABLE_AIM) {
			dev_info(&adapter->pdev->dev,
				 "Interrupt Throttle Rate turned on\n");
				 "Interrupt Throttle Rate on\n");
			adapter->flags2 &= ~FLAG2_DISABLE_AIM;
			adapter->itr = 20000;
			e1000e_write_itr(adapter, adapter->itr);
@@ -4429,7 +4434,8 @@ static int e1000_set_mac(struct net_device *netdev, void *p)
static void e1000e_update_phy_task(struct work_struct *work)
{
	struct e1000_adapter *adapter = container_of(work,
					struct e1000_adapter, update_phy_task);
						     struct e1000_adapter,
						     update_phy_task);

	if (test_bit(__E1000_DOWN, &adapter->state))
		return;
@@ -4789,7 +4795,8 @@ static void e1000_watchdog(unsigned long data)
static void e1000_watchdog_task(struct work_struct *work)
{
	struct e1000_adapter *adapter = container_of(work,
					struct e1000_adapter, watchdog_task);
						     struct e1000_adapter,
						     watchdog_task);
	struct net_device *netdev = adapter->netdev;
	struct e1000_mac_info *mac = &adapter->hw.mac;
	struct e1000_phy_info *phy = &adapter->hw.phy;
@@ -5211,7 +5218,8 @@ static int e1000_tx_map(struct e1000_ring *tx_ring, struct sk_buff *skb,
			buffer_info->time_stamp = jiffies;
			buffer_info->next_to_watch = i;
			buffer_info->dma = skb_frag_dma_map(&pdev->dev, frag,
						offset, size, DMA_TO_DEVICE);
							    offset, size,
							    DMA_TO_DEVICE);
			buffer_info->mapped_as_page = true;
			if (dma_mapping_error(&pdev->dev, buffer_info->dma))
				goto dma_error;
@@ -6514,7 +6522,7 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
	resource_size_t flash_start, flash_len;
	static int cards_found;
	u16 aspm_disable_flag = 0;
	int i, err, pci_using_dac;
	int bars, i, err, pci_using_dac;
	u16 eeprom_data = 0;
	u16 eeprom_apme_mask = E1000_EEPROM_APME;

@@ -6548,8 +6556,8 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
		}
	}

	err = pci_request_selected_regions_exclusive(pdev,
					  pci_select_bars(pdev, IORESOURCE_MEM),
	bars = pci_select_bars(pdev, IORESOURCE_MEM);
	err = pci_request_selected_regions_exclusive(pdev, bars,
						     e1000e_driver_name);
	if (err)
		goto err_pci_reg;
@@ -6995,8 +7003,8 @@ MODULE_DEVICE_TABLE(pci, e1000_pci_tbl);
#ifdef CONFIG_PM
static const struct dev_pm_ops e1000_pm_ops = {
	SET_SYSTEM_SLEEP_PM_OPS(e1000_suspend, e1000_resume)
	SET_RUNTIME_PM_OPS(e1000_runtime_suspend,
				e1000_runtime_resume, e1000_idle)
	SET_RUNTIME_PM_OPS(e1000_runtime_suspend, e1000_runtime_resume,
			   e1000_idle)
};
#endif

+7 −8
Original line number Diff line number Diff line
@@ -478,18 +478,17 @@ void e1000e_check_options(struct e1000_adapter *adapter)
			.err  = "defaulting to Enabled",
			.def  = OPTION_ENABLED
		};
		bool enabled = opt.def;

		if (num_KumeranLockLoss > bd) {
			unsigned int kmrn_lock_loss = KumeranLockLoss[bd];
			e1000_validate_option(&kmrn_lock_loss, &opt, adapter);
			enabled = kmrn_lock_loss;
		}

		if (hw->mac.type == e1000_ich8lan)
			e1000e_set_kmrn_lock_loss_workaround_ich8lan(hw,
								kmrn_lock_loss);
		} else {
			if (hw->mac.type == e1000_ich8lan)
				e1000e_set_kmrn_lock_loss_workaround_ich8lan(hw,
								       opt.def);
		}
								     enabled);
	}
	{ /* Write-protect NVM */
		static const struct e1000_option opt = {
Loading