aboutsummaryrefslogtreecommitdiff
path: root/src/mm-port-probe.c
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/mm-port-probe.c
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/mm-port-probe.c')
-rw-r--r--src/mm-port-probe.c22
1 files changed, 11 insertions, 11 deletions
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)