aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2019-04-02 09:16:12 -0500
committerDan Williams <dcbw@redhat.com>2019-04-02 10:48:40 -0500
commit88fac7f14a8898a7856a6868bbd94d4cf576723a (patch)
tree700753959d987c211d00cbf675af51d1eaadcceb /src
parent093174c84da265059eda2591cf79593abb567f3a (diff)
build: fix -Wunused-but-set-variable support and handle clang better
By default the build used -Wno-unused-but-set-variable but that's clearly not what we want. Fix those problems. When using clang, the compiler doesn't error on unknown compile options, so let's add -Werror to the checking too. CC='clang' configure:3408: checking for gcc configure:3435: result: clang ... configure:17644: checking whether gcc understands -Wno-unused-but-set-variable configure:17657: clang -c -Wall -std=gnu89 -g -O2 -Wmissing-declarations -Wmissing-prototypes -Wdeclaration-after-statement -Wstrict-prototypes -Wno-unused-parameter -Wno-sign-compare -Wno-deprecated-declarations -Wno-unused-but-set-variable conftest.c >&5 warning: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'? [-Wunknown-warning-option] 1 warning generated. configure:17657: $? = 0 configure:17666: result: yes Reported-by: Torsten Hilbrich <torsten.hilbrich@secunet.com>
Diffstat (limited to 'src')
-rw-r--r--src/mm-broadband-bearer.c2
-rw-r--r--src/mm-broadband-modem-mbim.c68
-rw-r--r--src/mm-port-probe.c22
-rw-r--r--src/mm-shared-qmi.c20
4 files changed, 43 insertions, 69 deletions
diff --git a/src/mm-broadband-bearer.c b/src/mm-broadband-bearer.c
index 16acb2b1..aa6654e4 100644
--- a/src/mm-broadband-bearer.c
+++ b/src/mm-broadband-bearer.c
@@ -261,10 +261,8 @@ dial_cdma_ready (MMBaseModem *modem,
static void
cdma_connect_context_dial (GTask *task)
{
- MMBroadbandBearer *self;
DetailedConnectContext *ctx;
- self = g_task_get_source_object (task);
ctx = g_task_get_task_data (task);
mm_base_modem_at_command_full (ctx->modem,
diff --git a/src/mm-broadband-modem-mbim.c b/src/mm-broadband-modem-mbim.c
index 62b2fcd7..1cc4ec2a 100644
--- a/src/mm-broadband-modem-mbim.c
+++ b/src/mm-broadband-modem-mbim.c
@@ -238,44 +238,47 @@ modem_load_current_capabilities_finish (MMIfaceModem *self,
static void
complete_current_capabilities (GTask *task)
{
- MMBroadbandModemMbim *self;
LoadCurrentCapabilitiesContext *ctx;
MMModemCapability result = 0;
- self = g_task_get_source_object (task);
ctx = g_task_get_task_data (task);
#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED
- /* Warn if the MBIM loaded capabilities isn't a subset of the QMI loaded ones */
- if (ctx->current_qmi && ctx->current_mbim) {
- gchar *mbim_caps_str;
- gchar *qmi_caps_str;
+ {
+ MMBroadbandModemMbim *self;
- mbim_caps_str = mm_common_build_capabilities_string ((const MMModemCapability *)&(ctx->current_mbim), 1);
- qmi_caps_str = mm_common_build_capabilities_string ((const MMModemCapability *)&(ctx->current_qmi), 1);
+ self = g_task_get_source_object (task);
+ /* Warn if the MBIM loaded capabilities isn't a subset of the QMI loaded ones */
+ if (ctx->current_qmi && ctx->current_mbim) {
+ gchar *mbim_caps_str;
+ gchar *qmi_caps_str;
- if ((ctx->current_mbim & ctx->current_qmi) != ctx->current_mbim)
- mm_warn ("MBIM reported current capabilities (%s) not found in QMI-over-MBIM reported ones (%s)",
- mbim_caps_str, qmi_caps_str);
- else
- mm_dbg ("MBIM reported current capabilities (%s) is a subset of the QMI-over-MBIM reported ones (%s)",
- mbim_caps_str, qmi_caps_str);
- g_free (mbim_caps_str);
- g_free (qmi_caps_str);
-
- result = ctx->current_qmi;
- self->priv->qmi_capability_and_mode_switching = TRUE;
- } else if (ctx->current_qmi) {
- result = ctx->current_qmi;
- self->priv->qmi_capability_and_mode_switching = TRUE;
- } else
- result = ctx->current_mbim;
+ mbim_caps_str = mm_common_build_capabilities_string ((const MMModemCapability *)&(ctx->current_mbim), 1);
+ qmi_caps_str = mm_common_build_capabilities_string ((const MMModemCapability *)&(ctx->current_qmi), 1);
- /* If current capabilities loading is done via QMI, we can safely assume that all the other
- * capability and mode related operations are going to be done via QMI as well, so that we
- * don't mix both logics */
- if (self->priv->qmi_capability_and_mode_switching)
- mm_info ("QMI-based capability and mode switching support enabled");
+ if ((ctx->current_mbim & ctx->current_qmi) != ctx->current_mbim)
+ mm_warn ("MBIM reported current capabilities (%s) not found in QMI-over-MBIM reported ones (%s)",
+ mbim_caps_str, qmi_caps_str);
+ else
+ mm_dbg ("MBIM reported current capabilities (%s) is a subset of the QMI-over-MBIM reported ones (%s)",
+ mbim_caps_str, qmi_caps_str);
+ g_free (mbim_caps_str);
+ g_free (qmi_caps_str);
+
+ result = ctx->current_qmi;
+ self->priv->qmi_capability_and_mode_switching = TRUE;
+ } else if (ctx->current_qmi) {
+ result = ctx->current_qmi;
+ self->priv->qmi_capability_and_mode_switching = TRUE;
+ } else
+ result = ctx->current_mbim;
+
+ /* If current capabilities loading is done via QMI, we can safely assume that all the other
+ * capability and mode related operations are going to be done via QMI as well, so that we
+ * don't mix both logics */
+ if (self->priv->qmi_capability_and_mode_switching)
+ mm_info ("QMI-based capability and mode switching support enabled");
+ }
#else
result = ctx->current_mbim;
#endif
@@ -1967,9 +1970,7 @@ static void
allocate_next_qmi_client (GTask *task)
{
InitializationStartedContext *ctx;
- MMBroadbandModemMbim *self;
- self = g_task_get_source_object (task);
ctx = g_task_get_task_data (task);
if (ctx->qmi_service_index == G_N_ELEMENTS (qmi_services)) {
@@ -2608,12 +2609,9 @@ set_lte_attach_configuration_set_ready (MbimDevice *device,
GAsyncResult *res,
GTask *task)
{
- MMBroadbandModemMbim *self;
MbimMessage *response;
GError *error = NULL;
- self = g_task_get_source_object (task);
-
response = mbim_device_command_finish (device, res, &error);
if (!response || !mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error))
g_task_return_error (task, error);
@@ -2630,7 +2628,6 @@ before_set_lte_attach_configuration_query_ready (MbimDevice *device,
GAsyncResult *res,
GTask *task)
{
- MMBroadbandModemMbim *self;
MbimMessage *request;
MbimMessage *response;
GError *error = NULL;
@@ -2639,7 +2636,6 @@ before_set_lte_attach_configuration_query_ready (MbimDevice *device,
MbimLteAttachConfiguration **configurations = NULL;
guint i;
- self = g_task_get_source_object (task);
config = g_task_get_task_data (task);
response = mbim_device_command_finish (device, res, &error);
diff --git a/src/mm-port-probe.c b/src/mm-port-probe.c
index 9913001b..c02f0b23 100644
--- a/src/mm-port-probe.c
+++ b/src/mm-port-probe.c
@@ -1676,29 +1676,29 @@ MMPortType
mm_port_probe_get_port_type (MMPortProbe *self)
{
const gchar *subsys;
- const gchar *name;
g_return_val_if_fail (MM_IS_PORT_PROBE (self), FALSE);
subsys = mm_kernel_device_get_subsystem (self->priv->port);
- name = mm_kernel_device_get_name (self->priv->port);
if (g_str_equal (subsys, "net"))
return MM_PORT_TYPE_NET;
+ if (g_str_has_prefix (subsys, "usb")) {
+ const gchar *name;
+
+ name = mm_kernel_device_get_name (self->priv->port);
+ if (g_str_has_prefix (name, "cdc-wdm")) {
#if defined WITH_QMI
- if (g_str_has_prefix (subsys, "usb") &&
- g_str_has_prefix (name, "cdc-wdm") &&
- self->priv->is_qmi)
- return MM_PORT_TYPE_QMI;
+ if (self->priv->is_qmi)
+ return MM_PORT_TYPE_QMI;
#endif
-
#if defined WITH_MBIM
- if (g_str_has_prefix (subsys, "usb") &&
- g_str_has_prefix (name, "cdc-wdm") &&
- self->priv->is_mbim)
- return MM_PORT_TYPE_MBIM;
+ if (self->priv->is_mbim)
+ return MM_PORT_TYPE_MBIM;
#endif
+ }
+ }
if (self->priv->flags & MM_PORT_PROBE_QCDM &&
self->priv->is_qcdm)
diff --git a/src/mm-shared-qmi.c b/src/mm-shared-qmi.c
index a13a2b1c..1e0ae784 100644
--- a/src/mm-shared-qmi.c
+++ b/src/mm-shared-qmi.c
@@ -398,14 +398,10 @@ out:
static void
set_current_capabilities_system_selection_preference (GTask *task)
{
- MMSharedQmi *self;
- Private *priv;
SetCurrentCapabilitiesContext *ctx;
QmiMessageNasSetSystemSelectionPreferenceInput *input;
QmiNasRatModePreference pref;
- self = g_task_get_source_object (task);
- priv = get_private (MM_SHARED_QMI (self));
ctx = g_task_get_task_data (task);
pref = mm_modem_capability_to_qmi_rat_mode_preference (ctx->capabilities);
@@ -919,12 +915,9 @@ set_current_modes_technology_preference_ready (QmiClientNas *client,
GAsyncResult *res,
GTask *task)
{
- SetCurrentModesContext *ctx;
QmiMessageNasSetTechnologyPreferenceOutput *output = NULL;
GError *error = NULL;
- ctx = g_task_get_task_data (task);
-
output = qmi_client_nas_set_technology_preference_finish (client, res, &error);
if (!output ||
(!qmi_message_nas_set_technology_preference_output_get_result (output, &error) &&
@@ -993,12 +986,9 @@ set_current_modes_system_selection_preference_ready (QmiClientNas *client,
GAsyncResult *res,
GTask *task)
{
- SetCurrentModesContext *ctx;
QmiMessageNasSetSystemSelectionPreferenceOutput *output = NULL;
GError *error = NULL;
- ctx = g_task_get_task_data (task);
-
output = qmi_client_nas_set_system_selection_preference_finish (client, res, &error);
if (!output || !qmi_message_nas_set_system_selection_preference_output_get_result (output, &error))
g_task_return_error (task, error);
@@ -1016,11 +1006,9 @@ set_current_modes_system_selection_preference (GTask *task)
MMIfaceModem *self;
SetCurrentModesContext *ctx;
QmiMessageNasSetSystemSelectionPreferenceInput *input;
- Private *priv;
QmiNasRatModePreference pref;
self = g_task_get_source_object (task);
- priv = get_private (MM_SHARED_QMI (self));
ctx = g_task_get_task_data (task);
input = qmi_message_nas_set_system_selection_preference_input_new ();
@@ -1162,15 +1150,12 @@ get_technology_preference_ready (QmiClientNas *client,
GAsyncResult *res,
GTask *task)
{
- LoadCurrentModesContext *ctx;
LoadCurrentModesResult *result = NULL;
QmiMessageNasGetTechnologyPreferenceOutput *output = NULL;
GError *error = NULL;
MMModemMode allowed;
QmiNasRadioTechnologyPreference preference_mask;
- ctx = g_task_get_task_data (task);
-
output = qmi_client_nas_get_technology_preference_finish (client, res, &error);
if (!output || !qmi_message_nas_get_technology_preference_output_get_result (output, &error)) {
g_task_return_error (task, error);
@@ -1226,15 +1211,12 @@ load_current_modes_system_selection_preference_ready (QmiClientNas *client,
GAsyncResult *res,
GTask *task)
{
- LoadCurrentModesContext *ctx;
LoadCurrentModesResult *result = NULL;
QmiMessageNasGetSystemSelectionPreferenceOutput *output = NULL;
GError *error = NULL;
QmiNasRatModePreference mode_preference_mask = 0;
MMModemMode allowed;
- ctx = g_task_get_task_data (task);
-
output = qmi_client_nas_get_system_selection_preference_finish (client, res, &error);
if (!output || !qmi_message_nas_get_system_selection_preference_output_get_result (output, &error)) {
g_task_return_error (task, error);
@@ -4068,7 +4050,6 @@ pds_get_default_tracking_session_ready (QmiClientPds *client,
GAsyncResult *res,
GTask *task)
{
- MMSharedQmi *self;
SetGpsOperationModeContext *ctx;
QmiMessagePdsSetDefaultTrackingSessionInput *input;
QmiMessagePdsGetDefaultTrackingSessionOutput *output;
@@ -4094,7 +4075,6 @@ pds_get_default_tracking_session_ready (QmiClientPds *client,
return;
}
- self = g_task_get_source_object (task);
ctx = g_task_get_task_data (task);
qmi_message_pds_get_default_tracking_session_output_get_info (