plugins: remove NULL check

This commit is contained in:
Jeevaka Badrappan 2011-01-29 05:34:44 -08:00 committed by Marcel Holtmann
parent f9b34de3d4
commit 8c667aadad
10 changed files with 4 additions and 36 deletions

View 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,

View 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);

View 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);

View 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);

View 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))

View 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);
}

View 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,

View 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);

View 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);

View 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))