All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: [bug report] net: phy: mscc: migrate to phy_select/restore_page functions
Date: Wed, 10 Oct 2018 11:04:31 +0000	[thread overview]
Message-ID: <20181010110431.GA21125@mwanda> (raw)

Hello Quentin Schulz,

The patch 6a0bfbbe20b0: "net: phy: mscc: migrate to
phy_select/restore_page functions" from Oct 8, 2018, leads to the
following static checker warning:

	drivers/net/phy/mscc.c:529 vsc85xx_downshift_get()
	warn: impossible condition '(reg_val < 0) => (0-u16max < 0)'

drivers/net/phy/mscc.c
   523  static int vsc85xx_downshift_get(struct phy_device *phydev, u8 *count)
   524  {
   525          u16 reg_val;
                ^^^^^^^^^^^^
   526  
   527          reg_val = phy_read_paged(phydev, MSCC_PHY_PAGE_EXTENDED,
   528                                   MSCC_PHY_ACTIPHY_CNTL);
   529          if (reg_val < 0)
                    ^^^^^^^^^^^
Impossible

   530                  return reg_val;
   531  
   532          reg_val &= DOWNSHIFT_CNTL_MASK;
   533          if (!(reg_val & DOWNSHIFT_EN))
   534                  *count = DOWNSHIFT_DEV_DISABLE;
   535          else
   536                  *count = ((reg_val & ~DOWNSHIFT_EN) >> DOWNSHIFT_CNTL_POS) + 2;
   537  
   538          return 0;
   539  }


regards,
dan carpenter

             reply	other threads:[~2018-10-10 11:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-10 11:04 Dan Carpenter [this message]
2018-10-10 12:09 ` [bug report] net: phy: mscc: migrate to phy_select/restore_page functions Quentin Schulz

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=20181010110431.GA21125@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.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.