* [bug report] net: phy: mscc: migrate to phy_select/restore_page functions
@ 2018-10-10 11:04 Dan Carpenter
2018-10-10 12:09 ` Quentin Schulz
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2018-10-10 11:04 UTC (permalink / raw)
To: kernel-janitors
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [bug report] net: phy: mscc: migrate to phy_select/restore_page functions
2018-10-10 11:04 [bug report] net: phy: mscc: migrate to phy_select/restore_page functions Dan Carpenter
@ 2018-10-10 12:09 ` Quentin Schulz
0 siblings, 0 replies; 2+ messages in thread
From: Quentin Schulz @ 2018-10-10 12:09 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 1274 bytes --]
Hi Dan,
On Wed, Oct 10, 2018 at 02:04:31PM +0300, Dan Carpenter wrote:
> 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 }
>
>
A patch has already been suggested.
Thanks,
Quentin
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-10-10 12:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-10 11:04 [bug report] net: phy: mscc: migrate to phy_select/restore_page functions Dan Carpenter
2018-10-10 12:09 ` Quentin Schulz
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.