summaryrefslogtreecommitdiff
path: root/src/devices/wwan
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2018-04-24 11:20:03 +0200
committerLubomir Rintel <lkundrak@v3.sk>2018-05-10 14:36:58 +0200
commite69d386975be997d3d840de9045e51521ac4474c (patch)
treec240198404e8bdc5396c3e9608d0cc387337abfc /src/devices/wwan
parentf0c1efbf426260c6ed45f3ae83b9a4e2b5a347c4 (diff)
all: use the elvis operator wherever possible
Coccinelle: @@ expression a, b; @@ -a ? a : b +a ?: b Applied with: spatch --sp-file ternary.cocci --in-place --smpl-spacing --dir . With some manual adjustments on spots that Cocci didn't catch for reasons unknown. Thanks to the marvelous effort of the GNU compiler developer we can now spare a couple of bits that could be used for more important things, like this commit message. Standards commitees yet have to catch up.
Diffstat (limited to 'src/devices/wwan')
-rw-r--r--src/devices/wwan/nm-modem-broadband.c2
-rw-r--r--src/devices/wwan/nm-modem.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/devices/wwan/nm-modem-broadband.c b/src/devices/wwan/nm-modem-broadband.c
index a58eb7875..e5678b963 100644
--- a/src/devices/wwan/nm-modem-broadband.c
+++ b/src/devices/wwan/nm-modem-broadband.c
@@ -286,7 +286,7 @@ create_gsm_connect_properties (NMConnection *connection)
/* Blank APN ("") means the default subscription APN */
str = nm_setting_gsm_get_apn (setting);
- mm_simple_connect_properties_set_apn (properties, str ? str : "");
+ mm_simple_connect_properties_set_apn (properties, str ?: "");
str = nm_setting_gsm_get_network_id (setting);
if (str)
diff --git a/src/devices/wwan/nm-modem.c b/src/devices/wwan/nm-modem.c
index 61b7247ec..80336d720 100644
--- a/src/devices/wwan/nm-modem.c
+++ b/src/devices/wwan/nm-modem.c
@@ -205,7 +205,7 @@ nm_modem_set_state (NMModem *self,
_LOGI ("modem state changed, '%s' --> '%s' (reason: %s)",
nm_modem_state_to_string (old_state),
nm_modem_state_to_string (new_state),
- reason ? reason : "none");
+ reason ?: "none");
priv->state = new_state;
_notify (self, PROP_STATE);