All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergio Paracuellos <sergio.paracuellos@gmail.com>
To: gregkh@linuxfoundation.org
Cc: driverdev-devel@linuxdriverproject.org, wsa@the-dreams.de
Subject: [PATCH 13/16] staging: ks7010: avoid if-else condition in ks_wlan_get_power
Date: Wed, 25 Apr 2018 16:01:52 +0200	[thread overview]
Message-ID: <1524664915-24987-14-git-send-email-sergio.paracuellos@gmail.com> (raw)
In-Reply-To: <1524664915-24987-1-git-send-email-sergio.paracuellos@gmail.com>

The if-else code in ks_wlan_get_power function is not needed
at all and can be achieved with a simple boolean assignation.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/ks7010/ks_wlan_net.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
index 1387783..df828d6 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -1061,10 +1061,7 @@ static int ks_wlan_get_power(struct net_device *dev,
 	if (priv->sleep_mode == SLP_SLEEP)
 		return -EPERM;
 	/* for SLEEP MODE */
-	if (priv->reg.power_mgmt > 0)
-		vwrq->power.disabled = 0;
-	else
-		vwrq->power.disabled = 1;
+	vwrq->power.disabled = (priv->reg.power_mgmt <= 0);
 
 	return 0;
 }
-- 
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  parent reply	other threads:[~2018-04-25 14:02 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-25 14:01 [PATCH 00/16] staging: ks7010: next cleanups Sergio Paracuellos
2018-04-25 14:01 ` [PATCH 01/16] staging: ks7010: add SPDX identifiers to all files Sergio Paracuellos
2018-04-26  7:17   ` Greg KH
2018-04-26  8:35     ` Sergio Paracuellos
2018-04-26  8:55       ` Greg KH
2018-04-26  9:04         ` Sergio Paracuellos
2018-04-25 14:01 ` [PATCH 02/16] staging: ks7010: refactor ks_wlan_set_beacon_lost function Sergio Paracuellos
2018-04-25 14:01 ` [PATCH 03/16] staging: ks7010: refactor ks_wlan_set_scan_type function Sergio Paracuellos
2018-04-25 14:01 ` [PATCH 04/16] staging: ks7010: refactor ks_wlan_set_power_mgmt function Sergio Paracuellos
2018-04-25 14:01 ` [PATCH 05/16] staging: ks7010: refactor ks_wlan_set_preamble function Sergio Paracuellos
2018-04-25 14:01 ` [PATCH 06/16] staging: ks7010: refactor ks_wlan_set_cts_mode function Sergio Paracuellos
2018-04-25 14:01 ` [PATCH 07/16] staging: ks7010: refactor ks_wlan_set_pmksa function Sergio Paracuellos
2018-04-25 14:01 ` [PATCH 08/16] staging: ks7010: use ether_addr_copy in ks_wlan_set_encode_ext Sergio Paracuellos
2018-04-25 14:01 ` [PATCH 09/16] staging: ks7010: align values in frequency_list array Sergio Paracuellos
2018-04-25 14:01 ` [PATCH 10/16] staging: ks7010: refactor ks_wlan_set_wap function Sergio Paracuellos
2018-04-25 14:01 ` [PATCH 11/16] staging: ks7010: use ether_addr_copy in ks_wlan_get_wap Sergio Paracuellos
2018-04-25 14:01 ` [PATCH 12/16] staging: ks7010: avoid an 'else' in ks_wlan_set_power Sergio Paracuellos
2018-04-25 14:01 ` Sergio Paracuellos [this message]
2018-04-25 14:01 ` [PATCH 14/16] staging: ks7010: use ether_addr_copy in ks_wlan_get_aplist Sergio Paracuellos
2018-04-25 14:01 ` [PATCH 15/16] staging: ks7010: avoid blank line between declarations " Sergio Paracuellos
2018-04-25 14:01 ` [PATCH 16/16] staging: ks7010: refactor ks_wlan_translate_scan function Sergio Paracuellos
2018-04-27 11:00   ` Dan Carpenter
2018-04-27 13:33     ` Sergio Paracuellos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1524664915-24987-14-git-send-email-sergio.paracuellos@gmail.com \
    --to=sergio.paracuellos@gmail.com \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=wsa@the-dreams.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.