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] [day] [month] [year] [list]
Message-ID: <6593deca.5d0a0220.416f0.a39a@mx.google.com>
Date: Tue, 2 Jan 2024 11:00:42 +0100
From: Christian Marangi <ansuelsmth@...il.com>
To: "Russell King (Oracle)" <linux@...linux.org.uk>
Cc: Andrew Lunn <andrew@...n.ch>, Heiner Kallweit <hkallweit1@...il.com>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [net-next PATCH] net: phy: at803x: better align function
 varibles to open parenthesis

On Tue, Jan 02, 2024 at 09:53:30AM +0000, Russell King (Oracle) wrote:
> On Mon, Dec 18, 2023 at 12:50:11AM +0100, Christian Marangi wrote:
> > -	if (qca808x_cdt_fault_length_valid(pair_a))
> > -		ethnl_cable_test_fault_length(phydev, ETHTOOL_A_CABLE_PAIR_A,
> > -				qca808x_cdt_fault_length(phydev, ETHTOOL_A_CABLE_PAIR_A));
> > -	if (qca808x_cdt_fault_length_valid(pair_b))
> > -		ethnl_cable_test_fault_length(phydev, ETHTOOL_A_CABLE_PAIR_B,
> > -				qca808x_cdt_fault_length(phydev, ETHTOOL_A_CABLE_PAIR_B));
> > -	if (qca808x_cdt_fault_length_valid(pair_c))
> > -		ethnl_cable_test_fault_length(phydev, ETHTOOL_A_CABLE_PAIR_C,
> > -				qca808x_cdt_fault_length(phydev, ETHTOOL_A_CABLE_PAIR_C));
> > -	if (qca808x_cdt_fault_length_valid(pair_d))
> > -		ethnl_cable_test_fault_length(phydev, ETHTOOL_A_CABLE_PAIR_D,
> > -				qca808x_cdt_fault_length(phydev, ETHTOOL_A_CABLE_PAIR_D));
> > +	if (qca808x_cdt_fault_length_valid(pair_a)) {
> > +		val = qca808x_cdt_fault_length(phydev, ETHTOOL_A_CABLE_PAIR_A);
> > +		ethnl_cable_test_fault_length(phydev, ETHTOOL_A_CABLE_PAIR_A, val);
> > +	}
> > +	if (qca808x_cdt_fault_length_valid(pair_b)) {
> > +		val = qca808x_cdt_fault_length(phydev, ETHTOOL_A_CABLE_PAIR_B);
> > +		ethnl_cable_test_fault_length(phydev, ETHTOOL_A_CABLE_PAIR_B, val);
> > +	}
> > +	if (qca808x_cdt_fault_length_valid(pair_c)) {
> > +		val = qca808x_cdt_fault_length(phydev, ETHTOOL_A_CABLE_PAIR_C);
> > +		ethnl_cable_test_fault_length(phydev, ETHTOOL_A_CABLE_PAIR_C, val);
> > +	}
> > +	if (qca808x_cdt_fault_length_valid(pair_d)) {
> > +		val = qca808x_cdt_fault_length(phydev, ETHTOOL_A_CABLE_PAIR_D);
> > +		ethnl_cable_test_fault_length(phydev, ETHTOOL_A_CABLE_PAIR_D, val);
> > +	}
> 
> Maybe a static function for these?
> 
> static void qca808x_get_cdt_length(struct phy_device *phydev, u8 pair)
> {
> 	ethnl_cable_test_fault_length(phydev, pair,
> 				      qca808x_cdt_fault_length(phydev, pair));
> }
> 
> or going via 'val'. Either way, repeating the same two lines multiple
> times seems a bit suboptimal.
> 
> Whether or not you do this:
> 
> Reviewed-by: Russell King (Oracle) <rmk+kernel@...linux.org.uk>
> 
> Thanks!
>

Hi, this has been merged, I will send a followup patch to address this!
(the function has to be touched anyway as it's used by another PHY
Family)

-- 
	Ansuel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ