e1000: clean up the checking logic
Subsystems (2)
PATCH v2 1/8 e1000: clean up the checking logic
From: Jean Sacren <[email protected]>
The checking logic needed some clean-up work, so we rewrite it by checking for break first. With that change in place, we can even move the second check for goto statement outside of the loop.
As this is merely a cleanup, no functional change is involved. The questionable 'tmp != 0xFF' is intentionally left alone.
Mark Rustad and Alexander Duyck contributed to this patch.
---
v2:
1) Update the changelog to reflect the rewrite of the checking logic and others' contributions;
2) Update the changelog title accordingly;
3) Add credits and cc the pertinent parties.
drivers/net/ethernet/intel/e1000/e1000_main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/net/ethernet/intel/e1000/e1000_main.c +5 -5
@@ -1199,13 +1199,13 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent)for (i =0 ; i <32 ; i++) { hw->phy_addr = i;e1000_read_phy_reg (hw,PHY_ID2 , &tmp); -if (tmp ==0 || tmp ==0xFF ) { -if (i ==31 ) - goto err_eeprom; -continue ; - }else + +if (tmp !=0 && tmp !=0xFF )break ; } + +if (i >=32 ) + goto err_eeprom; }/* reset the hardware with the new settings */
PATCH v2 2/8 e1000: fix a typo in the comment
From: Jean Sacren <[email protected]>
Use 'That' to replace 'The' so that the comment would make sense.
---
v2: No changes.
drivers/net/ethernet/intel/e1000/e1000_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/e1000/e1000_main.c +1 -1
@@ -1263,7 +1263,7 @@ err_pci_reg:* @pdev: PCI device information struct * * e1000_remove is called by the PCI subsystem to alert the driver -* that it should release a PCI device. The could be caused by a +* that it should release a PCI device. That could be caused by a * Hot-Plug event, or because the driver is going to be removed from * memory. **/
PATCH v2 3/8 e1000e: clean up the local variable
In reply to Jεan SacrenFrom: Jean Sacren <[email protected]>
The local variable 'ret' doesn't serve much purpose so we might as well clean it up.
---
v2: No changes.
drivers/net/ethernet/intel/e1000e/netdev.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/net/ethernet/intel/e1000e/netdev.c +1 -4
@@ -7504,14 +7504,11 @@ static struct pci_driver e1000_driver = {**/ static int __init e1000_init_module (void ) { -int ret; -pr_info ("Intel(R) PRO/1000 Network Driver - %s\n" , e1000e_driver_version);pr_info ("Copyright(c) 1999 - 2015 Intel Corporation.\n" ); - ret =pci_register_driver (&e1000_driver); -return ret; +return pci_register_driver (&e1000_driver); }module_init (e1000_init_module);
PATCH v2 4/8 i40e: fix kernel-doc argument name
In reply to Jεan SacrenFrom: Jean Sacren <[email protected]>
The second argument name in the kernel-doc argument list for i40e_features_check() was slightly off. Fix it for the kernel doc.
---
v2: No changes.
drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +1 -1
@@ -8498,7 +8498,7 @@ static int i40e_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,/** * i40e_features_check - Validate encapsulated packet conforms to limits * @skb: skb buff -* @netdev: This physical port's netdev +* @dev: This physical port's netdev * @features: Offload features that the stack believes apply **/ static netdev_features_t i40e_features_check(struct sk_buff *skb,
Bowers
PATCH v2 4/8 i40e: fix kernel-doc argument name
Quoted 13 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Jean Sacren
Sent: Saturday, September 19, 2015 4:09 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next-queue v2 4/8] i40e: fix kernel-doc argument nameFrom: Jean Sacren <[email protected]>
The second argument name in the kernel-doc argument list for
i40e_features_check()was slightly off. Fix it for the kernel doc.
Quoted 6 lines
Signed-off-by Jean Sacren <[email protected]>---
v2: No changes.drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Patch code changes correctly applied
PATCH v2 5/8 ixgbe: fix multiple kernel-doc errors
In reply to Jεan SacrenFrom: Jean Sacren <[email protected]>
The commit dfaf891dd3e1 ("ixgbe: Refactor the RSS configuration code") introduced a few kernel-doc errors:
1) The function name is missing;
2) The format is wrong;
3) The short description is redundant.
Fix all the above for the correct execution of the kernel doc.
---
v2: No changes.
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +3 -6
@@ -3308,8 +3308,7 @@ static void ixgbe_configure_srrctl(struct ixgbe_adapter *adapter, }/** -* Return a number of entries in the RSS indirection table -* +* ixgbe_rss_indir_tbl_entries - Return RSS indirection table entries * @adapter: device handle * * - 82598/82599/X540: 128
@@ -3327,8 +3326,7 @@ u32 ixgbe_rss_indir_tbl_entries(struct ixgbe_adapter *adapter) }/** -* Write the RETA table to HW -* +* ixgbe_store_reta - Write the RETA table to HW * @adapter: device handle * * Write the RSS redirection table stored in adapter.rss_indir_tbl[] to HW.
@@ -3367,8 +3365,7 @@ void ixgbe_store_reta(struct ixgbe_adapter *adapter) }/** -* Write the RETA table to HW (for x550 devices in SRIOV mode) -* +* ixgbe_store_vfreta - Write the RETA table to HW (x550 devices in SRIOV mode) * @adapter: device handle * * Write the RSS redirection table stored in adapter.rss_indir_tbl[] to HW.
PATCH v2 6/8 i40e: declare rather than initialize int object
In reply to Jεan SacrenFrom: Jean Sacren <[email protected]>
'err' would be overwritten immediately, so we should declare it only rather than initialize it to zero.
---
v2: No changes.
drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +1 -1
@@ -10140,7 +10140,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)static u16 pfs_found;u16 wol_nvm_bits;u16 link_status; -int err =0 ; +int err;u32 len;u32 i;
Bowers
PATCH v2 6/8 i40e: declare rather than initialize int object
Quoted 13 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Jean Sacren
Sent: Saturday, September 19, 2015 4:09 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next-queue v2 6/8] i40e: declare rather than initialize int objectFrom: Jean Sacren <[email protected]>
'err' would be overwritten immediately, so we should declare it only rather than initialize it to zero.
Quoted 6 lines
Signed-off-by Jean Sacren <[email protected]>---
v2: No changes.drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Code changes present in tree
PATCH v2 7/8 e1000: fix kernel-doc argument being missing
In reply to Jεan SacrenFrom: Jean Sacren <[email protected]>
Due to historical reason, 'phy_data' has never been included in the kernel doc. Fix it so that the requirement could be fulfilled.
---
v2: No changes.
drivers/net/ethernet/intel/e1000/e1000_hw.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/intel/e1000/e1000_hw.c +1 -0
@@ -2806,6 +2806,7 @@ static u16 e1000_shift_in_mdi_bits(struct e1000_hw *hw)* e1000_read_phy_reg - read a phy register * @hw: Struct containing variables accessed by shared code * @reg_addr: address of the PHY register to read +* @phy_data: pointer to the value on the PHY register * * Reads the value from a PHY register, if the value is on a specific non zero * page, sets the page first.
PATCH v2 8/8 e1000: get rid of duplicate exit path
In reply to Jεan SacrenFrom: Jean Sacren <[email protected]>
By using goto statement, we can achieve sharing the same exit path so that code duplication could be minimized.
---
v2: No changes.
drivers/net/ethernet/intel/e1000/e1000_hw.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/net/ethernet/intel/e1000/e1000_hw.c +3 -4
@@ -2822,14 +2822,13 @@ s32 e1000_read_phy_reg(struct e1000_hw *hw, u32 reg_addr, u16 *phy_data) (reg_addr > MAX_PHY_MULTI_PAGE_REG)) { ret_val =e1000_write_phy_reg_ex (hw,IGP01E1000_PHY_PAGE_SELECT , (u16 ) reg_addr); -if (ret_val) { -spin_unlock_irqrestore (&e1000_phy_lock, flags); -return ret_val; - } +if (ret_val) + goto out; } ret_val =e1000_read_phy_reg_ex (hw,MAX_PHY_REG_ADDRESS & reg_addr, phy_data); +out:spin_unlock_irqrestore (&e1000_phy_lock, flags);return ret_val;