diff options
author | Lucas De Marchi <lucas.demarchi@profusion.mobi> | 2010-11-27 17:38:56 -0200 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-11-29 11:37:09 -0600 |
commit | b82a7f851159a42f6ca38a2357551a94a4402e11 (patch) | |
tree | 6bf00675085885091b496bf1b0ab899b9a8f79e3 /drivers/stemodem | |
parent | 43d2435e64e4448cbdce222c68cb1352c5c74276 (diff) | |
download | ofono-b82a7f851159a42f6ca38a2357551a94a4402e11.tar.gz |
drivers: explicitly compare pointers to NULL
This patch was generated by the following semantic patch
(http://coccinelle.lip6.fr/)
// <smpl>
@fix disable is_null,isnt_null1@
expression *E;
@@
- !E
+ E == NULL
// </smpl>
Diffstat (limited to 'drivers/stemodem')
-rw-r--r-- | drivers/stemodem/gprs-context.c | 14 | ||||
-rw-r--r-- | drivers/stemodem/radio-settings.c | 3 | ||||
-rw-r--r-- | drivers/stemodem/voicecall.c | 16 |
3 files changed, 17 insertions, 16 deletions
diff --git a/drivers/stemodem/gprs-context.c b/drivers/stemodem/gprs-context.c index 1675cd8d..faa31241 100644 --- a/drivers/stemodem/gprs-context.c +++ b/drivers/stemodem/gprs-context.c @@ -158,7 +158,7 @@ static struct conn_info *conn_info_create(unsigned int device, { struct conn_info *connection = g_try_new0(struct conn_info, 1); - if (!connection) + if (connection == NULL) return NULL; connection->cid = 0; @@ -206,7 +206,7 @@ static void ste_eppsd_down_cb(gboolean ok, GAtResult *result, GUINT_TO_POINTER(gcd->active_context), conn_compare_by_cid); - if (!l) { + if (l == NULL) { DBG("Did not find data (used caif device) for" "connection with cid; %d", gcd->active_context); @@ -247,7 +247,7 @@ static void ste_eppsd_up_cb(gboolean ok, GAtResult *result, gpointer user_data) GUINT_TO_POINTER(gcd->active_context), conn_compare_by_cid); - if (!l) { + if (l == NULL) { DBG("Did not find data (device and channel id)" "for connection with cid; %d", gcd->active_context); @@ -344,7 +344,7 @@ static void ste_cgdcont_cb(gboolean ok, GAtResult *result, gpointer user_data) l = g_slist_find_custom(g_caif_devices, GUINT_TO_POINTER(0), conn_compare_by_cid); - if (!l) { + if (l == NULL) { DBG("at_cgdcont_cb, no more available devices"); goto error; } @@ -376,7 +376,7 @@ static void ste_gprs_activate_primary(struct ofono_gprs_context *gc, char buf[AUTH_BUF_LENGTH]; int len; - if (!cbd) + if (cbd == NULL) goto error; gcd->active_context = ctx->cid; @@ -421,7 +421,7 @@ static void ste_gprs_deactivate_primary(struct ofono_gprs_context *gc, char buf[64]; GSList *l; - if (!cbd) + if (cbd == NULL) goto error; gcd->active_context = id; @@ -430,7 +430,7 @@ static void ste_gprs_deactivate_primary(struct ofono_gprs_context *gc, l = g_slist_find_custom(g_caif_devices, GUINT_TO_POINTER(id), conn_compare_by_cid); - if (!l) { + if (l == NULL) { DBG("at_gprs_deactivate_primary, did not find" "data (channel id) for connection with cid; %d", id); goto error; diff --git a/drivers/stemodem/radio-settings.c b/drivers/stemodem/radio-settings.c index 5b16ec0b..e65baf46 100644 --- a/drivers/stemodem/radio-settings.c +++ b/drivers/stemodem/radio-settings.c @@ -192,8 +192,9 @@ static int ste_radio_settings_probe(struct ofono_radio_settings *rs, { GAtChat *chat = data; struct radio_settings_data *rsd; + rsd = g_try_new0(struct radio_settings_data, 1); - if (!rsd) + if (rsd == NULL) return -ENOMEM; rsd->chat = chat; diff --git a/drivers/stemodem/voicecall.c b/drivers/stemodem/voicecall.c index b9d91d2e..bf68f52a 100644 --- a/drivers/stemodem/voicecall.c +++ b/drivers/stemodem/voicecall.c @@ -109,7 +109,7 @@ static struct ofono_call *create_call(struct ofono_voicecall *vc, int type, /* Generate a call structure for the waiting call */ call = g_try_new0(struct ofono_call, 1); - if (!call) + if (call == NULL) return NULL; call->type = type; @@ -187,7 +187,7 @@ static void ste_dial(struct ofono_voicecall *vc, struct cb_data *cbd = cb_data_new(cb, data); char buf[256]; - if (!cbd) + if (cbd == NULL) goto error; cbd->user = vc; @@ -235,7 +235,7 @@ static void ste_template(const char *cmd, struct ofono_voicecall *vc, struct voicecall_data *vd = ofono_voicecall_get_data(vc); struct change_state_req *req = g_try_new0(struct change_state_req, 1); - if (!req) + if (req == NULL) goto error; req->vc = vc; @@ -299,7 +299,7 @@ static void ste_release_specific(struct ofono_voicecall *vc, int id, struct release_id_req *req = g_try_new0(struct release_id_req, 1); char buf[32]; - if (!req) + if (req == NULL) goto error; req->vc = vc; @@ -379,13 +379,13 @@ static void ste_send_dtmf(struct ofono_voicecall *vc, const char *dtmf, int s; char *buf; - if (!cbd) + if (cbd == NULL) goto error; /* strlen("AT+VTS=) = 7 */ buf = g_try_new(char, len + 7); - if (!buf) + if (buf == NULL) goto error; sprintf(buf, "AT+VTS=%s", dtmf); @@ -506,7 +506,7 @@ static void ecav_notify(GAtResult *result, gpointer user_data) new_call = create_call(vc, call_type, direction, status, num, num_type, clip_validity); - if (!new_call) { + if (new_call == NULL) { ofono_error("Unable to malloc. " "Call management is fubar"); return; @@ -546,7 +546,7 @@ static int ste_voicecall_probe(struct ofono_voicecall *vc, unsigned int vendor, struct voicecall_data *vd; vd = g_try_new0(struct voicecall_data, 1); - if (!vd) + if (vd == NULL) return -ENOMEM; vd->chat = g_at_chat_clone(chat); |