All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [bug report] igc: Add code for PHY support
Date: Tue, 11 Dec 2018 12:41:03 +0300	[thread overview]
Message-ID: <20181211094103.GA26611@kadam> (raw)

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

             reply	other threads:[~2018-12-11  9:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-11  9:41 Dan Carpenter [this message]
2018-12-11 11:46 ` [Intel-wired-lan] [bug report] igc: Add code for PHY support Neftin, Sasha
2018-12-11 12:19   ` Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2018-10-19 19:58 Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181211094103.GA26611@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=intel-wired-lan@osuosl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.