Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1559083

[PATCH net-next v3 04/10] net: dsa: Move ports assignment closer to error checking

From Florian Fainelli <f.fainelli@gmail.com>
Newsgroups linux.kernel
Subject [PATCH net-next v3 04/10] net: dsa: Move ports assignment closer to error checking
Date 2017-01-14 22:50 +0100
Message-ID <sZEn0-2E8-35@gated-at.bofh.it> (permalink)
References <sZEmZ-2E8-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Move the assignment of ports in _dsa_register_switch() closer to where
it is checked, no functional change. Re-order declarations to be
preserve the inverted christmas tree style.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 net/dsa/dsa2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c
index 04ab62251fe3..cd91070b5467 100644
--- a/net/dsa/dsa2.c
+++ b/net/dsa/dsa2.c
@@ -587,8 +587,8 @@ static struct device_node *dsa_get_ports(struct dsa_switch *ds,
 static int _dsa_register_switch(struct dsa_switch *ds, struct device *dev)
 {
 	struct device_node *np = dev->of_node;
-	struct device_node *ports = dsa_get_ports(ds, np);
 	struct dsa_switch_tree *dst;
+	struct device_node *ports;
 	u32 tree, index;
 	int i, err;
 
@@ -596,6 +596,7 @@ static int _dsa_register_switch(struct dsa_switch *ds, struct device *dev)
 	if (err)
 		return err;
 
+	ports = dsa_get_ports(ds, np);
 	if (IS_ERR(ports))
 		return PTR_ERR(ports);
 
-- 
2.9.3

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH net-next v3 00/10] net: dsa: Support for pdata in dsa2 Florian Fainelli <f.fainelli@gmail.com> - 2017-01-14 22:50 +0100
  [PATCH net-next v3 08/10] net: dsa: Add support for platform data Florian Fainelli <f.fainelli@gmail.com> - 2017-01-14 22:50 +0100
  [PATCH net-next v3 10/10] ARM: orion: Register DSA switch as a MDIO device Florian Fainelli <f.fainelli@gmail.com> - 2017-01-14 22:50 +0100
  [PATCH net-next v3 04/10] net: dsa: Move ports assignment closer to error checking Florian Fainelli <f.fainelli@gmail.com> - 2017-01-14 22:50 +0100
    Re: [PATCH net-next v3 04/10] net: dsa: Move ports assignment closer  to error checking Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2017-01-15 11:20 +0100
  [PATCH net-next v3 02/10] net: dsa: Make most functions take a dsa_port argument Florian Fainelli <f.fainelli@gmail.com> - 2017-01-14 23:00 +0100
  Re: [PATCH net-next v3 00/10] net: dsa: Support for pdata in dsa2 Greg KH <gregkh@linuxfoundation.org> - 2017-01-15 12:10 +0100
    Re: [PATCH net-next v3 00/10] net: dsa: Support for pdata in dsa2 Florian Fainelli <f.fainelli@gmail.com> - 2017-01-15 18:50 +0100
      Re: [PATCH net-next v3 00/10] net: dsa: Support for pdata in dsa2 Greg KH <gregkh@linuxfoundation.org> - 2017-01-15 18:50 +0100

csiph-web