summaryrefslogtreecommitdiffstats
path: root/drivers/net/ehea
diff options
context:
space:
mode:
authorThomas Klein <osstklei@de.ibm.com>2007-08-06 13:55:14 +0200
committerJeff Garzik <jeff@garzik.org>2007-08-07 17:34:13 -0400
commit35cf2e2e3b96c070a615d699bf514ffec6afd19e (patch)
treeb3e404b42f396c0acdf541005f21a2d99f1cdca0 /drivers/net/ehea
parentf46f6ba99bad942963cc4b4cc4aabcc55a567b4a (diff)
downloadop-kernel-dev-35cf2e2e3b96c070a615d699bf514ffec6afd19e.zip
op-kernel-dev-35cf2e2e3b96c070a615d699bf514ffec6afd19e.tar.gz
ehea: Simplify resource usage check
Use shorter method to determine whether adapter has configured ports Signed-off-by: Thomas Klein <tklein@de.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/ehea')
-rw-r--r--drivers/net/ehea/ehea_main.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index d43ab0f..36ca322 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -2165,24 +2165,18 @@ static int ehea_clean_all_portres(struct ehea_port *port)
return ret;
}
-static void ehea_remove_adapter_mr (struct ehea_adapter *adapter)
+static void ehea_remove_adapter_mr(struct ehea_adapter *adapter)
{
- int i;
-
- for (i=0; i < EHEA_MAX_PORTS; i++)
- if (adapter->port[i])
- return;
+ if (adapter->active_ports)
+ return;
ehea_rem_mr(&adapter->mr);
}
-static int ehea_add_adapter_mr (struct ehea_adapter *adapter)
+static int ehea_add_adapter_mr(struct ehea_adapter *adapter)
{
- int i;
-
- for (i=0; i < EHEA_MAX_PORTS; i++)
- if (adapter->port[i])
- return 0;
+ if (adapter->active_ports)
+ return 0;
return ehea_reg_kernel_mr(adapter, &adapter->mr);
}
OpenPOWER on IntegriCloud