diff options
author | Lucas De Marchi <lucas.demarchi@profusion.mobi> | 2010-11-27 17:39:03 -0200 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-11-29 13:27:15 -0600 |
commit | b210838e87b737911a9bfbcf75ccd3d78736dad7 (patch) | |
tree | 91a91e0a120c70283b5ae3af0776cc19ab36fc76 /src/cbs.c | |
parent | 42bafa260a844c46d1de2f878464165bfad0ab75 (diff) | |
download | ofono-b210838e87b737911a9bfbcf75ccd3d78736dad7.tar.bz2 |
core: 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 'src/cbs.c')
-rw-r--r-- | src/cbs.c | 19 |
1 files changed, 9 insertions, 10 deletions
@@ -131,8 +131,7 @@ static void cbs_dispatch_emergency(struct ofono_cbs *cbs, const char *message, signal = dbus_message_new_signal(path, OFONO_CELL_BROADCAST_INTERFACE, "EmergencyBroadcast"); - - if (!signal) + if (signal == NULL) return; dbus_message_iter_init_append(signal, &iter); @@ -195,7 +194,7 @@ void ofono_cbs_notify(struct ofono_cbs *cbs, const unsigned char *pdu, struct ofono_atom *sim_atom; sim_atom = __ofono_modem_find_atom(modem, OFONO_ATOM_TYPE_SIM); - if (!sim_atom) + if (sim_atom == NULL) return; if (!__ofono_sim_service_available( @@ -289,8 +288,7 @@ static DBusMessage *cbs_get_properties(DBusConnection *conn, char *topics; reply = dbus_message_new_method_return(msg); - - if (!reply) + if (reply == NULL) return NULL; dbus_message_iter_init_append(reply, &iter); @@ -386,7 +384,7 @@ static DBusMessage *cbs_set_topics(struct ofono_cbs *cbs, const char *value, if (topics == NULL && value[0] != '\0') return __ofono_error_invalid_format(msg); - if (!cbs->driver->set_topics) + if (cbs->driver->set_topics == NULL) return __ofono_error_not_implemented(msg); cbs->new_topics = topics; @@ -416,7 +414,7 @@ static void cbs_set_powered_cb(const struct ofono_error *error, void *data) if (error->type != OFONO_ERROR_TYPE_NO_ERROR) { ofono_error("Setting Cell Broadcast topics failed"); - if (!cbs->pending) + if (cbs->pending == NULL) return; __ofono_dbus_pending_reply(&cbs->pending, @@ -438,7 +436,7 @@ static void cbs_set_powered_cb(const struct ofono_error *error, void *data) DBUS_TYPE_BOOLEAN, &cbs->powered); - if (!cbs->pending) + if (cbs->pending == NULL) return; reply = dbus_message_new_method_return(cbs->pending); @@ -455,7 +453,8 @@ static DBusMessage *cbs_set_powered(struct ofono_cbs *cbs, gboolean value, if (cbs->powered == value) goto reply; - if (!cbs->driver->set_topics || !cbs->driver->clear_topics) + if (cbs->driver->set_topics == NULL || + cbs->driver->clear_topics == NULL) goto done; if (msg) @@ -951,7 +950,7 @@ static void cbs_location_changed(int status, int lac, int ci, int tech, DBG("%d, %d, %d, %d, %s%s", status, lac, ci, tech, mcc, mnc); - if (!mcc || !mnc) { + if (mcc == NULL || mnc == NULL) { if (cbs->mcc[0] == '\0' && cbs->mnc[0] == '\0') return; |