Skip to content

Commit

Permalink
ehea: Simplify resource usage check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Thomas Klein authored and Jeff Garzik committed Aug 7, 2007
1 parent f46f6ba commit 35cf2e2
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions drivers/net/ehea/ehea_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 35cf2e2

Please sign in to comment.