Commit 4e99c98e authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Mika Westerberg
Browse files

thunderbolt: Get rid of redundant 'else'



In the snippets like the following

	if (...)
		return / goto / break / continue ...;
	else
		...

the 'else' is redundant. Get rid of it.

Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
parent ebde5ba2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -341,7 +341,7 @@ static struct acpi_device *tb_acpi_find_companion(struct device *dev)
	 */
	if (tb_is_switch(dev))
		return tb_acpi_switch_find_companion(tb_to_switch(dev));
	else if (tb_is_usb4_port_device(dev))
	if (tb_is_usb4_port_device(dev))
		return acpi_find_child_by_adr(ACPI_COMPANION(dev->parent),
					      tb_to_usb4_port_device(dev)->port->port);
	return NULL;
+1 −1
Original line number Diff line number Diff line
@@ -1033,7 +1033,7 @@ static int tb_cfg_get_error(struct tb_ctl *ctl, enum tb_cfg_space space,

	if (res->tb_error == TB_CFG_ERROR_LOCK)
		return -EACCES;
	else if (res->tb_error == TB_CFG_ERROR_PORT_NOT_CONNECTED)
	if (res->tb_error == TB_CFG_ERROR_PORT_NOT_CONNECTED)
		return -ENOTCONN;

	return -EIO;
+2 −1
Original line number Diff line number Diff line
@@ -515,7 +515,8 @@ static int nhi_alloc_hop(struct tb_nhi *nhi, struct tb_ring *ring)
			 ring->hop);
		ret = -EBUSY;
		goto err_unlock;
	} else if (!ring->is_tx && nhi->rx_rings[ring->hop]) {
	}
	if (!ring->is_tx && nhi->rx_rings[ring->hop]) {
		dev_warn(&nhi->pdev->dev, "RX hop %d already allocated\n",
			 ring->hop);
		ret = -EBUSY;
+2 −2
Original line number Diff line number Diff line
@@ -271,9 +271,9 @@ static int nvm_authenticate(struct tb_switch *sw, bool auth_only)
		}
		sw->nvm->authenticating = true;
		return usb4_switch_nvm_authenticate(sw);
	} else if (auth_only) {
		return -EOPNOTSUPP;
	}
	if (auth_only)
		return -EOPNOTSUPP;

	sw->nvm->authenticating = true;
	if (!tb_route(sw)) {
+3 −3
Original line number Diff line number Diff line
@@ -851,7 +851,7 @@ bool usb4_switch_query_dp_resource(struct tb_switch *sw, struct tb_port *in)
	 */
	if (ret == -EOPNOTSUPP)
		return true;
	else if (ret)
	if (ret)
		return false;

	return !status;
@@ -877,7 +877,7 @@ int usb4_switch_alloc_dp_resource(struct tb_switch *sw, struct tb_port *in)
			     &status);
	if (ret == -EOPNOTSUPP)
		return 0;
	else if (ret)
	if (ret)
		return ret;

	return status ? -EBUSY : 0;
@@ -900,7 +900,7 @@ int usb4_switch_dealloc_dp_resource(struct tb_switch *sw, struct tb_port *in)
			     &status);
	if (ret == -EOPNOTSUPP)
		return 0;
	else if (ret)
	if (ret)
		return ret;

	return status ? -EIO : 0;
Loading