lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210228120027.76488180@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date:   Sun, 28 Feb 2021 12:00:27 -0800
From:   Jakub Kicinski <kuba@...nel.org>
To:     Ioana Ciornei <ciorneiioana@...il.com>
Cc:     davem@...emloft.net, netdev@...r.kernel.org, andrew@...n.ch,
        hkallweit1@...il.com, linux@...linux.org.uk,
        Ioana Ciornei <ioana.ciornei@....com>,
        Sven Schuchmann <schuchmann@...leissheimer.de>
Subject: Re: [PATCH net] net: phy: ti: take into account all possible
 interrupt sources

On Fri, 26 Feb 2021 17:30:20 +0200 Ioana Ciornei wrote:
> diff --git a/drivers/net/phy/dp83822.c b/drivers/net/phy/dp83822.c
> index be1224b4447b..f7a2ec150e54 100644
> --- a/drivers/net/phy/dp83822.c
> +++ b/drivers/net/phy/dp83822.c
> @@ -290,6 +290,7 @@ static int dp83822_config_intr(struct phy_device *phydev)
>  
>  static irqreturn_t dp83822_handle_interrupt(struct phy_device *phydev)
>  {
> +	bool trigger_machine = false;
>  	int irq_status;
>  
>  	/* The MISR1 and MISR2 registers are holding the interrupt status in
> @@ -305,7 +306,7 @@ static irqreturn_t dp83822_handle_interrupt(struct phy_device *phydev)
>  		return IRQ_NONE;
>  	}
>  	if (irq_status & ((irq_status & GENMASK(7, 0)) << 8))
> -		goto trigger_machine;
> +		trigger_machine = true;
>  
>  	irq_status = phy_read(phydev, MII_DP83822_MISR2);
>  	if (irq_status < 0) {
> @@ -313,11 +314,11 @@ static irqreturn_t dp83822_handle_interrupt(struct phy_device *phydev)
>  		return IRQ_NONE;
>  	}
>  	if (irq_status & ((irq_status & GENMASK(7, 0)) << 8))
> -		goto trigger_machine;
> +		trigger_machine = true;
>  
> -	return IRQ_NONE;
> +	if (!trigger_machine)
> +		return IRQ_NONE;
>  
> -trigger_machine:
>  	phy_trigger_machine(phydev);
>  
>  	return IRQ_HANDLED;

Would it be better to code it up as:

	irqreturn_t ret = IRQ_NONE;

	if (irq_status & ...)
		ret = IRQ_HANDLED;

	/* .. */

	if (ret != IRQ_NONE)
		phy_trigger_machine(phydev);

	return ret;

That reads a tiny bit better to me, but it's probably majorly
subjective so I'm happy with existing patch if you prefer it.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ