From f9b34de3d41deb4c9f5cd50aa6dc9dc7bd186b00 Mon Sep 17 00:00:00 2001 From: Jeevaka Badrappan Date: Sat, 29 Jan 2011 05:34:43 -0800 Subject: [PATCH] cdmamodem: remove NULL check --- drivers/cdmamodem/devinfo.c | 16 ---------------- drivers/cdmamodem/voicecall.c | 4 ---- 2 files changed, 20 deletions(-) diff --git a/drivers/cdmamodem/devinfo.c b/drivers/cdmamodem/devinfo.c index dfc7fd5e..9603e052 100644 --- a/drivers/cdmamodem/devinfo.c +++ b/drivers/cdmamodem/devinfo.c @@ -65,15 +65,11 @@ static void cdma_query_manufacturer(struct ofono_devinfo *info, struct cb_data *cbd = cb_data_new(cb, data); GAtChat *chat = ofono_devinfo_get_data(info); - if (cbd == NULL) - goto error; - cbd->user = "AT+GMI"; if (g_at_chat_send(chat, "AT+GMI", NULL, attr_cb, cbd, g_free) > 0) return; -error: g_free(cbd); CALLBACK_WITH_FAILURE(cb, NULL, data); @@ -85,15 +81,11 @@ static void cdma_query_model(struct ofono_devinfo *info, struct cb_data *cbd = cb_data_new(cb, data); GAtChat *chat = ofono_devinfo_get_data(info); - if (cbd == NULL) - goto error; - cbd->user = "AT+GMM"; if (g_at_chat_send(chat, "AT+GMM", NULL, attr_cb, cbd, g_free) > 0) return; -error: g_free(cbd); CALLBACK_WITH_FAILURE(cb, NULL, data); @@ -105,15 +97,11 @@ static void cdma_query_revision(struct ofono_devinfo *info, struct cb_data *cbd = cb_data_new(cb, data); GAtChat *chat = ofono_devinfo_get_data(info); - if (cbd == NULL) - goto error; - cbd->user = "AT+GMR"; if (g_at_chat_send(chat, "AT+GMR", NULL, attr_cb, cbd, g_free) > 0) return; -error: g_free(cbd); CALLBACK_WITH_FAILURE(cb, NULL, data); @@ -125,15 +113,11 @@ static void cdma_query_serial(struct ofono_devinfo *info, struct cb_data *cbd = cb_data_new(cb, data); GAtChat *chat = ofono_devinfo_get_data(info); - if (cbd == NULL) - goto error; - cbd->user = "AT+GSN"; if (g_at_chat_send(chat, "AT+GSN", NULL, attr_cb, cbd, g_free) > 0) return; -error: g_free(cbd); CALLBACK_WITH_FAILURE(cb, NULL, data); diff --git a/drivers/cdmamodem/voicecall.c b/drivers/cdmamodem/voicecall.c index 94ec74b6..cabed6ac 100644 --- a/drivers/cdmamodem/voicecall.c +++ b/drivers/cdmamodem/voicecall.c @@ -54,16 +54,12 @@ static void cdma_template(const char *cmd, struct ofono_cdma_voicecall *vc, struct voicecall_data *vd = ofono_cdma_voicecall_get_data(vc); struct cb_data *cbd = cb_data_new(cb, data); - if (cbd == NULL) - goto error; - cbd->user = vc; if (g_at_chat_send(vd->chat, cmd, none_prefix, result_cb, cbd, g_free) > 0) return; -error: g_free(cbd); CALLBACK_WITH_FAILURE(cb, data);