mwifiex: scan: simplify ternary operators using gnu extension
authorAndreas Fenkart <afenkart@gmail.com>
Thu, 10 Mar 2016 08:44:07 +0000 (09:44 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 15 Apr 2016 18:34:45 +0000 (21:34 +0300)
"x ? x : y" can be simplified as "x ? : y"
https://gcc.gnu.org/onlinedocs/gcc/Conditionals.html#Conditionals

Reviewed-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: Andreas Fenkart <afenkart@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/marvell/mwifiex/scan.c

index e926d3ab728653322ee686f3ae8217ba718c5ed9..11f8a608b8af36b43753d8a76595a824f4b24c6a 100644 (file)
@@ -900,14 +900,11 @@ mwifiex_config_scan(struct mwifiex_private *priv,
                /* Set the BSS type scan filter, use Adapter setting if
                   unset */
                scan_cfg_out->bss_mode =
-                       (user_scan_in->bss_mode ? (u8) user_scan_in->
-                        bss_mode : (u8) adapter->scan_mode);
+                       (u8)(user_scan_in->bss_mode ?: adapter->scan_mode);
 
                /* Set the number of probes to send, use Adapter setting
                   if unset */
-               num_probes =
-                       (user_scan_in->num_probes ? user_scan_in->
-                        num_probes : adapter->scan_probes);
+               num_probes = user_scan_in->num_probes ?: adapter->scan_probes;
 
                /*
                 * Set the BSSID filter to the incoming configuration,