Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 35cf2e2e authored by Thomas Klein's avatar Thomas Klein Committed by Jeff Garzik
Browse files

ehea: Simplify resource usage check



Use shorter method to determine whether adapter has configured ports

Signed-off-by: default avatarThomas Klein <tklein@de.ibm.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent f46f6ba9
Loading
Loading
Loading
Loading
+6 −12
Original line number Diff line number Diff line
@@ -2167,10 +2167,7 @@ static int ehea_clean_all_portres(struct ehea_port *port)

static void ehea_remove_adapter_mr(struct ehea_adapter *adapter)
{
	int i;

	for (i=0; i < EHEA_MAX_PORTS; i++)
		if (adapter->port[i])
	if (adapter->active_ports)
		return;

	ehea_rem_mr(&adapter->mr);
@@ -2178,10 +2175,7 @@ static void ehea_remove_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])
	if (adapter->active_ports)
		return 0;

	return ehea_reg_kernel_mr(adapter, &adapter->mr);