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

Commit 9cfd8837 authored by Sergio Paracuellos's avatar Sergio Paracuellos Committed by Greg Kroah-Hartman
Browse files

staging: ks7010: refactor hostif_sme_power_mgmt_set function



Some minor changes have been done in this function to clean
it a bit:
    - POWER_MGMT_ACTIVE and default case are the same so
      just handle that with the same block of code,
    - POWER_MGMT_SAVE1 replaces if-else with a ternary operator.

Signed-off-by: default avatarSergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 04e7f80e
Loading
Loading
Loading
Loading
+4 −13
Original line number Diff line number Diff line
@@ -1962,21 +1962,11 @@ void hostif_sme_power_mgmt_set(struct ks_wlan_private *priv)
	unsigned long mode, wake_up, receive_dtims;

	switch (priv->reg.power_mgmt) {
	case POWER_MGMT_ACTIVE:
		mode = POWER_ACTIVE;
		wake_up = 0;
		receive_dtims = 0;
		break;
	case POWER_MGMT_SAVE1:
		if (priv->reg.operation_mode == MODE_INFRASTRUCTURE) {
			mode = POWER_SAVE;
		mode = (priv->reg.operation_mode == MODE_INFRASTRUCTURE) ?
			POWER_SAVE : POWER_ACTIVE;
		wake_up = 0;
		receive_dtims = 0;
		} else {
			mode = POWER_ACTIVE;
			wake_up = 0;
			receive_dtims = 0;
		}
		break;
	case POWER_MGMT_SAVE2:
		if (priv->reg.operation_mode == MODE_INFRASTRUCTURE) {
@@ -1989,6 +1979,7 @@ void hostif_sme_power_mgmt_set(struct ks_wlan_private *priv)
			receive_dtims = 0;
		}
		break;
	case POWER_MGMT_ACTIVE:
	default:
		mode = POWER_ACTIVE;
		wake_up = 0;