All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [bug report] igc: Add code for PHY support
@ 2018-10-19 19:58 Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2018-10-19 19:58 UTC (permalink / raw)
  To: intel-wired-lan

Hello Sasha Neftin,

The patch 5586838fe9ce: "igc: Add code for PHY support" from Oct 11,
2018, leads to the following static checker warning:

	drivers/net/ethernet/intel/igc/igc_phy.c:167 igc_check_downshift()
	info: ignoring unreachable code.

drivers/net/ethernet/intel/igc/igc_phy.c
   152  s32 igc_check_downshift(struct igc_hw *hw)
   153  {
   154          struct igc_phy_info *phy = &hw->phy;
   155          u16 phy_data, offset, mask;
   156          s32 ret_val;
   157  
   158          switch (phy->type) {
   159          case igc_phy_i225:

Presumably there was supposed to be break here?  In the current code,
this function always just does "goto out;"

   160          default:
   161                  /* speed downshift not supported */
   162                  phy->speed_downgraded = false;
   163                  ret_val = 0;
   164                  goto out;
   165          }
   166  
   167          ret_val = phy->ops.read_reg(hw, offset, &phy_data);
   168  
   169          if (!ret_val)
   170                  phy->speed_downgraded = (phy_data & mask) ? true : false;
   171  
   172  out:
   173          return ret_val;
   174  }

regards,
dan carpenter

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

* [Intel-wired-lan] [bug report] igc: Add code for PHY support
  2018-12-11 11:46 ` Neftin, Sasha
@ 2018-12-11 12:19   ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2018-12-11 12:19 UTC (permalink / raw)
  To: intel-wired-lan

On Tue, Dec 11, 2018 at 01:46:36PM +0200, Neftin, Sasha wrote:
> On 12/11/2018 11:41, Dan Carpenter wrote:
> > Hello Sasha Neftin,
> > 
> > The patch 5586838fe9ce: "igc: Add code for PHY support" from Oct 11,
> > 2018, leads to the following static checker warning:
> > 
> > 	drivers/net/ethernet/intel/igc/igc_phy.c:167 igc_check_downshift()
> > 	info: ignoring unreachable code.
> > 
> > drivers/net/ethernet/intel/igc/igc_phy.c
> >     144  /**
> >     145   * igc_check_downshift - Checks whether a downshift in speed occurred
> >     146   * @hw: pointer to the HW structure
> >     147   *
> >     148   * Success returns 0, Failure returns 1
> >     149   *
> >     150   * A downshift is detected by querying the PHY link health.
> >     151   */
> >     152  s32 igc_check_downshift(struct igc_hw *hw)
> >     153  {
> >     154          struct igc_phy_info *phy = &hw->phy;
> >     155          u16 phy_data, offset, mask;
> >     156          s32 ret_val;
> >     157
> >     158          switch (phy->type) {
> >     159          case igc_phy_i225:
> >     160          default:
> >     161                  /* speed downshift not supported */
> >     162                  phy->speed_downgraded = false;
> >     163                  ret_val = 0;
> >     164                  goto out;
> >                          ^^^^^^^^^
> > We always say it's not supported >
> Thanks Dan. I remember, you already point me on this.

Oops.  Sorry, I have switched devel boxes so maybe that's why it was
marked as a new bug.

regards,
dan carpenter


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

* [Intel-wired-lan] [bug report] igc: Add code for PHY support
  2018-12-11  9:41 Dan Carpenter
@ 2018-12-11 11:46 ` Neftin, Sasha
  2018-12-11 12:19   ` Dan Carpenter
  0 siblings, 1 reply; 4+ messages in thread
From: Neftin, Sasha @ 2018-12-11 11:46 UTC (permalink / raw)
  To: intel-wired-lan

On 12/11/2018 11:41, Dan Carpenter wrote:
> Hello Sasha Neftin,
> 
> The patch 5586838fe9ce: "igc: Add code for PHY support" from Oct 11,
> 2018, leads to the following static checker warning:
> 
> 	drivers/net/ethernet/intel/igc/igc_phy.c:167 igc_check_downshift()
> 	info: ignoring unreachable code.
> 
> drivers/net/ethernet/intel/igc/igc_phy.c
>     144  /**
>     145   * igc_check_downshift - Checks whether a downshift in speed occurred
>     146   * @hw: pointer to the HW structure
>     147   *
>     148   * Success returns 0, Failure returns 1
>     149   *
>     150   * A downshift is detected by querying the PHY link health.
>     151   */
>     152  s32 igc_check_downshift(struct igc_hw *hw)
>     153  {
>     154          struct igc_phy_info *phy = &hw->phy;
>     155          u16 phy_data, offset, mask;
>     156          s32 ret_val;
>     157
>     158          switch (phy->type) {
>     159          case igc_phy_i225:
>     160          default:
>     161                  /* speed downshift not supported */
>     162                  phy->speed_downgraded = false;
>     163                  ret_val = 0;
>     164                  goto out;
>                          ^^^^^^^^^
> We always say it's not supported >
Thanks Dan. I remember, you already point me on this. I will process the 
patch and address this problem. Our PHY under development yet. I will 
add support to this feature per demand.
>     165          }
>     166
>     167          ret_val = phy->ops.read_reg(hw, offset, &phy_data);
>                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> unreachable.
> 
>     168
>     169          if (!ret_val)
>     170                  phy->speed_downgraded = (phy_data & mask) ? true : false;
>     171
>     172  out:
>     173          return ret_val;
>     174  }
> 
> regards,
> dan carpenter
> 
Thanks,
Sasha

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

* [Intel-wired-lan] [bug report] igc: Add code for PHY support
@ 2018-12-11  9:41 Dan Carpenter
  2018-12-11 11:46 ` Neftin, Sasha
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2018-12-11  9:41 UTC (permalink / raw)
  To: intel-wired-lan

Hello Sasha Neftin,

The patch 5586838fe9ce: "igc: Add code for PHY support" from Oct 11,
2018, leads to the following static checker warning:

	drivers/net/ethernet/intel/igc/igc_phy.c:167 igc_check_downshift()
	info: ignoring unreachable code.

drivers/net/ethernet/intel/igc/igc_phy.c
   144  /**
   145   * igc_check_downshift - Checks whether a downshift in speed occurred
   146   * @hw: pointer to the HW structure
   147   *
   148   * Success returns 0, Failure returns 1
   149   *
   150   * A downshift is detected by querying the PHY link health.
   151   */
   152  s32 igc_check_downshift(struct igc_hw *hw)
   153  {
   154          struct igc_phy_info *phy = &hw->phy;
   155          u16 phy_data, offset, mask;
   156          s32 ret_val;
   157  
   158          switch (phy->type) {
   159          case igc_phy_i225:
   160          default:
   161                  /* speed downshift not supported */
   162                  phy->speed_downgraded = false;
   163                  ret_val = 0;
   164                  goto out;
                        ^^^^^^^^^
We always say it's not supported.

   165          }
   166  
   167          ret_val = phy->ops.read_reg(hw, offset, &phy_data);
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
unreachable.

   168  
   169          if (!ret_val)
   170                  phy->speed_downgraded = (phy_data & mask) ? true : false;
   171  
   172  out:
   173          return ret_val;
   174  }

regards,
dan carpenter

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

end of thread, other threads:[~2018-12-11 12:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-19 19:58 [Intel-wired-lan] [bug report] igc: Add code for PHY support Dan Carpenter
2018-12-11  9:41 Dan Carpenter
2018-12-11 11:46 ` Neftin, Sasha
2018-12-11 12:19   ` Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.