From b210838e87b737911a9bfbcf75ccd3d78736dad7 Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Sat, 27 Nov 2010 17:39:03 -0200 Subject: core: explicitly compare pointers to NULL This patch was generated by the following semantic patch (http://coccinelle.lip6.fr/) // @fix disable is_null,isnt_null1@ expression *E; @@ - !E + E == NULL // --- src/cbs.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/cbs.c') diff --git a/src/cbs.c b/src/cbs.c index 50e78c29..8e4afc10 100644 --- a/src/cbs.c +++ b/src/cbs.c @@ -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; -- cgit v1.2.3