hfpmodem: remove NULL check
authorJeevaka Badrappan <jeevaka.badrappan@elektrobit.com>
Sat, 29 Jan 2011 13:34:37 +0000 (05:34 -0800)
committerMarcel Holtmann <marcel@holtmann.org>
Sat, 29 Jan 2011 17:39:37 +0000 (18:39 +0100)
drivers/hfpmodem/call-volume.c
drivers/hfpmodem/network-registration.c
drivers/hfpmodem/voicecall.c

index 19f57c4..ee4e352 100644 (file)
@@ -73,9 +73,6 @@ static void hfp_speaker_volume(struct ofono_call_volume *cv,
        struct cb_data *cbd = cb_data_new(cb, data);
        char buf[64];
 
-       if (cbd == NULL)
-               goto error;
-
        vd->sp_volume = percent;
 
        snprintf(buf, sizeof(buf), "AT+VGS=%d",
@@ -85,7 +82,6 @@ static void hfp_speaker_volume(struct ofono_call_volume *cv,
                                cv_generic_set_cb, cbd, g_free) > 0)
                return;
 
-error:
        g_free(cbd);
 
        CALLBACK_WITH_FAILURE(cb, data);
@@ -100,9 +96,6 @@ static void hfp_microphone_volume(struct ofono_call_volume *cv,
        struct cb_data *cbd = cb_data_new(cb, data);
        char buf[64];
 
-       if (cbd == NULL)
-               goto error;
-
        vd->mic_volume = percent;
 
        snprintf(buf, sizeof(buf), "AT+VGM=%d",
@@ -112,7 +105,6 @@ static void hfp_microphone_volume(struct ofono_call_volume *cv,
                                cv_generic_set_cb, cbd, g_free) > 0)
                return;
 
-error:
        g_free(cbd);
 
        CALLBACK_WITH_FAILURE(cb, data);
index 273490e..23852e7 100644 (file)
@@ -236,9 +236,6 @@ static void hfp_registration_status(struct ofono_netreg *netreg,
        struct cb_data *cbd = cb_data_new(cb, data);
        gboolean ok;
 
-       if (cbd == NULL)
-               goto error;
-
        cbd->user = netreg;
 
        ok = g_at_chat_send(nd->chat, "AT+CIND?", cind_prefix,
@@ -246,7 +243,6 @@ static void hfp_registration_status(struct ofono_netreg *netreg,
        if (ok)
                return;
 
-error:
        g_free(cbd);
 
        CALLBACK_WITH_FAILURE(cb, -1, -1, -1, -1, data);
@@ -259,9 +255,6 @@ static void hfp_current_operator(struct ofono_netreg *netreg,
        struct cb_data *cbd = cb_data_new(cb, data);
        gboolean ok;
 
-       if (cbd == NULL)
-               goto error;
-
        cbd->user = netreg;
 
        ok = g_at_chat_send(nd->chat, "AT+COPS=3,0", NULL,
@@ -274,7 +267,6 @@ static void hfp_current_operator(struct ofono_netreg *netreg,
        if (ok)
                return;
 
-error:
        CALLBACK_WITH_FAILURE(cb, NULL, data);
 }
 
@@ -284,16 +276,12 @@ static void hfp_signal_strength(struct ofono_netreg *netreg,
        struct netreg_data *nd = ofono_netreg_get_data(netreg);
        struct cb_data *cbd = cb_data_new(cb, data);
 
-       if (cbd == NULL)
-               goto error;
-
        cbd->user = netreg;
 
        if (g_at_chat_send(nd->chat, "AT+CIND?", cind_prefix,
                                signal_strength_cb, cbd, g_free) > 0)
                return;
 
-error:
        g_free(cbd);
 
        CALLBACK_WITH_FAILURE(cb, -1, data);
index d12a5ef..b9bee62 100644 (file)
@@ -362,9 +362,6 @@ static void hfp_dial(struct ofono_voicecall *vc,
        struct cb_data *cbd = cb_data_new(cb, data);
        char buf[256];
 
-       if (cbd == NULL)
-               goto error;
-
        cbd->user = vc;
        if (ph->type == 145)
                snprintf(buf, sizeof(buf), "ATD+%s", ph->number);
@@ -377,7 +374,6 @@ static void hfp_dial(struct ofono_voicecall *vc,
                                atd_cb, cbd, g_free) > 0)
                return;
 
-error:
        g_free(cbd);
 
        CALLBACK_WITH_FAILURE(cb, data);