diff options
-rw-r--r-- | plugins/telit/mm-modem-helpers-telit.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/plugins/telit/mm-modem-helpers-telit.c b/plugins/telit/mm-modem-helpers-telit.c index 75667fd0..32663cdb 100644 --- a/plugins/telit/mm-modem-helpers-telit.c +++ b/plugins/telit/mm-modem-helpers-telit.c @@ -44,7 +44,7 @@ mm_telit_get_band_flag (GArray *bands_array, guint i; for (i = 0; i < bands_array->len; i++) { - MMModemBand band = g_array_index(bands_array, MMModemBand, i); + MMModemBand band = g_array_index (bands_array, MMModemBand, i); if (flag2g != NULL && band > MM_MODEM_BAND_UNKNOWN && band <= MM_MODEM_BAND_G850) { @@ -284,7 +284,7 @@ mm_telit_parse_bnd_response (const gchar *response, goto end; } - if (!g_match_info_matches(match_info)) { + if (!g_match_info_matches (match_info)) { g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Could not find matches in response '%s'", response); goto end; @@ -298,7 +298,7 @@ mm_telit_parse_bnd_response (const gchar *response, if (modem_is_3g && !mm_telit_get_3g_mm_bands (match_info, &bands, error)) goto end; - if(modem_is_4g && !mm_telit_get_4g_mm_bands (match_info, &bands, error)) + if (modem_is_4g && !mm_telit_get_4g_mm_bands (match_info, &bands, error)) goto end; *supported_bands = bands; @@ -438,9 +438,9 @@ end: } gboolean -mm_telit_get_4g_mm_bands(GMatchInfo *match_info, - GArray **bands, - GError **error) +mm_telit_get_4g_mm_bands (GMatchInfo *match_info, + GArray **bands, + GError **error) { MMModemBand band; gboolean ret = TRUE; @@ -458,7 +458,7 @@ mm_telit_get_4g_mm_bands(GMatchInfo *match_info, goto end; } - if (strstr(match_str, "-")) { + if (strstr (match_str, "-")) { tokens = g_strsplit (match_str, "-", -1); if (tokens == NULL) { g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, @@ -473,7 +473,6 @@ mm_telit_get_4g_mm_bands(GMatchInfo *match_info, sscanf (match_str, "%d", &value); } - for (i = 0; value > 0; i++) { if (value % 2 != 0) { band = MM_MODEM_BAND_EUTRAN_1 + i; @@ -481,6 +480,7 @@ mm_telit_get_4g_mm_bands(GMatchInfo *match_info, } value = value >> 1; } + end: g_free (match_str); @@ -555,19 +555,19 @@ mm_telit_get_band_flags_from_string (const gchar *flag_str, for (i = 0; tokens[i]; i++) { /* check whether tokens[i] defines a * single band value or a range of bands */ - if (!strstr(tokens[i], "-")) { - sscanf(tokens[i], "%d", &flag); + if (!strstr (tokens[i], "-")) { + sscanf (tokens[i], "%d", &flag); g_array_append_val (*band_flags, flag); } else { gint range_start; gint range_end; - range = g_strsplit(tokens[i], "-", 2); + range = g_strsplit (tokens[i], "-", 2); - sscanf(range[0], "%d", &range_start); - sscanf(range[1], "%d", &range_end); + sscanf (range[0], "%d", &range_start); + sscanf (range[1], "%d", &range_end); - for (flag=range_start; flag <= range_end; flag++) { + for (flag = range_start; flag <= range_end; flag++) { g_array_append_val (*band_flags, flag); } |