aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/intel/e1000/e1000_hw.c
AgeCommit message (Collapse)AuthorFilesLines
2020-10-13e1000: remove unused and incorrect codeJesse Brandeburg1-9/+1
The e1000_clear_vfta function was triggering a warning in kbuild-bot testing. It's actually a bug but has no functional impact. drivers/net/ethernet/intel/e1000/e1000_hw.c:4415:58: warning: Same expression in both branches of ternary operator. [duplicateExpressionTernary] Fix this warning by removing the offending code and simplifying the routine to do exactly what it did before, no functional change. Signed-off-by: Jesse Brandeburg <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Tony Nguyen <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
2020-09-25intel: handle unused assignmentsJesse Brandeburg1-74/+65
Remove variables that were storing a return value from a register read or other read, where the return value wasn't used. Those conversions to remove the lvalue of the assignment should be safe because the readl memory mapped reads are marked volatile and should not be optimized out without an lvalue (I suspect a very long time ago this wasn't guaranteed as it is today). These changes are part of a separate patch to make it easier to review. Warnings Fixed: .../intel/e100.c:2596:9: warning: variable ‘err’ set but not used [-Wunused-but-set-variable] .../intel/ixgb/ixgb_hw.c:101:6: warning: variable ‘icr_reg’ set but not used [-Wunused-but-set-variable] .../intel/ixgb/ixgb_hw.c:277:6: warning: variable ‘ctrl_reg’ set but not used [-Wunused-but-set-variable] .../intel/ixgb/ixgb_hw.c:952:15: warning: variable ‘temp_reg’ set but not used [-Wunused-but-set-variable] .../intel/ixgb/ixgb_hw.c:1164:7: warning: variable ‘mdio_reg’ set but not used [-Wunused-but-set-variable] .../intel/e1000/e1000_hw.c:132:6: warning: variable ‘ret_val’ set but not used [-Wunused-but-set-variable] .../intel/e1000/e1000_hw.c:380:6: warning: variable ‘icr’ set but not used [-Wunused-but-set-variable] .../intel/e1000/e1000_hw.c:2378:6: warning: variable ‘signal’ set but not used [-Wunused-but-set-variable] .../intel/e1000/e1000_hw.c:2374:6: warning: variable ‘ctrl’ set but not used [-Wunused-but-set-variable] .../intel/e1000/e1000_hw.c:2373:6: warning: variable ‘rxcw’ set but not used [-Wunused-but-set-variable] .../intel/e1000/e1000_hw.c:4678:15: warning: variable ‘temp’ set but not used [-Wunused-but-set-variable] Signed-off-by: Jesse Brandeburg <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2020-09-25intel-ethernet: clean up W=1 warnings in kdocJesse Brandeburg1-6/+1
This takes care of all of the trivial W=1 fixes in the Intel Ethernet drivers, which allows developers and maintainers to build more of the networking tree with more complete warning checks. There are three classes of kdoc warnings fixed: - cannot understand function prototype: 'x' - Excess function parameter 'x' description in 'y' - Function parameter or member 'x' not described in 'y' All of the changes were trivial comment updates on function headers. Inspired by Lee Jones' series of wireless work to do the same. Compile tested only, and passes simple test of $ git ls-files *.[ch] | egrep drivers/net/ethernet/intel | \ xargs scripts/kernel-doc -none Signed-off-by: Jesse Brandeburg <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2020-09-19net: e1000: Remove set but not used variableZheng Yongjun1-2/+1
Fixes gcc '-Wunused-but-set-variable' warning: drivers/net/ethernet/intel/e1000/e1000_hw.c: In function e1000_phy_init_script: drivers/net/ethernet/intel/e1000/e1000_hw.c:132:6: warning: variable ‘ret_val’ set but not used [-Wunused-but-set-variable] `ret_val` is never used, so remove it. Signed-off-by: Zheng Yongjun <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2020-07-01ethernet/intel: Convert fallthrough code commentsJeff Kirsher1-2/+2
Convert all the remaining 'fall through" code comments to the newer 'fallthrough;' keyword. Suggested-by: Joe Perches <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
2020-05-28e1000: Fix typo in the commentHari1-1/+1
Continuous Double "the" in a comment. Changed it to single "the" Signed-off-by: Hari <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2018-04-27net: intel: Cleanup the copyright/license headersJeff Kirsher1-27/+1
After many years of having a ~30 line copyright and license header to our source files, we are finally able to reduce that to one line with the advent of the SPDX identifier. Also caught a few files missing the SPDX license identifier, so fixed them up. Signed-off-by: Jeff Kirsher <[email protected]> Acked-by: Shannon Nelson <[email protected]> Acked-by: Richard Cochran <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2018-03-23intel: add SPDX identifiers to all the Intel driversJeff Kirsher1-0/+1
Add the SPDX identifiers to all the Intel wired LAN driver files, as outlined in Documentation/process/license-rules.rst. Signed-off-by: Jeff Kirsher <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-11-27e1000: Fix off-by-one in debug messageAhmad Fatoum1-2/+4
Signed-off-by: Ahmad Fatoum <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2015-12-12e1000: Elementary checkpatch warnings and checks removedJanusz Wolak1-90/+89
Signed-off-by: Janusz Wolak <[email protected]> Acked-by: Jesse Brandeburg <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2015-12-12e1000: get rid of duplicate exit pathJean Sacren1-4/+3
By using goto statement, we can achieve sharing the same exit path so that code duplication could be minimized. Signed-off-by: Jean Sacren <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2015-12-12e1000: fix kernel-doc argument being missingJean Sacren1-0/+1
Due to historical reason, 'phy_data' has never been included in the kernel doc. Fix it so that the requirement could be fulfilled. Signed-off-by: Jean Sacren <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2015-12-12e1000: Remove checkpatch coding style errorsJanusz Wolak1-9/+7
Signed-off-by: Janusz Wolak <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2015-12-12e1000: make eeprom read/write scheduler friendlyJoern Engel1-5/+8
Code was responsible for ~150ms scheduler latencies. Signed-off-by: Joern Engel <[email protected]> Signed-off-by: Spencer Baugh <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2015-09-22e1000: remove dead e1000_init_eeprom_params callsFrancois Romieu1-8/+0
The device probe method e1000_probe calls e1000_init_eeprom_params itself so there's no reason to call it again from e1000_do_write_eeprom or e1000_do_read_eeprom. The sentence above assumes that e1000_init_eeprom_params is effective. e1000_init_eeprom_params depends mostly on hw->mac_type and e1000_probe bails out early if it can't set mac_type (see e1000_init_hw_struct, then e1000_set_mac_type), qed. Btw, if effective, the removed paths would had been deadlock prone when e1000_eeprom_spi was set: -> e1000_write_eeprom (takes e1000_eeprom_lock) -> e1000_do_write_eeprom -> e1000_init_eeprom_params -> e1000_read_eeprom (takes e1000_eeprom_lock) (same narrative with e1000_read_eeprom -> e1000_do_read_eeprom etc.) As a final note, the candidate deadlock above can't happen in e1000_probe due to the way eeprom->word_size is set / tested. Signed-off-by: Francois Romieu <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2014-09-12e1000: move e1000_tbi_adjust_stats to where its usedFlorian Westphal1-78/+0
... and make it static. Signed-off-by: Florian Westphal <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2014-07-20e1000: remove unnecessary break after returnFabian Frederick1-2/+0
Signed-off-by: Fabian Frederick <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2014-05-27e1000: Use is_broadcast_ether_addr/is_multicast_ether_addr helpersTobias Klauser1-2/+2
Use the is_broadcast_ether_addr/is_multicast_ether_addr helper functions from linux/etherdevice.h instead of open coding them. Signed-off-by: Tobias Klauser <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2014-04-11e1000: remove debug messages with function namesJakub Kicinski1-124/+0
e1000_hw.c contains a lot of debug messages which print name of invoked function and contain no new line character at the end. Remove them as equivalent information can be nowadays obtained using function tracer. Reported-by: Joe Perches <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-02-15e1000: fix whitespace issues and multi-line commentsJeff Kirsher1-249/+309
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: Jeff Kirsher <[email protected]> Tested-by: Aaron Brown <[email protected]>
2012-11-01e1000: fix concurrent accesses to PHY from watchdog and ethtoolMaxime Bizon1-2/+15
The e1000 driver currently does not protect concurrent accesses to the PHY from both the ethtool callbacks, and from the e1000_watchdog function. This patchs adds a new spinlock which is used by e1000_{read,write}_phy_reg in order to serialize concurrent accesses to the PHY. Signed-off-by: Maxime Bizon <[email protected]> Signed-off-by: Florian Fainelli <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2012-07-10drivers/net/ethernet: Fix (nearly-)kernel-doc comments for various functionsBen Hutchings1-4/+4
Fix incorrect start markers, wrapped summary lines, missing section breaks, incorrect separators, and some name mismatches. Delete a few that are content-free. Signed-off-by: Ben Hutchings <[email protected]> Acked-by: Jeff Kirsher <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2012-02-24e1000: Neaten e1000_config_dsp_after_link_changeJoe Perches1-83/+73
Separate a complicated bit of e1000_config_dsp_after_link_change into a new static function e1000_1000Mb_check_cable_length. Reduces indentation and adds a bit of clarity. Signed-off-by: Joe Perches <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2011-10-06e1000: convert mdelay to msleepJesse Brandeburg1-11/+11
With the previous commit, there are several functions that are only ever called from thread context, and are able to sleep with msleep instead of mdelay. Signed-off-by: Jesse Brandeburg <[email protected]> CC: Thomas Gleixner <[email protected]> CC: Tushar Dave <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2011-09-22Merge branch 'master' of github.com:davem330/netDavid S. Miller1-0/+6
Conflicts: MAINTAINERS drivers/net/Kconfig drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c drivers/net/ethernet/broadcom/tg3.c drivers/net/wireless/iwlwifi/iwl-pci.c drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c drivers/net/wireless/rt2x00/rt2800usb.c drivers/net/wireless/wl12xx/main.c
2011-08-10intel: Move the Intel wired LAN driversJeff Kirsher1-0/+5824
Moves the Intel wired LAN drivers into drivers/net/ethernet/intel/ and the necessary Kconfig and Makefile changes. Signed-off-by: Jeff Kirsher <[email protected]>