From 98074fdb60c7092b4453a78382c384f8752dbbc1 Mon Sep 17 00:00:00 2001 From: Aki Niemi Date: Wed, 1 Dec 2010 15:46:57 +0200 Subject: isimodem: Always compare to NULL explicitly --- drivers/isimodem/call-barring.c | 6 ++--- drivers/isimodem/call-forwarding.c | 6 ++--- drivers/isimodem/call-settings.c | 4 ++-- drivers/isimodem/cbs.c | 1 - drivers/isimodem/devinfo.c | 8 +++---- drivers/isimodem/gprs-context.c | 20 ++++++++--------- drivers/isimodem/gprs.c | 22 ++++++++---------- drivers/isimodem/infoserver.c | 8 +++---- drivers/isimodem/network-registration.c | 40 ++++++++++++++++----------------- drivers/isimodem/phonebook.c | 4 ++-- drivers/isimodem/radio-settings.c | 9 +++----- drivers/isimodem/sim.c | 27 ++++++++++++---------- drivers/isimodem/sms.c | 8 +++---- drivers/isimodem/ussd.c | 4 ++-- drivers/isimodem/voicecall.c | 26 ++++++++++----------- 15 files changed, 93 insertions(+), 100 deletions(-) (limited to 'drivers') diff --git a/drivers/isimodem/call-barring.c b/drivers/isimodem/call-barring.c index 11afda35..35ea2ba7 100644 --- a/drivers/isimodem/call-barring.c +++ b/drivers/isimodem/call-barring.c @@ -140,7 +140,7 @@ static void isi_set(struct ofono_call_barring *barr, const char *lock, goto error; if (g_isi_client_send(bd->client, msg, sizeof(msg), SS_TIMEOUT, - set_resp_cb, cbd, g_free)) + set_resp_cb, cbd, g_free) != NULL) return; error: @@ -259,7 +259,7 @@ static void isi_query(struct ofono_call_barring *barr, const char *lock, goto error; if (g_isi_client_send(bd->client, msg, sizeof(msg), SS_TIMEOUT, - query_resp_cb, cbd, g_free)) + query_resp_cb, cbd, g_free) != NULL) return; error: @@ -322,7 +322,7 @@ static void isi_set_passwd(struct ofono_call_barring *barr, const char *lock, goto error; if (g_isi_client_send(bd->client, msg, sizeof(msg), SS_TIMEOUT, - set_passwd_resp_cb, cbd, g_free)) + set_passwd_resp_cb, cbd, g_free) != NULL) return; error: diff --git a/drivers/isimodem/call-forwarding.c b/drivers/isimodem/call-forwarding.c index 693cceda..8704f293 100644 --- a/drivers/isimodem/call-forwarding.c +++ b/drivers/isimodem/call-forwarding.c @@ -255,7 +255,7 @@ static void isi_registration(struct ofono_call_forwarding *cf, int type, g_free(ucs2); if (g_isi_client_send(fd->client, msg, 7 + msg[8], SS_TIMEOUT, - registration_resp_cb, cbd, g_free)) + registration_resp_cb, cbd, g_free) != NULL) return; error: @@ -318,7 +318,7 @@ static void isi_erasure(struct ofono_call_forwarding *cf, int type, int cls, goto error; if (g_isi_client_send(fd->client, msg, sizeof(msg), SS_TIMEOUT, - erasure_resp_cb, cbd, g_free)) + erasure_resp_cb, cbd, g_free) != NULL) return; error: @@ -413,7 +413,7 @@ static void isi_query(struct ofono_call_forwarding *cf, int type, int cls, goto error; if (g_isi_client_send(fd->client, msg, sizeof(msg), SS_TIMEOUT, - query_resp_cb, cbd, g_free)) + query_resp_cb, cbd, g_free) != NULL) return; error: diff --git a/drivers/isimodem/call-settings.c b/drivers/isimodem/call-settings.c index a0c09b98..5319115d 100644 --- a/drivers/isimodem/call-settings.c +++ b/drivers/isimodem/call-settings.c @@ -173,7 +173,7 @@ static void isi_cw_query(struct ofono_call_settings *cs, int cls, goto error; if (g_isi_client_send(sd->client, msg, sizeof(msg), SS_TIMEOUT, - query_resp_cb, cbd, g_free)) + query_resp_cb, cbd, g_free) != NULL) return; error: @@ -242,7 +242,7 @@ static void isi_cw_set(struct ofono_call_settings *cs, int mode, int cls, goto error; if (g_isi_client_send(sd->client, msg, sizeof(msg), SS_TIMEOUT, - set_resp_cb, cbd, g_free)) + set_resp_cb, cbd, g_free) != NULL) return; error: diff --git a/drivers/isimodem/cbs.c b/drivers/isimodem/cbs.c index 34cbbc62..d48865af 100644 --- a/drivers/isimodem/cbs.c +++ b/drivers/isimodem/cbs.c @@ -183,7 +183,6 @@ static int isi_cbs_probe(struct ofono_cbs *cbs, unsigned int vendor, static void isi_cbs_remove(struct ofono_cbs *cbs) { struct cbs_data *cd = ofono_cbs_get_data(cbs); - const uint8_t msg[] = { SMS_GSM_CB_ROUTING_REQ, SMS_ROUTING_RELEASE, diff --git a/drivers/isimodem/devinfo.c b/drivers/isimodem/devinfo.c index f0d91b3e..3758bcff 100644 --- a/drivers/isimodem/devinfo.c +++ b/drivers/isimodem/devinfo.c @@ -120,7 +120,7 @@ static void isi_query_manufacturer(struct ofono_devinfo *info, goto error; if (g_isi_client_send(dev->client, msg, sizeof(msg), INFO_TIMEOUT, - info_resp_cb, cbd, g_free)) + info_resp_cb, cbd, g_free) != NULL) return; error: @@ -144,7 +144,7 @@ static void isi_query_model(struct ofono_devinfo *info, goto error; if (g_isi_client_send(dev->client, msg, sizeof(msg), INFO_TIMEOUT, - info_resp_cb, cbd, g_free)) + info_resp_cb, cbd, g_free) != NULL) return; error: @@ -169,7 +169,7 @@ static void isi_query_revision(struct ofono_devinfo *info, goto error; if (g_isi_client_send(dev->client, msg, sizeof(msg), INFO_TIMEOUT, - info_resp_cb, cbd, g_free)) + info_resp_cb, cbd, g_free) != NULL) return; error: @@ -193,7 +193,7 @@ static void isi_query_serial(struct ofono_devinfo *info, goto error; if (g_isi_client_send(dev->client, msg, sizeof(msg), INFO_TIMEOUT, - info_resp_cb, cbd, g_free)) + info_resp_cb, cbd, g_free) != NULL) return; error: diff --git a/drivers/isimodem/gprs-context.c b/drivers/isimodem/gprs-context.c index 4efafc53..18297191 100644 --- a/drivers/isimodem/gprs-context.c +++ b/drivers/isimodem/gprs-context.c @@ -326,7 +326,7 @@ static void send_context_activate(GIsiClient *client, void *opaque) if (g_isi_client_send(client, msg, sizeof(msg), GPDS_CTX_ACTIVATE_TIMEOUT, - context_activate_cb, cd, NULL)) + context_activate_cb, cd, NULL) != NULL) g_isi_pipe_start(cd->pipe); else gprs_up_fail(cd); @@ -419,8 +419,8 @@ static void link_conf_cb(const GIsiMessage *msg, void *opaque) if (!check_resp(msg, GPDS_LL_CONFIGURE_RESP, 2, cd, gprs_up_fail)) return; - if (!g_isi_client_vsend(cd->client, iov, 2, GPDS_TIMEOUT, - context_conf_cb, cd, NULL)) + if (g_isi_client_vsend(cd->client, iov, 2, GPDS_TIMEOUT, + context_conf_cb, cd, NULL) == NULL) gprs_up_fail(cd); } @@ -441,8 +441,8 @@ static void create_context_cb(const GIsiMessage *msg, void *opaque) cd->handle = req[1] = data[0]; - if (!g_isi_client_send(cd->client, req, sizeof(req), GPDS_TIMEOUT, - link_conf_cb, cd, NULL)) + if (g_isi_client_send(cd->client, req, sizeof(req), GPDS_TIMEOUT, + link_conf_cb, cd, NULL) == NULL) gprs_up_fail(cd); } @@ -467,7 +467,7 @@ static void isi_gprs_activate_primary(struct ofono_gprs_context *gc, DBG("activate: gpds = 0x%04x", cd->gpds); - if (!cd->gpds) { + if (cd == NULL || !cd->gpds) { /* GPDS is not reachable */ CALLBACK_WITH_FAILURE(cb, NULL, 0, NULL, NULL, NULL, NULL, data); @@ -599,15 +599,13 @@ static void isi_gprs_context_remove(struct ofono_gprs_context *gc) { struct context_data *cd = ofono_gprs_context_get_data(gc); + ofono_gprs_context_set_data(gc, NULL); + if (cd == NULL) return; - ofono_gprs_context_set_data(gc, NULL); reset_context(cd); - - if (cd->client) - g_isi_client_destroy(cd->client); - + g_isi_client_destroy(cd->client); g_free(cd); } diff --git a/drivers/isimodem/gprs.c b/drivers/isimodem/gprs.c index 58eff0a8..791ea563 100644 --- a/drivers/isimodem/gprs.c +++ b/drivers/isimodem/gprs.c @@ -93,10 +93,8 @@ static void set_attach_mode(struct ofono_gprs *gprs, int attached) 0x00 }; - if (g_isi_client_send(gd->client, msg, sizeof(msg), - GPDS_TIMEOUT, configure_resp_cb, - gprs, NULL)) - return; + g_isi_client_send(gd->client, msg, sizeof(msg), GPDS_TIMEOUT, + configure_resp_cb, gprs, NULL); } static void detach_ind_cb(const GIsiMessage *msg, void *opaque) @@ -184,7 +182,7 @@ static void create_contexts(struct ofono_gprs *gprs, int count) for (i = 0; i < count; i++) { gc = ofono_gprs_context_create(omodem, 0, "isimodem", modem); - if (!gc) + if (gc == NULL) break; ofono_gprs_add_context(gprs, gc); @@ -277,15 +275,13 @@ static void gpds_reachable_cb(const GIsiMessage *msg, void *opaque) ofono_gprs_register(gprs); gd->info_client = g_isi_client_create(modem, PN_PHONE_INFO); - if (!gd->info_client) { + if (gd->info_client == NULL) { create_contexts(gprs, GPDS_MAX_CONTEXT_COUNT); return; } - if (g_isi_client_send(gd->info_client, req, sizeof(req), - GPDS_TIMEOUT, info_pp_read_resp_cb, - gprs, NULL)) - return; + g_isi_client_send(gd->info_client, req, sizeof(req), GPDS_TIMEOUT, + info_pp_read_resp_cb, gprs, NULL); } static int isi_gprs_probe(struct ofono_gprs *gprs, @@ -403,7 +399,7 @@ static void isi_gprs_set_attached(struct ofono_gprs *gprs, int attached, if (g_isi_client_send(gd->client, msg, sizeof(msg), GPDS_ATTACH_TIMEOUT, attach_resp_cb, - cbd, g_free)) + cbd, g_free) != NULL) return; } else { const unsigned char msg[] = { @@ -414,7 +410,7 @@ static void isi_gprs_set_attached(struct ofono_gprs *gprs, int attached, if (g_isi_client_send(gd->client, msg, sizeof(msg), GPDS_DETACH_TIMEOUT, detach_resp_cb, - cbd, g_free)) + cbd, g_free) != NULL) return; } @@ -479,7 +475,7 @@ static void isi_gprs_attached_status(struct ofono_gprs *gprs, goto error; if (g_isi_client_send(gd->client, msg, sizeof(msg), GPDS_TIMEOUT, - status_resp_cb, cbd, g_free)) + status_resp_cb, cbd, g_free) != NULL) return; error: diff --git a/drivers/isimodem/infoserver.c b/drivers/isimodem/infoserver.c index c4b0555a..3a8fd168 100644 --- a/drivers/isimodem/infoserver.c +++ b/drivers/isimodem/infoserver.c @@ -109,19 +109,19 @@ struct isi_infoserver *isi_infoserver_create(struct ofono_modem *modem, struct isi_infoserver *self; GIsiModem *isimodem = data; - if (!isimodem) { + if (isimodem == NULL) { errno = EINVAL; return NULL; } self = g_try_new0(struct isi_infoserver, 1); - if (!self) { + if (self == NULL) { errno = ENOMEM; return NULL; } self->server = g_isi_server_create(isimodem, PN_EPOC_INFO, &isiversion); - if (!self->server) { + if (self->server == NULL) { g_free(self); errno = ENOMEM; return NULL; @@ -137,7 +137,7 @@ struct isi_infoserver *isi_infoserver_create(struct ofono_modem *modem, void isi_infoserver_destroy(struct isi_infoserver *self) { - if (!self) + if (self == NULL) return; g_isi_server_destroy(self->server); diff --git a/drivers/isimodem/network-registration.c b/drivers/isimodem/network-registration.c index aaebc4e2..cef6236c 100644 --- a/drivers/isimodem/network-registration.c +++ b/drivers/isimodem/network-registration.c @@ -121,7 +121,7 @@ static inline int isi_tech_to_at_tech(struct rat_info *rat, struct gsm_info *gsm { int tech = -1; - if (!rat || !gsm) + if (rat == NULL || gsm == NULL) return -1; if (rat->rat == NET_GSM_RAT) @@ -194,7 +194,7 @@ static void reg_status_ind_cb(const GIsiMessage *msg, void *data) struct netreg_data *nd = ofono_netreg_get_data(netreg); GIsiSubBlockIter iter; - if (!netreg || !nd) + if (netreg == NULL || nd == NULL) return; if (g_isi_msg_id(msg) != NET_REG_STATUS_IND) @@ -247,7 +247,7 @@ static void rat_ind_cb(const GIsiMessage *msg, void *data) GIsiSubBlockIter iter; - if (!nd || g_isi_msg_id(msg) != NET_RAT_IND) + if (nd == NULL || g_isi_msg_id(msg) != NET_RAT_IND) return; for (g_isi_sb_iter_init(&iter, msg, 2); @@ -321,7 +321,7 @@ static void rat_resp_cb(const GIsiMessage *msg, void *data) }; GIsiSubBlockIter iter; - if (!cbd || !nd) + if (cbd == NULL || nd == NULL) goto error; if (!check_response_status(msg, NET_RAT_RESP)) @@ -339,7 +339,7 @@ static void rat_resp_cb(const GIsiMessage *msg, void *data) } if (g_isi_client_send(nd->client, req, sizeof(req), NETWORK_TIMEOUT, - reg_status_resp_cb, cbd, NULL)) + reg_status_resp_cb, cbd, NULL) != NULL) return; error: @@ -365,11 +365,11 @@ static void isi_registration_status(struct ofono_netreg *netreg, NET_CURRENT_RAT }; - if (!nd || !cbd) + if (nd == NULL || cbd == NULL) goto error; if (g_isi_client_send(nd->client, rat, sizeof(rat), NETWORK_TIMEOUT, - rat_resp_cb, cbd, NULL)) + rat_resp_cb, cbd, NULL) != NULL) return; error: @@ -443,11 +443,11 @@ static void isi_current_operator(struct ofono_netreg *netreg, 0x00 /* No sub-blocks */ }; - if (!cbd || !nd) + if (cbd == NULL || nd == NULL) goto error; if (g_isi_client_send(nd->client, msg, sizeof(msg), NETWORK_TIMEOUT, - name_get_resp_cb, cbd, g_free)) + name_get_resp_cb, cbd, g_free) != NULL) return; error: @@ -546,12 +546,12 @@ static void isi_list_operators(struct ofono_netreg *netreg, 0x00 }; - if (!cbd || !nd) + if (cbd == NULL || nd == NULL) goto error; if (g_isi_client_send(nd->client, msg, sizeof(msg), NETWORK_SCAN_TIMEOUT, available_resp_cb, cbd, - g_free)) + g_free) != NULL) return; error: @@ -593,12 +593,12 @@ static void isi_register_auto(struct ofono_netreg *netreg, 0x00 /* Index not used */ }; - if (!nd || !cbd) + if (nd == NULL || cbd == NULL) goto error; if (g_isi_client_send(nd->client, msg, sizeof(msg), NETWORK_SET_TIMEOUT, set_auto_resp_cb, cbd, - g_free)) + g_free) != NULL) return; error: @@ -647,11 +647,11 @@ static void isi_register_manual(struct ofono_netreg *netreg, 0x00, 0x00 /* Filler */ }; - if (!cbd || !nd) + if (cbd == NULL || nd == NULL) goto error; if (g_isi_client_send(nd->client, msg, sizeof(msg), NETWORK_SET_TIMEOUT, - set_manual_resp_cb, cbd, g_free)) + set_manual_resp_cb, cbd, g_free) != NULL) return; error: @@ -777,11 +777,11 @@ static void isi_strength(struct ofono_netreg *netreg, NET_CURRENT_CELL_RSSI, }; - if (!nd || !cbd) + if (nd == NULL || cbd == NULL) goto error; if (g_isi_client_send(nd->client, msg, sizeof(msg), NETWORK_TIMEOUT, - rssi_resp_cb, cbd, g_free)) + rssi_resp_cb, cbd, g_free) != NULL) return; error: @@ -817,11 +817,11 @@ static int isi_netreg_probe(struct ofono_netreg *netreg, unsigned int vendor, struct netreg_data *nd; nd = g_try_new0(struct netreg_data, 1); - if (!nd) + if (nd == NULL) return -ENOMEM; nd->client = g_isi_client_create(modem, PN_NETWORK); - if (!nd->client) { + if (nd->client == NULL) { g_free(nd); return -ENOMEM; } @@ -839,7 +839,7 @@ static void isi_netreg_remove(struct ofono_netreg *netreg) ofono_netreg_set_data(netreg, NULL); - if (!data) + if (data == NULL) return; g_isi_client_destroy(data->client); diff --git a/drivers/isimodem/phonebook.c b/drivers/isimodem/phonebook.c index 9eb9c079..ee15dfbe 100644 --- a/drivers/isimodem/phonebook.c +++ b/drivers/isimodem/phonebook.c @@ -226,7 +226,7 @@ static void read_next_entry(GIsiClient *client, uint16_t location, goto error; if (g_isi_client_send(client, msg, sizeof(msg), SIM_TIMEOUT, - notify, cbd, NULL)) + notify, cbd, NULL) != NULL) return; error: @@ -286,7 +286,7 @@ static void isi_export_entries(struct ofono_phonebook *pb, const char *storage, goto error; if (g_isi_client_send(pbd->client, msg, sizeof(msg), SIM_TIMEOUT, - read_resp_cb, cbd, NULL)) + read_resp_cb, cbd, NULL) != NULL) return; error: diff --git a/drivers/isimodem/radio-settings.c b/drivers/isimodem/radio-settings.c index 34f245ac..ba04d213 100644 --- a/drivers/isimodem/radio-settings.c +++ b/drivers/isimodem/radio-settings.c @@ -343,12 +343,9 @@ static int isi_radio_settings_probe(struct ofono_radio_settings *rs, return 0; nomem: - if (rd->gss_client) - g_isi_client_destroy(rd->gss_client); - if (rd->wran_client) - g_isi_client_destroy(rd->wran_client); - if (rd->gpds_client) - g_isi_client_destroy(rd->gpds_client); + g_isi_client_destroy(rd->gss_client); + g_isi_client_destroy(rd->wran_client); + g_isi_client_destroy(rd->gpds_client); g_free(rd); return -ENOMEM; } diff --git a/drivers/isimodem/sim.c b/drivers/isimodem/sim.c index 2075aea3..411dc393 100644 --- a/drivers/isimodem/sim.c +++ b/drivers/isimodem/sim.c @@ -184,9 +184,11 @@ static gboolean isi_read_spn(struct ofono_sim *sim, struct isi_cb_data *cbd) if (sd == NULL) return FALSE; - return g_isi_client_send(sd->client, msg, sizeof(msg), - SIM_TIMEOUT, spn_resp_cb, cbd, - g_free) != NULL; + if (g_isi_client_send(sd->client, msg, sizeof(msg), SIM_TIMEOUT, + spn_resp_cb, cbd, g_free) == NULL) + return FALSE; + + return TRUE; } static void read_iccid_resp_cb(const GIsiMessage *msg, void *data) @@ -218,9 +220,11 @@ static gboolean isi_read_iccid(struct ofono_sim *sim, struct isi_cb_data *cbd) if (sd == NULL) return FALSE; - return g_isi_client_send(sd->client, req, sizeof(req), - SIM_TIMEOUT, read_iccid_resp_cb, - cbd, g_free) != NULL; + if (g_isi_client_send(sd->client, req, sizeof(req), SIM_TIMEOUT, + read_iccid_resp_cb, cbd, g_free) == NULL) + return FALSE; + + return TRUE; } static void isi_read_file_transparent(struct ofono_sim *sim, int fileid, @@ -230,7 +234,7 @@ static void isi_read_file_transparent(struct ofono_sim *sim, int fileid, struct isi_cb_data *cbd; cbd = isi_cb_data_new(sim, cb, data); - if (!cbd) + if (cbd == NULL) goto error; switch (fileid) { @@ -341,9 +345,8 @@ static void isi_read_imsi(struct ofono_sim *sim, if (cbd == NULL || sd == NULL) goto error; - if (g_isi_client_send(sd->client, msg, sizeof(msg), - SIM_TIMEOUT, imsi_resp_cb, - cbd, g_free) != NULL) + if (g_isi_client_send(sd->client, msg, sizeof(msg), SIM_TIMEOUT, + imsi_resp_cb, cbd, g_free) != NULL) return; error: @@ -382,7 +385,7 @@ static void isi_read_hplmn(struct ofono_sim *sim) READ_HPLMN, 0 }; - if (!sd) + if (sd == NULL) return; g_isi_client_send(sd->client, req, sizeof(req), SIM_TIMEOUT, @@ -395,7 +398,7 @@ static void sim_ind_cb(const GIsiMessage *msg, void *data) struct sim_data *sd = ofono_sim_get_data(sim); uint8_t status; - if (!sd || g_isi_msg_id(msg) != SIM_IND || sd->registered) + if (sd == NULL || g_isi_msg_id(msg) != SIM_IND || sd->registered) return; if (!g_isi_msg_data_get_byte(msg, 0, &status)) diff --git a/drivers/isimodem/sms.c b/drivers/isimodem/sms.c index 030e001e..6c336e35 100644 --- a/drivers/isimodem/sms.c +++ b/drivers/isimodem/sms.c @@ -252,7 +252,7 @@ static void isi_sca_query(struct ofono_sms *sms, goto error; if (g_isi_client_send(sd->sim, msg, sizeof(msg), SIM_TIMEOUT, - sca_query_resp_cb, cbd, g_free)) + sca_query_resp_cb, cbd, g_free) != NULL) return; error: @@ -303,7 +303,7 @@ static void isi_sca_set(struct ofono_sms *sms, bcd[1] = sca->type & 0xFF; if (g_isi_client_vsend(sd->sim, iov, 2, SIM_TIMEOUT, sca_set_resp_cb, - cbd, g_free)) + cbd, g_free) != NULL) return; error: @@ -406,7 +406,7 @@ static void isi_submit(struct ofono_sms *sms, unsigned char *pdu, * Wait normal timeout plus the modem timeout. */ if (g_isi_client_vsend(sd->client, iov, 4, SMS_TIMEOUT + 5, - submit_resp_cb, cbd, g_free)) + submit_resp_cb, cbd, g_free) != NULL) return; error: @@ -544,7 +544,7 @@ static void routing_ntf_cb(const GIsiMessage *msg, void *data) } } - if (!tpdu || !addr || tpdu->len + addr->len > sizeof(pdu)) + if (tpdu == NULL || addr == NULL || tpdu->len + addr->len > sizeof(pdu)) return; memcpy(pdu, addr->data, addr->len); diff --git a/drivers/isimodem/ussd.c b/drivers/isimodem/ussd.c index e231465d..8baa2438 100644 --- a/drivers/isimodem/ussd.c +++ b/drivers/isimodem/ussd.c @@ -188,7 +188,7 @@ static void isi_request(struct ofono_ussd *ussd, int dcs, goto error; if (g_isi_client_vsend(ud->client, iov, 2, SS_TIMEOUT, - ussd_send_resp_cb, cbd, g_free)) + ussd_send_resp_cb, cbd, g_free) != NULL) return; error: @@ -211,7 +211,7 @@ static void isi_cancel(struct ofono_ussd *ussd, goto error; if (g_isi_client_send(ud->client, msg, sizeof(msg), SS_TIMEOUT, - ussd_send_resp_cb, cbd, g_free)) + ussd_send_resp_cb, cbd, g_free) != NULL) return; error: diff --git a/drivers/isimodem/voicecall.c b/drivers/isimodem/voicecall.c index fe4a5725..78f206ee 100644 --- a/drivers/isimodem/voicecall.c +++ b/drivers/isimodem/voicecall.c @@ -110,7 +110,7 @@ static struct isi_call_req_ctx *isi_call_req(struct ofono_voicecall *ovc, struct isi_call_req_ctx *irc; irc = g_try_new0(struct isi_call_req_ctx, 1); - if (!irc) { + if (irc == NULL) { CALLBACK_WITH_FAILURE(cb, data); return NULL; } @@ -119,8 +119,8 @@ static struct isi_call_req_ctx *isi_call_req(struct ofono_voicecall *ovc, irc->cb = cb; irc->data = data; - if (!g_isi_client_send(ivc->client, req, len, ISI_CALL_TIMEOUT, - handler, irc, NULL)) { + if (g_isi_client_send(ivc->client, req, len, ISI_CALL_TIMEOUT, + handler, irc, NULL) == NULL) { g_free(irc); return NULL; } @@ -149,7 +149,7 @@ static void isi_ctx_queue(struct isi_call_req_ctx *irc, isi_call_req_step *next) static void isi_ctx_remove(struct isi_call_req_ctx *irc) { - if (!irc->prev) + if (irc->prev == NULL) return; *irc->prev = irc->next; @@ -163,7 +163,7 @@ static void isi_ctx_remove(struct isi_call_req_ctx *irc) static void isi_ctx_free(struct isi_call_req_ctx *irc) { - if (!irc) + if (irc == NULL) return; isi_ctx_remove(irc); @@ -173,7 +173,7 @@ static void isi_ctx_free(struct isi_call_req_ctx *irc) static gboolean isi_ctx_return(struct isi_call_req_ctx *irc, enum ofono_error_type type, int error) { - if (!irc) + if (irc == NULL) return TRUE; if (irc->cb) { @@ -195,7 +195,7 @@ static gboolean isi_ctx_return_failure(struct isi_call_req_ctx *irc) static gboolean isi_ctx_return_success(struct isi_call_req_ctx *irc) { - if (!irc || !irc->step) + if (irc == NULL || irc->step == NULL) return isi_ctx_return(irc, OFONO_ERROR_TYPE_NO_ERROR, 0); irc->step(irc, 0); @@ -425,7 +425,7 @@ static struct isi_call *isi_call_set_idle(struct isi_call *call) { uint8_t id; - if (!call) + if (call == NULL) return NULL; id = call->id; @@ -573,7 +573,7 @@ static void isi_call_status_ind_cb(const GIsiMessage *msg, void *data) uint8_t call_id; uint8_t old_status; - if (!ivc || g_isi_msg_id(msg) != CALL_STATUS_IND || + if (ivc == NULL || g_isi_msg_id(msg) != CALL_STATUS_IND || !g_isi_msg_data_get_byte(msg, 0, &call_id) || (call_id & 7) == 0) return; @@ -1075,7 +1075,7 @@ static void isi_release_all_active(struct ofono_voicecall *ovc, CALL_CAUSE_TYPE_CLIENT, CALL_CAUSE_RELEASE_BY_USER, cb, data); - if (!irc) + if (irc == NULL) return; if (waiting) @@ -1278,14 +1278,14 @@ static int isi_voicecall_probe(struct ofono_voicecall *ovc, int id; ivc = g_try_new0(struct isi_voicecall, 1); - if (!ivc) + if (ivc == NULL) return -ENOMEM; for (id = 0; id <= 7; id++) ivc->calls[id].id = id; ivc->client = g_isi_client_create(modem, PN_CALL); - if (!ivc->client) { + if (ivc->client == NULL) { g_free(ivc); return -ENOMEM; } @@ -1303,7 +1303,7 @@ static void isi_voicecall_remove(struct ofono_voicecall *call) ofono_voicecall_set_data(call, NULL); - if (!data) + if (data == NULL) return; g_isi_client_destroy(data->client); -- cgit v1.2.1