aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2021-06-01 09:36:53 +0200
committerAleksander Morgado <aleksander@aleksander.es>2021-06-01 09:36:53 +0200
commite25a585c9fd8c3f58ec01723843fe3c08c30c1ad (patch)
treeb1c4c09060b5ec7be67bf621e8a2e26b9cf0c8cb
parent52bf2c641171ded9e617022f40497c8984520371 (diff)
broadband-modem-mbim: skip switch() when selecting MBIM services
Having a switch() for the MBIM services when processing indications forces us to update it on every new MBIM service added to libmbim, because we build with -Wswitch-enum by default. This warning type is extremely useful, and we should not stop using it, so let's simplify a bit the indication handling code and skip using a switch(). There are right now only 4 different service indications expected, so it shouldn't be a big deal.
-rw-r--r--src/mm-broadband-modem-mbim.c30
1 files changed, 4 insertions, 26 deletions
diff --git a/src/mm-broadband-modem-mbim.c b/src/mm-broadband-modem-mbim.c
index 85e6501c..c87c3ca0 100644
--- a/src/mm-broadband-modem-mbim.c
+++ b/src/mm-broadband-modem-mbim.c
@@ -3741,36 +3741,14 @@ device_notification_cb (MbimDevice *device,
mbim_cid_get_printable (service,
mbim_message_indicate_status_get_cid (notification)));
- switch (service) {
- case MBIM_SERVICE_BASIC_CONNECT:
+ if (service == MBIM_SERVICE_BASIC_CONNECT)
basic_connect_notification (self, notification);
- break;
- case MBIM_SERVICE_MS_BASIC_CONNECT_EXTENSIONS:
+ else if (service == MBIM_SERVICE_MS_BASIC_CONNECT_EXTENSIONS)
ms_basic_connect_extensions_notification (self, notification);
- break;
- case MBIM_SERVICE_SMS:
+ else if (service == MBIM_SERVICE_SMS)
sms_notification (self, notification);
- break;
- case MBIM_SERVICE_USSD:
+ else if (service == MBIM_SERVICE_USSD)
ussd_notification (self, notification);
- break;
- case MBIM_SERVICE_INVALID:
- case MBIM_SERVICE_PHONEBOOK:
- case MBIM_SERVICE_STK:
- case MBIM_SERVICE_AUTH:
- case MBIM_SERVICE_DSS:
- case MBIM_SERVICE_MS_FIRMWARE_ID:
- case MBIM_SERVICE_MS_HOST_SHUTDOWN:
- case MBIM_SERVICE_PROXY_CONTROL:
- case MBIM_SERVICE_QMI:
- case MBIM_SERVICE_ATDS:
- case MBIM_SERVICE_INTEL_FIRMWARE_UPDATE:
- case MBIM_SERVICE_MS_SAR:
- case MBIM_SERVICE_QDU:
- default:
- /* Ignore */
- break;
- }
}
static void