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/atmodem/network-registration.c | |
parent | 43d2435e64e4448cbdce222c68cb1352c5c74276 (diff) | |
download | ofono-b82a7f851159a42f6ca38a2357551a94a4402e11.tar.bz2 |
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/atmodem/network-registration.c')
-rw-r--r-- | drivers/atmodem/network-registration.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/atmodem/network-registration.c b/drivers/atmodem/network-registration.c index 5b87b39a..04b0d48c 100644 --- a/drivers/atmodem/network-registration.c +++ b/drivers/atmodem/network-registration.c @@ -182,7 +182,7 @@ static void at_registration_status(struct ofono_netreg *netreg, struct netreg_data *nd = ofono_netreg_get_data(netreg); struct cb_data *cbd = cb_data_new(cb, data); - if (!cbd) + if (cbd == NULL) goto error; cbd->user = nd; @@ -349,7 +349,7 @@ static void at_current_operator(struct ofono_netreg *netreg, struct cb_data *cbd = cb_data_new(cb, data); gboolean ok; - if (!cbd) + if (cbd == NULL) goto error; cbd->user = netreg; @@ -408,8 +408,7 @@ static void cops_list_cb(gboolean ok, GAtResult *result, gpointer user_data) DBG("Got %d elements", num); list = g_try_new0(struct ofono_network_operator, num); - - if (!list) { + if (list == NULL) { CALLBACK_WITH_FAILURE(cb, 0, NULL, cbd->data); return; } @@ -492,7 +491,7 @@ static void at_list_operators(struct ofono_netreg *netreg, struct netreg_data *nd = ofono_netreg_get_data(netreg); struct cb_data *cbd = cb_data_new(cb, data); - if (!cbd) + if (cbd == NULL) goto error; if (g_at_chat_send(nd->chat, "AT+COPS=?", cops_prefix, @@ -522,7 +521,7 @@ static void at_register_auto(struct ofono_netreg *netreg, struct netreg_data *nd = ofono_netreg_get_data(netreg); struct cb_data *cbd = cb_data_new(cb, data); - if (!cbd) + if (cbd == NULL) goto error; if (g_at_chat_send(nd->chat, "AT+COPS=0", none_prefix, @@ -543,7 +542,7 @@ static void at_register_manual(struct ofono_netreg *netreg, struct cb_data *cbd = cb_data_new(cb, data); char buf[128]; - if (!cbd) + if (cbd == NULL) goto error; snprintf(buf, sizeof(buf), "AT+COPS=1,2,\"%s%s\"", mcc, mnc); @@ -564,7 +563,7 @@ static void at_deregister(struct ofono_netreg *netreg, struct netreg_data *nd = ofono_netreg_get_data(netreg); struct cb_data *cbd = cb_data_new(cb, data); - if (!cbd) + if (cbd == NULL) goto error; if (g_at_chat_send(nd->chat, "AT+COPS=2", none_prefix, @@ -862,7 +861,7 @@ static void at_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) + if (cbd == NULL) goto error; cbd->user = nd; @@ -1045,7 +1044,7 @@ static void creg_notify(GAtResult *result, gpointer user_data) switch (nd->vendor) { case OFONO_VENDOR_OPTION_HSO: tq = g_new0(struct tech_query, 1); - if (!tq) + if (tq == NULL) break; tq->status = status; |