netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] igb: make local functions static and remove dead code
@ 2013-12-12 20:09 Stephen Hemminger
  2013-12-12 20:18 ` Jeff Kirsher
  2013-12-17  0:52 ` Jeff Kirsher
  0 siblings, 2 replies; 4+ messages in thread
From: Stephen Hemminger @ 2013-12-12 20:09 UTC (permalink / raw)
  To: Jeff Kirsher; +Cc: e1000-devel, netdev

Make local functions static, and remove unused e1000_write_sfp_data_byte.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

---
 drivers/net/ethernet/intel/igb/e1000_82575.c |    6 +++---
 drivers/net/ethernet/intel/igb/e1000_i210.c  |   18 +++++++++---------
 drivers/net/ethernet/intel/igb/e1000_i210.h  |    9 ---------
 drivers/net/ethernet/intel/igb/e1000_phy.c   |    2 +-
 drivers/net/ethernet/intel/igb/e1000_phy.h   |    1 -
 drivers/net/ethernet/intel/igb/igb.h         |    2 --
 drivers/net/ethernet/intel/igb/igb_ptp.c     |    6 ++++--
 7 files changed, 17 insertions(+), 27 deletions(-)

--- a/drivers/net/ethernet/intel/igb/e1000_82575.c	2013-12-12 11:48:16.985856343 -0800
+++ b/drivers/net/ethernet/intel/igb/e1000_82575.c	2013-12-12 11:57:00.077709911 -0800
@@ -2677,7 +2677,7 @@ out:
  *  Get EEE status by guessing based on whether Tx or Rx LPI indications have
  *  been received.
  **/
-s32 igb_get_eee_status_i354(struct e1000_hw *hw, bool *status)
+static s32 igb_get_eee_status_i354(struct e1000_hw *hw, bool *status)
 {
 	struct e1000_phy_info *phy = &hw->phy;
 	s32 ret_val = 0;
@@ -2720,7 +2720,7 @@ static const u8 e1000_emc_therm_limit[4]
  *
  *  Updates the temperatures in mac.thermal_sensor_data
  **/
-s32 igb_get_thermal_sensor_data_generic(struct e1000_hw *hw)
+static s32 igb_get_thermal_sensor_data_generic(struct e1000_hw *hw)
 {
 	s32 status = E1000_SUCCESS;
 	u16 ets_offset;
@@ -2774,7 +2774,7 @@ s32 igb_get_thermal_sensor_data_generic(
  *  Sets the thermal sensor thresholds according to the NVM map
  *  and save off the threshold and location values into mac.thermal_sensor_data
  **/
-s32 igb_init_thermal_sensor_thresh_generic(struct e1000_hw *hw)
+static s32 igb_init_thermal_sensor_thresh_generic(struct e1000_hw *hw)
 {
 	s32 status = E1000_SUCCESS;
 	u16 ets_offset;
--- a/drivers/net/ethernet/intel/igb/e1000_i210.c	2013-12-12 11:48:16.985856343 -0800
+++ b/drivers/net/ethernet/intel/igb/e1000_i210.c	2013-12-12 11:57:00.077709911 -0800
@@ -35,6 +35,8 @@
 #include "e1000_hw.h"
 #include "e1000_i210.h"
 
+static s32 igb_update_flash_i210(struct e1000_hw *hw);
+
 /**
  * igb_get_hw_semaphore_i210 - Acquire hardware semaphore
  *  @hw: pointer to the HW structure
@@ -111,7 +113,7 @@ static s32 igb_get_hw_semaphore_i210(str
  *  Return successful if access grant bit set, else clear the request for
  *  EEPROM access and return -E1000_ERR_NVM (-1).
  **/
-s32 igb_acquire_nvm_i210(struct e1000_hw *hw)
+static s32 igb_acquire_nvm_i210(struct e1000_hw *hw)
 {
 	return igb_acquire_swfw_sync_i210(hw, E1000_SWFW_EEP_SM);
 }
@@ -123,7 +125,7 @@ s32 igb_acquire_nvm_i210(struct e1000_hw
  *  Stop any current commands to the EEPROM and clear the EEPROM request bit,
  *  then release the semaphores acquired.
  **/
-void igb_release_nvm_i210(struct e1000_hw *hw)
+static void igb_release_nvm_i210(struct e1000_hw *hw)
 {
 	igb_release_swfw_sync_i210(hw, E1000_SWFW_EEP_SM);
 }
@@ -206,8 +208,8 @@ void igb_release_swfw_sync_i210(struct e
  *  Reads a 16 bit word from the Shadow Ram using the EERD register.
  *  Uses necessary synchronization semaphores.
  **/
-s32 igb_read_nvm_srrd_i210(struct e1000_hw *hw, u16 offset, u16 words,
-			     u16 *data)
+static s32 igb_read_nvm_srrd_i210(struct e1000_hw *hw, u16 offset, u16 words,
+				  u16 *data)
 {
 	s32 status = E1000_SUCCESS;
 	u16 i, count;
@@ -306,8 +308,8 @@ out:
  *  If error code is returned, data and Shadow RAM may be inconsistent - buffer
  *  partially written.
  **/
-s32 igb_write_nvm_srwr_i210(struct e1000_hw *hw, u16 offset, u16 words,
-			      u16 *data)
+static s32 igb_write_nvm_srwr_i210(struct e1000_hw *hw, u16 offset, u16 words,
+				   u16 *data)
 {
 	s32 status = E1000_SUCCESS;
 	u16 i, count;
@@ -555,7 +557,7 @@ s32 igb_read_invm_version(struct e1000_h
  *  Calculates the EEPROM checksum by reading/adding each word of the EEPROM
  *  and then verifies that the sum of the EEPROM is equal to 0xBABA.
  **/
-s32 igb_validate_nvm_checksum_i210(struct e1000_hw *hw)
+static s32 igb_validate_nvm_checksum_i210(struct e1000_hw *hw)
 {
 	s32 status = E1000_SUCCESS;
 	s32 (*read_op_ptr)(struct e1000_hw *, u16, u16, u16 *);
@@ -590,7 +592,7 @@ s32 igb_validate_nvm_checksum_i210(struc
  *  up to the checksum.  Then calculates the EEPROM checksum and writes the
  *  value to the EEPROM. Next commit EEPROM data onto the Flash.
  **/
-s32 igb_update_nvm_checksum_i210(struct e1000_hw *hw)
+static s32 igb_update_nvm_checksum_i210(struct e1000_hw *hw)
 {
 	s32 ret_val = E1000_SUCCESS;
 	u16 checksum = 0;
@@ -684,7 +686,7 @@ bool igb_get_flash_presence_i210(struct
  *  @hw: pointer to the HW structure
  *
  **/
-s32 igb_update_flash_i210(struct e1000_hw *hw)
+static s32 igb_update_flash_i210(struct e1000_hw *hw)
 {
 	s32 ret_val = E1000_SUCCESS;
 	u32 flup;
--- a/drivers/net/ethernet/intel/igb/e1000_i210.h	2013-12-12 11:48:16.985856343 -0800
+++ b/drivers/net/ethernet/intel/igb/e1000_i210.h	2013-12-12 11:57:00.077709911 -0800
@@ -28,17 +28,8 @@
 #ifndef _E1000_I210_H_
 #define _E1000_I210_H_
 
-s32 igb_update_flash_i210(struct e1000_hw *hw);
-s32 igb_update_nvm_checksum_i210(struct e1000_hw *hw);
-s32 igb_validate_nvm_checksum_i210(struct e1000_hw *hw);
-s32 igb_write_nvm_srwr_i210(struct e1000_hw *hw, u16 offset, u16 words,
-			    u16 *data);
-s32 igb_read_nvm_srrd_i210(struct e1000_hw *hw, u16 offset, u16 words,
-			   u16 *data);
 s32 igb_acquire_swfw_sync_i210(struct e1000_hw *hw, u16 mask);
 void igb_release_swfw_sync_i210(struct e1000_hw *hw, u16 mask);
-s32 igb_acquire_nvm_i210(struct e1000_hw *hw);
-void igb_release_nvm_i210(struct e1000_hw *hw);
 s32 igb_valid_led_default_i210(struct e1000_hw *hw, u16 *data);
 s32 igb_read_invm_version(struct e1000_hw *hw,
 			  struct e1000_fw_version *invm_ver);
--- a/drivers/net/ethernet/intel/igb/e1000_phy.c	2013-12-12 11:48:16.985856343 -0800
+++ b/drivers/net/ethernet/intel/igb/e1000_phy.c	2013-12-12 11:59:29.503385535 -0800
@@ -394,77 +394,6 @@ s32 igb_read_sfp_data_byte(struct e1000_
 }
 
 /**
- *  e1000_write_sfp_data_byte - Writes SFP module data.
- *  @hw: pointer to the HW structure
- *  @offset: byte location offset to write to
- *  @data: data to write
- *
- *  Writes one byte to SFP module data stored
- *  in SFP resided EEPROM memory or SFP diagnostic area.
- *  Function should be called with
- *  E1000_I2CCMD_SFP_DATA_ADDR(<byte offset>) for SFP module database access
- *  E1000_I2CCMD_SFP_DIAG_ADDR(<byte offset>) for SFP diagnostics parameters
- *  access
- **/
-s32 e1000_write_sfp_data_byte(struct e1000_hw *hw, u16 offset, u8 data)
-{
-	u32 i = 0;
-	u32 i2ccmd = 0;
-	u32 data_local = 0;
-
-	if (offset > E1000_I2CCMD_SFP_DIAG_ADDR(255)) {
-		hw_dbg("I2CCMD command address exceeds upper limit\n");
-		return -E1000_ERR_PHY;
-	}
-	/* The programming interface is 16 bits wide
-	 * so we need to read the whole word first
-	 * then update appropriate byte lane and write
-	 * the updated word back.
-	 */
-	/* Set up Op-code, EEPROM Address,in the I2CCMD
-	 * register. The MAC will take care of interfacing
-	 * with an EEPROM to write the data given.
-	 */
-	i2ccmd = ((offset << E1000_I2CCMD_REG_ADDR_SHIFT) |
-		  E1000_I2CCMD_OPCODE_READ);
-	/* Set a command to read single word */
-	wr32(E1000_I2CCMD, i2ccmd);
-	for (i = 0; i < E1000_I2CCMD_PHY_TIMEOUT; i++) {
-		udelay(50);
-		/* Poll the ready bit to see if lastly
-		 * launched I2C operation completed
-		 */
-		i2ccmd = rd32(E1000_I2CCMD);
-		if (i2ccmd & E1000_I2CCMD_READY) {
-			/* Check if this is READ or WRITE phase */
-			if ((i2ccmd & E1000_I2CCMD_OPCODE_READ) ==
-			    E1000_I2CCMD_OPCODE_READ) {
-				/* Write the selected byte
-				 * lane and update whole word
-				 */
-				data_local = i2ccmd & 0xFF00;
-				data_local |= data;
-				i2ccmd = ((offset <<
-					E1000_I2CCMD_REG_ADDR_SHIFT) |
-					E1000_I2CCMD_OPCODE_WRITE | data_local);
-				wr32(E1000_I2CCMD, i2ccmd);
-			} else {
-				break;
-			}
-		}
-	}
-	if (!(i2ccmd & E1000_I2CCMD_READY)) {
-		hw_dbg("I2CCMD Write did not complete\n");
-		return -E1000_ERR_PHY;
-	}
-	if (i2ccmd & E1000_I2CCMD_ERROR) {
-		hw_dbg("I2CCMD Error bit set\n");
-		return -E1000_ERR_PHY;
-	}
-	return 0;
-}
-
-/**
  *  igb_read_phy_reg_igp - Read igp PHY register
  *  @hw: pointer to the HW structure
  *  @offset: register offset to be read
--- a/drivers/net/ethernet/intel/igb/e1000_phy.h	2013-12-12 11:48:16.985856343 -0800
+++ b/drivers/net/ethernet/intel/igb/e1000_phy.h	2013-12-12 11:57:00.077709911 -0800
@@ -70,7 +70,6 @@ s32  igb_write_phy_reg_mdic(struct e1000
 s32  igb_read_phy_reg_i2c(struct e1000_hw *hw, u32 offset, u16 *data);
 s32  igb_write_phy_reg_i2c(struct e1000_hw *hw, u32 offset, u16 data);
 s32  igb_read_sfp_data_byte(struct e1000_hw *hw, u16 offset, u8 *data);
-s32  e1000_write_sfp_data_byte(struct e1000_hw *hw, u16 offset, u8 data);
 s32  igb_copper_link_setup_82580(struct e1000_hw *hw);
 s32  igb_get_phy_info_82580(struct e1000_hw *hw);
 s32  igb_phy_force_speed_duplex_82580(struct e1000_hw *hw);
--- a/drivers/net/ethernet/intel/igb/igb.h	2013-12-12 11:48:16.985856343 -0800
+++ b/drivers/net/ethernet/intel/igb/igb.h	2013-12-12 11:57:00.077709911 -0800
@@ -522,9 +522,7 @@ void igb_set_fw_version(struct igb_adapt
 void igb_ptp_init(struct igb_adapter *adapter);
 void igb_ptp_stop(struct igb_adapter *adapter);
 void igb_ptp_reset(struct igb_adapter *adapter);
-void igb_ptp_tx_work(struct work_struct *work);
 void igb_ptp_rx_hang(struct igb_adapter *adapter);
-void igb_ptp_tx_hwtstamp(struct igb_adapter *adapter);
 void igb_ptp_rx_rgtstamp(struct igb_q_vector *q_vector, struct sk_buff *skb);
 void igb_ptp_rx_pktstamp(struct igb_q_vector *q_vector, unsigned char *va,
 			 struct sk_buff *skb);
--- a/drivers/net/ethernet/intel/igb/igb_ptp.c	2013-12-12 11:48:16.985856343 -0800
+++ b/drivers/net/ethernet/intel/igb/igb_ptp.c	2013-12-12 11:57:00.077709911 -0800
@@ -75,6 +75,8 @@
 #define INCVALUE_82576			(16 << IGB_82576_TSYNC_SHIFT)
 #define IGB_NBITS_82580			40
 
+static void igb_ptp_tx_hwtstamp(struct igb_adapter *adapter);
+
 /* SYSTIM read access for the 82576 */
 static cycle_t igb_ptp_read_82576(const struct cyclecounter *cc)
 {
@@ -372,7 +374,7 @@ static int igb_ptp_enable(struct ptp_clo
  * This work function polls the TSYNCTXCTL valid bit to determine when a
  * timestamp has been taken for the current stored skb.
  **/
-void igb_ptp_tx_work(struct work_struct *work)
+static void igb_ptp_tx_work(struct work_struct *work)
 {
 	struct igb_adapter *adapter = container_of(work, struct igb_adapter,
 						   ptp_tx_work);
@@ -466,7 +468,7 @@ void igb_ptp_rx_hang(struct igb_adapter
  * available, then it must have been for this skb here because we only
  * allow only one such packet into the queue.
  **/
-void igb_ptp_tx_hwtstamp(struct igb_adapter *adapter)
+static void igb_ptp_tx_hwtstamp(struct igb_adapter *adapter)
 {
 	struct e1000_hw *hw = &adapter->hw;
 	struct skb_shared_hwtstamps shhwtstamps;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] igb: make local functions static and remove dead code
  2013-12-12 20:09 [PATCH net-next] igb: make local functions static and remove dead code Stephen Hemminger
@ 2013-12-12 20:18 ` Jeff Kirsher
  2013-12-17  0:52 ` Jeff Kirsher
  1 sibling, 0 replies; 4+ messages in thread
From: Jeff Kirsher @ 2013-12-12 20:18 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: e1000-devel, netdev

[-- Attachment #1: Type: text/plain, Size: 771 bytes --]

On Thu, 2013-12-12 at 12:09 -0800, Stephen Hemminger wrote:
> Make local functions static, and remove unused
> e1000_write_sfp_data_byte.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> 
> ---
>  drivers/net/ethernet/intel/igb/e1000_82575.c |    6 +++---
>  drivers/net/ethernet/intel/igb/e1000_i210.c  |   18
> +++++++++---------
>  drivers/net/ethernet/intel/igb/e1000_i210.h  |    9 ---------
>  drivers/net/ethernet/intel/igb/e1000_phy.c   |    2 +-
>  drivers/net/ethernet/intel/igb/e1000_phy.h   |    1 -
>  drivers/net/ethernet/intel/igb/igb.h         |    2 --
>  drivers/net/ethernet/intel/igb/igb_ptp.c     |    6 ++++--
>  7 files changed, 17 insertions(+), 27 deletions(-)

Thanks Stephen I have added this to my queue.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] igb: make local functions static and remove dead code
  2013-12-12 20:09 [PATCH net-next] igb: make local functions static and remove dead code Stephen Hemminger
  2013-12-12 20:18 ` Jeff Kirsher
@ 2013-12-17  0:52 ` Jeff Kirsher
  2013-12-17 20:03   ` Wyborny, Carolyn
  1 sibling, 1 reply; 4+ messages in thread
From: Jeff Kirsher @ 2013-12-17  0:52 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: e1000-devel, netdev

[-- Attachment #1: Type: text/plain, Size: 1850 bytes --]

On Thu, 2013-12-12 at 12:09 -0800, Stephen Hemminger wrote:
> Make local functions static, and remove unused
> e1000_write_sfp_data_byte.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> 
> ---
>  drivers/net/ethernet/intel/igb/e1000_82575.c |    6 +++---
>  drivers/net/ethernet/intel/igb/e1000_i210.c  |   18
> +++++++++---------
>  drivers/net/ethernet/intel/igb/e1000_i210.h  |    9 ---------
>  drivers/net/ethernet/intel/igb/e1000_phy.c   |    2 +-
>  drivers/net/ethernet/intel/igb/e1000_phy.h   |    1 -
>  drivers/net/ethernet/intel/igb/igb.h         |    2 --
>  drivers/net/ethernet/intel/igb/igb_ptp.c     |    6 ++++--
>  7 files changed, 17 insertions(+), 27 deletions(-)

Did you compile test this patch?  I am guessing no because we got the
following compile errors:
 drivers/net/ethernet/intel/igb/e1000_82575.c:2723: error: static
declaration of
 âigb_get_thermal_sensor_data_genericâ follows non-static declaration
 drivers/net/ethernet/intel/igb/e1000_82575.h:270: note: previous
declaration
 of âigb_get_thermal_sensor_data_genericâ was here
 drivers/net/ethernet/intel/igb/e1000_82575.c:2777: error: static
declaration of
 âigb_init_thermal_sensor_thresh_genericâ follows non-static declaration
 drivers/net/ethernet/intel/igb/e1000_82575.h:269: note: previous
declaration
 of âigb_init_thermal_sensor_thresh_genericâ was here
 make[5]: *** [drivers/net/ethernet/intel/igb/e1000_82575.o] Error 1
 make[5]: *** Waiting for unfinished jobs....
 make[4]: *** [drivers/net/ethernet/intel/igb] Error 2
 make[4]: *** Waiting for unfinished jobs....
 make[3]: *** [drivers/net/ethernet/intel] Error 2
 make[2]: *** [drivers/net/ethernet] Error 2
 make[1]: *** [drivers/net] Error 2
 make: *** [drivers] Error 2

I will work on a v2 to fix up these compiling issues.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH net-next] igb: make local functions static and remove dead code
  2013-12-17  0:52 ` Jeff Kirsher
@ 2013-12-17 20:03   ` Wyborny, Carolyn
  0 siblings, 0 replies; 4+ messages in thread
From: Wyborny, Carolyn @ 2013-12-17 20:03 UTC (permalink / raw)
  To: Kirsher, Jeffrey T, Stephen Hemminger
  Cc: e1000-devel@lists.sourceforge.net, netdev@vger.kernel.org

> -----Original Message-----
> From: netdev-owner@vger.kernel.org [mailto:netdev-owner@vger.kernel.org]
> On Behalf Of Jeff Kirsher
> Sent: Monday, December 16, 2013 4:52 PM
> To: Stephen Hemminger
> Cc: e1000-devel@lists.sourceforge.net; netdev@vger.kernel.org
> Subject: Re: [PATCH net-next] igb: make local functions static and remove dead
> code
> 
> On Thu, 2013-12-12 at 12:09 -0800, Stephen Hemminger wrote:
> > Make local functions static, and remove unused
> > e1000_write_sfp_data_byte.
> >
> > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> >
> > ---
> >  drivers/net/ethernet/intel/igb/e1000_82575.c |    6 +++---
> >  drivers/net/ethernet/intel/igb/e1000_i210.c  |   18
> > +++++++++---------
> >  drivers/net/ethernet/intel/igb/e1000_i210.h  |    9 ---------
> >  drivers/net/ethernet/intel/igb/e1000_phy.c   |    2 +-
> >  drivers/net/ethernet/intel/igb/e1000_phy.h   |    1 -
> >  drivers/net/ethernet/intel/igb/igb.h         |    2 --
> >  drivers/net/ethernet/intel/igb/igb_ptp.c     |    6 ++++--
> >  7 files changed, 17 insertions(+), 27 deletions(-)
> 
> Did you compile test this patch?  I am guessing no because we got the following
> compile errors:
>  drivers/net/ethernet/intel/igb/e1000_82575.c:2723: error: static declaration of
> âigb_get_thermal_sensor_data_genericâ follows non-static declaration
>  drivers/net/ethernet/intel/igb/e1000_82575.h:270: note: previous declaration
> of âigb_get_thermal_sensor_data_genericâ was here
>  drivers/net/ethernet/intel/igb/e1000_82575.c:2777: error: static declaration of
> âigb_init_thermal_sensor_thresh_genericâ follows non-static declaration
>  drivers/net/ethernet/intel/igb/e1000_82575.h:269: note: previous declaration
> of âigb_init_thermal_sensor_thresh_genericâ was here
>  make[5]: *** [drivers/net/ethernet/intel/igb/e1000_82575.o] Error 1
>  make[5]: *** Waiting for unfinished jobs....
>  make[4]: *** [drivers/net/ethernet/intel/igb] Error 2
>  make[4]: *** Waiting for unfinished jobs....
>  make[3]: *** [drivers/net/ethernet/intel] Error 2
>  make[2]: *** [drivers/net/ethernet] Error 2
>  make[1]: *** [drivers/net] Error 2
>  make: *** [drivers] Error 2
> 
> I will work on a v2 to fix up these compiling issues.

Please note that removing the igb_get_eee_status_i354 function is the incorrect fix.  There is another bug that is the missing code that uses this function.  I'm working on it.

Thanks,

Carolyn

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-12-17 20:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-12 20:09 [PATCH net-next] igb: make local functions static and remove dead code Stephen Hemminger
2013-12-12 20:18 ` Jeff Kirsher
2013-12-17  0:52 ` Jeff Kirsher
2013-12-17 20:03   ` Wyborny, Carolyn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).