[PATCH v2 net] net: phy: micrel: Fix incorret variable type in micrel

Wan Jiabing posted 1 patch 4 years ago
drivers/net/phy/micrel.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
[PATCH v2 net] net: phy: micrel: Fix incorret variable type in micrel
Posted by Wan Jiabing 4 years ago
In lanphy_read_page_reg, calling __phy_read() might return a negative
error code. Use 'int' to check the error code.

Fixes: 7c2dcfa295b1 ("net: phy: micrel: Add support for LAN8804 PHY")
Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
---
Changelog:
v2:
- Add a 'Fixes' tag.
---
 drivers/net/phy/micrel.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index a06661c07ca8..c34a93403d1e 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -1959,7 +1959,7 @@ static int ksz886x_cable_test_get_status(struct phy_device *phydev,
 
 static int lanphy_read_page_reg(struct phy_device *phydev, int page, u32 addr)
 {
-	u32 data;
+	int data;
 
 	phy_lock_mdio_bus(phydev);
 	__phy_write(phydev, LAN_EXT_PAGE_ACCESS_CONTROL, page);
@@ -2660,8 +2660,7 @@ static int lan8804_config_init(struct phy_device *phydev)
 
 static irqreturn_t lan8814_handle_interrupt(struct phy_device *phydev)
 {
-	u16 tsu_irq_status;
-	int irq_status;
+	int irq_status, tsu_irq_status;
 
 	irq_status = phy_read(phydev, LAN8814_INTS);
 	if (irq_status > 0 && (irq_status & LAN8814_INT_LINK))
-- 
2.36.0
Re: [PATCH v2 net] net: phy: micrel: Fix incorret variable type in micrel
Posted by patchwork-bot+netdevbpf@kernel.org 3 years, 12 months ago
Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Mon,  9 May 2022 22:45:19 +0800 you wrote:
> In lanphy_read_page_reg, calling __phy_read() might return a negative
> error code. Use 'int' to check the error code.
> 
> Fixes: 7c2dcfa295b1 ("net: phy: micrel: Add support for LAN8804 PHY")
> Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
> ---
> Changelog:
> v2:
> - Add a 'Fixes' tag.
> 
> [...]

Here is the summary with links:
  - [v2,net] net: phy: micrel: Fix incorret variable type in micrel
    https://git.kernel.org/netdev/net/c/12a4d677b1c3

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Re: [PATCH v2 net] net: phy: micrel: Fix incorret variable type in micrel
Posted by Andrew Lunn 4 years ago
On Mon, May 09, 2022 at 10:45:19PM +0800, Wan Jiabing wrote:
> In lanphy_read_page_reg, calling __phy_read() might return a negative
> error code. Use 'int' to check the error code.
> 
> Fixes: 7c2dcfa295b1 ("net: phy: micrel: Add support for LAN8804 PHY")
> Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew