plugins: remove NULL check
authorJeevaka Badrappan <jeevaka.badrappan@elektrobit.com>
Sat, 29 Jan 2011 13:34:44 +0000 (05:34 -0800)
committerMarcel Holtmann <marcel@holtmann.org>
Sat, 29 Jan 2011 17:39:37 +0000 (18:39 +0100)
plugins/gobi.c
plugins/hso.c
plugins/ifx.c
plugins/mbm.c
plugins/novatel.c
plugins/phonesim.c
plugins/sierra.c
plugins/ste.c
plugins/tc65.c
plugins/zte.c

index 5846485..16bb0ed 100644 (file)
@@ -251,7 +251,7 @@ static void gobi_set_online(struct ofono_modem *modem, ofono_bool_t online,
 
        DBG("modem %p %s", modem, online ? "online" : "offline");
 
-       if (cbd == NULL || data->chat == NULL)
+       if (data->chat == NULL)
                goto error;
 
        if (g_at_chat_send(data->chat, command, NULL,
index 990be6d..4594c52 100644 (file)
@@ -346,13 +346,9 @@ static void hso_set_online(struct ofono_modem *modem, ofono_bool_t online,
 
        DBG("modem %p %s", modem, online ? "online" : "offline");
 
-       if (cbd == NULL)
-               goto error;
-
        if (g_at_chat_send(chat, command, NULL, set_online_cb, cbd, g_free))
                return;
 
-error:
        g_free(cbd);
 
        CALLBACK_WITH_FAILURE(cb, cbd->data);
index 79cd150..411c012 100644 (file)
@@ -661,14 +661,10 @@ static void ifx_set_online(struct ofono_modem *modem, ofono_bool_t online,
 
        DBG("%p %s", modem, online ? "online" : "offline");
 
-       if (cbd == NULL)
-               goto error;
-
        if (g_at_chat_send(data->dlcs[AUX_DLC], command, NULL,
                                        set_online_cb, cbd, g_free) > 0)
                return;
 
-error:
        g_free(cbd);
 
        CALLBACK_WITH_FAILURE(cb, cbd->data);
index e826240..600b358 100644 (file)
@@ -470,13 +470,9 @@ static void mbm_set_online(struct ofono_modem *modem, ofono_bool_t online,
 
        DBG("modem %p %s", modem, online ? "online" : "offline");
 
-       if (cbd == NULL)
-               goto error;
-
        if (g_at_chat_send(chat, command, NULL, set_online_cb, cbd, g_free))
                return;
 
-error:
        g_free(cbd);
 
        CALLBACK_WITH_FAILURE(cb, cbd->data);
index fbd1216..1948c49 100644 (file)
@@ -309,7 +309,7 @@ static void novatel_set_online(struct ofono_modem *modem, ofono_bool_t online,
 
        DBG("modem %p %s", modem, online ? "online" : "offline");
 
-       if (cbd == NULL || chat == NULL)
+       if (chat == NULL)
                goto error;
 
        if (g_at_chat_send(chat, command, NULL, set_online_cb, cbd, g_free))
index 28306b5..2b36fe0 100644 (file)
@@ -143,9 +143,6 @@ static void phonesim_deactivate_primary(struct ofono_gprs_context *gc,
        struct cb_data *cbd = cb_data_new(cb, data);
        char buf[128];
 
-       if (cbd == NULL)
-               goto error;
-
        cbd->user = gc;
 
        snprintf(buf, sizeof(buf), "AT+CGACT=0,%u", id);
@@ -154,7 +151,6 @@ static void phonesim_deactivate_primary(struct ofono_gprs_context *gc,
                                at_cgact_down_cb, cbd, g_free) > 0)
                return;
 
-error:
        g_free(cbd);
 
        CALLBACK_WITH_FAILURE(cb, data);
@@ -273,14 +269,10 @@ static void phonesim_ctm_query(struct ofono_ctm *ctm,
 
        DBG("");
 
-       if (!cbd)
-               goto error;
-
        if (g_at_chat_send(chat, "AT+PTTY?", ptty_prefix,
                                ctm_query_cb, cbd, g_free) > 0)
                return;
 
-error:
        g_free(cbd);
 
        CALLBACK_WITH_FAILURE(cb, 0, data);
@@ -305,16 +297,12 @@ static void phonesim_ctm_set(struct ofono_ctm *ctm, ofono_bool_t enable,
 
        DBG("");
 
-       if (!cbd)
-               goto error;
-
        snprintf(buf, sizeof(buf), "AT+PTTY=%d", enable);
 
        if (g_at_chat_send(chat, buf, none_prefix,
                                ctm_set_cb, cbd, g_free) > 0)
                return;
 
-error:
        CALLBACK_WITH_FAILURE(cb, data);
        g_free(cbd);
 }
index b3edcf4..f387b98 100644 (file)
@@ -195,7 +195,7 @@ static void sierra_set_online(struct ofono_modem *modem, ofono_bool_t online,
 
        DBG("modem %p %s", modem, online ? "online" : "offline");
 
-       if (cbd == NULL || data->chat == NULL)
+       if (data->chat == NULL)
                goto error;
 
        if (g_at_chat_send(data->chat, command, NULL,
index 6b44780..0b02a0d 100644 (file)
@@ -320,13 +320,9 @@ static void ste_set_online(struct ofono_modem *modem, ofono_bool_t online,
 
        DBG("modem %p %s", modem, online ? "online" : "offline");
 
-       if (cbd == NULL)
-               goto error;
-
        if (g_at_chat_send(chat, command, NULL, set_online_cb, cbd, g_free))
                return;
 
-error:
        g_free(cbd);
 
        CALLBACK_WITH_FAILURE(cb, cbd->data);
index 60f66e7..f58f33d 100644 (file)
@@ -159,13 +159,9 @@ static void tc65_set_online(struct ofono_modem *modem, ofono_bool_t online,
 
        DBG("modem %p %s", modem, online ? "online" : "offline");
 
-       if (cbd == NULL)
-               goto error;
-
        if (g_at_chat_send(chat, command, NULL, set_online_cb, cbd, g_free))
                return;
 
-error:
        g_free(cbd);
 
        CALLBACK_WITH_FAILURE(cb, cbd->data);
index 4693d93..822098d 100644 (file)
@@ -250,7 +250,7 @@ static void zte_set_online(struct ofono_modem *modem, ofono_bool_t online,
 
        DBG("modem %p %s", modem, online ? "online" : "offline");
 
-       if (cbd == NULL || chat == NULL)
+       if (chat == NULL)
                goto error;
 
        if (g_at_chat_send(chat, command, NULL, set_online_cb, cbd, g_free))