From: Christian Marangi <ansuelsmth@gmail.com>
To: "Russell King (Oracle)" <linux@armlinux.org.uk>
Cc: Andrew Lunn <andrew@lunn.ch>,
Heiner Kallweit <hkallweit1@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [net-next PATCH] net: phy: at803x: better align function varibles to open parenthesis
Date: Tue, 2 Jan 2024 11:00:42 +0100 [thread overview]
Message-ID: <6593deca.5d0a0220.416f0.a39a@mx.google.com> (raw)
In-Reply-To: <ZZPdGnJQ1V/E8zBP@shell.armlinux.org.uk>
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@armlinux.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
prev parent reply other threads:[~2024-01-02 10:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-17 23:50 [net-next PATCH] net: phy: at803x: better align function varibles to open parenthesis Christian Marangi
2023-12-18 9:47 ` Andrew Lunn
2024-01-02 9:53 ` Russell King (Oracle)
2024-01-02 10:00 ` Christian Marangi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6593deca.5d0a0220.416f0.a39a@mx.google.com \
--to=ansuelsmth@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).