All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: phy: micrel: Fix incorret variable type in micrel
@ 2022-05-09 13:49 Wan Jiabing
  2022-05-09 13:53 ` Andrew Lunn
  2022-05-09 15:56 ` Russell King (Oracle)
  0 siblings, 2 replies; 4+ messages in thread
From: Wan Jiabing @ 2022-05-09 13:49 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, netdev, linux-kernel
  Cc: Wan Jiabing

In lanphy_read_page_reg, calling __phy_read() might return a negative
error code. Use 'int' to check the negative error code.

Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
---
 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


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

* Re: [PATCH] net: phy: micrel: Fix incorret variable type in micrel
  2022-05-09 13:49 [PATCH] net: phy: micrel: Fix incorret variable type in micrel Wan Jiabing
@ 2022-05-09 13:53 ` Andrew Lunn
  2022-05-09 13:55   ` Jiabing Wan
  2022-05-09 15:56 ` Russell King (Oracle)
  1 sibling, 1 reply; 4+ messages in thread
From: Andrew Lunn @ 2022-05-09 13:53 UTC (permalink / raw)
  To: Wan Jiabing
  Cc: Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, netdev, linux-kernel

On Mon, May 09, 2022 at 09:49:51PM +0800, Wan Jiabing wrote:
> In lanphy_read_page_reg, calling __phy_read() might return a negative
> error code. Use 'int' to check the negative error code.

Hi Wan

As far as the code goes, this looks good.

Please could you add a Fixes: tag, to indicate where the problem was
introduced. Please also read the netdev FAQ, so you can correctly set
the patch subject. This should be against the net tree, since it is a
fix.

Thanks
	Andrew

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

* Re: [PATCH] net: phy: micrel: Fix incorret variable type in micrel
  2022-05-09 13:53 ` Andrew Lunn
@ 2022-05-09 13:55   ` Jiabing Wan
  0 siblings, 0 replies; 4+ messages in thread
From: Jiabing Wan @ 2022-05-09 13:55 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, netdev, linux-kernel


Hi, Andrew

On 2022/5/9 21:53, Andrew Lunn wrote:
> On Mon, May 09, 2022 at 09:49:51PM +0800, Wan Jiabing wrote:
>> In lanphy_read_page_reg, calling __phy_read() might return a negative
>> error code. Use 'int' to check the negative error code.
> Hi Wan
>
> As far as the code goes, this looks good.
>
> Please could you add a Fixes: tag, to indicate where the problem was
> introduced. Please also read the netdev FAQ, so you can correctly set
> the patch subject. This should be against the net tree, since it is a
> fix.
>
> Thanks
> 	Andrew

OK, I'll fix it in v2.

Thanks,
Wan Jiabing


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

* Re: [PATCH] net: phy: micrel: Fix incorret variable type in micrel
  2022-05-09 13:49 [PATCH] net: phy: micrel: Fix incorret variable type in micrel Wan Jiabing
  2022-05-09 13:53 ` Andrew Lunn
@ 2022-05-09 15:56 ` Russell King (Oracle)
  1 sibling, 0 replies; 4+ messages in thread
From: Russell King (Oracle) @ 2022-05-09 15:56 UTC (permalink / raw)
  To: Wan Jiabing
  Cc: Andrew Lunn, Heiner Kallweit, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, netdev, linux-kernel

Hi,

Please correct the spelling error of "incorrect" in the subject line.
Thanks.


On Mon, May 09, 2022 at 09:49:51PM +0800, Wan Jiabing wrote:
> In lanphy_read_page_reg, calling __phy_read() might return a negative
> error code. Use 'int' to check the negative error code.
> 
> Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
> ---
>  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
> 
> 

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

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

end of thread, other threads:[~2022-05-09 15:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-09 13:49 [PATCH] net: phy: micrel: Fix incorret variable type in micrel Wan Jiabing
2022-05-09 13:53 ` Andrew Lunn
2022-05-09 13:55   ` Jiabing Wan
2022-05-09 15:56 ` Russell King (Oracle)

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.