提交 35cf2e2e 编写于 作者: T Thomas Klein 提交者: Jeff Garzik

ehea: Simplify resource usage check

Use shorter method to determine whether adapter has configured ports
Signed-off-by: NThomas Klein <tklein@de.ibm.com>
Signed-off-by: NJeff Garzik <jeff@garzik.org>
上级 f46f6ba9
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册