summaryrefslogtreecommitdiffstats
path: root/drivers/isimodem
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/isimodem')
-rw-r--r--drivers/isimodem/audio-settings.c6
-rw-r--r--drivers/isimodem/call-barring.c12
-rw-r--r--drivers/isimodem/call-forwarding.c13
-rw-r--r--drivers/isimodem/call-meter.c4
-rw-r--r--drivers/isimodem/call-settings.c12
-rw-r--r--drivers/isimodem/cbs.c10
-rw-r--r--drivers/isimodem/devinfo.c12
-rw-r--r--drivers/isimodem/gprs-context.c26
-rw-r--r--drivers/isimodem/gprs.c10
-rw-r--r--drivers/isimodem/infoserver.c4
-rw-r--r--drivers/isimodem/network-registration.c23
-rw-r--r--drivers/isimodem/phonebook.c10
-rw-r--r--drivers/isimodem/radio-settings.c10
-rw-r--r--drivers/isimodem/sim.c12
-rw-r--r--drivers/isimodem/sms.c18
-rw-r--r--drivers/isimodem/ssn.c6
-rw-r--r--drivers/isimodem/ussd.c10
-rw-r--r--drivers/isimodem/voicecall.c14
18 files changed, 104 insertions, 108 deletions
diff --git a/drivers/isimodem/audio-settings.c b/drivers/isimodem/audio-settings.c
index 80c56488..04774af1 100644
--- a/drivers/isimodem/audio-settings.c
+++ b/drivers/isimodem/audio-settings.c
@@ -107,11 +107,11 @@ static int isi_audio_settings_probe(struct ofono_audio_settings *as,
struct audio_settings_data *asd =
g_try_new0(struct audio_settings_data, 1);
- if (!asd)
+ if (asd == NULL)
return -ENOMEM;
asd->client = g_isi_client_create(idx, PN_CALL);
- if (!asd->client) {
+ if (asd->client == NULL) {
g_free(asd);
return -ENOMEM;
}
@@ -128,7 +128,7 @@ static void isi_audio_settings_remove(struct ofono_audio_settings *as)
{
struct audio_settings_data *asd = ofono_audio_settings_get_data(as);
- if (!asd)
+ if (asd == NULL)
return;
ofono_audio_settings_set_data(as, NULL);
diff --git a/drivers/isimodem/call-barring.c b/drivers/isimodem/call-barring.c
index 7cdd218d..5ec9b0c3 100644
--- a/drivers/isimodem/call-barring.c
+++ b/drivers/isimodem/call-barring.c
@@ -128,7 +128,7 @@ static void isi_set(struct ofono_call_barring *barr, const char *lock,
DBG("lock code %s enable %d class %d password %s",
lock, enable, cls, passwd);
- if (!cbd || !bd)
+ if (cbd == NULL || bd == NULL)
goto error;
if (g_isi_request_make(bd->client, msg, sizeof(msg), SS_TIMEOUT,
@@ -275,7 +275,7 @@ static void isi_query(struct ofono_call_barring *barr, const char *lock,
DBG("barring query lock code %s", lock);
- if (!cbd || !bd)
+ if (cbd == NULL || bd == NULL)
goto error;
if (g_isi_request_make(bd->client, msg, sizeof(msg), SS_TIMEOUT,
@@ -346,7 +346,7 @@ static void isi_set_passwd(struct ofono_call_barring *barr, const char *lock,
DBG("lock code %s (%u) old password %s new password %s",
lock, ss_code, old_passwd, new_passwd);
- if (!cbd || !bd)
+ if (cbd == NULL || bd == NULL)
goto error;
if (g_isi_request_make(bd->client, msg, sizeof(msg), SS_TIMEOUT,
@@ -397,11 +397,11 @@ static int isi_call_barring_probe(struct ofono_call_barring *barr,
GIsiModem *idx = user;
struct barr_data *data = g_try_new0(struct barr_data, 1);
- if (!data)
+ if (data == NULL)
return -ENOMEM;
data->client = g_isi_client_create(idx, PN_SS);
- if (!data->client)
+ if (data->client == NULL)
return -ENOMEM;
ofono_call_barring_set_data(barr, data);
@@ -415,7 +415,7 @@ static void isi_call_barring_remove(struct ofono_call_barring *barr)
{
struct barr_data *data = ofono_call_barring_get_data(barr);
- if (!data)
+ if (data == NULL)
return;
ofono_call_barring_set_data(barr, NULL);
diff --git a/drivers/isimodem/call-forwarding.c b/drivers/isimodem/call-forwarding.c
index bb25ee7b..e0ec6c28 100644
--- a/drivers/isimodem/call-forwarding.c
+++ b/drivers/isimodem/call-forwarding.c
@@ -229,7 +229,7 @@ static void isi_registration(struct ofono_call_forwarding *cf,
DBG("forwarding type %d class %d", type, cls);
- if (!cbd || !fd || !number->number || strlen(number->number) > 28)
+ if (cbd == NULL || fd == NULL || !number->number || strlen(number->number) > 28)
goto error;
ss_code = forw_type_to_isi_code(type);
@@ -349,7 +349,7 @@ static void isi_erasure(struct ofono_call_forwarding *cf, int type, int cls,
DBG("forwarding type %d class %d", type, cls);
- if (!cbd || !fd)
+ if (cbd == NULL || fd == NULL)
goto error;
ss_code = forw_type_to_isi_code(type);
@@ -481,7 +481,7 @@ static void isi_query(struct ofono_call_forwarding *cf, int type, int cls,
DBG("forwarding type %d class %d", type, cls);
- if (!cbd || !fd || cls != 7)
+ if (cbd == NULL || fd == NULL || cls != 7)
goto error;
ss_code = forw_type_to_isi_code(type);
@@ -540,12 +540,11 @@ static int isi_call_forwarding_probe(struct ofono_call_forwarding *cf,
struct forw_data *data;
data = g_try_new0(struct forw_data, 1);
-
- if (!data)
+ if (data == NULL)
return -ENOMEM;
data->client = g_isi_client_create(idx, PN_SS);
- if (!data->client)
+ if (data->client == NULL)
return -ENOMEM;
ofono_call_forwarding_set_data(cf, data);
@@ -560,7 +559,7 @@ static void isi_call_forwarding_remove(struct ofono_call_forwarding *cf)
{
struct forw_data *data = ofono_call_forwarding_get_data(cf);
- if (!data)
+ if (data == NULL)
return;
ofono_call_forwarding_set_data(cf, NULL);
diff --git a/drivers/isimodem/call-meter.c b/drivers/isimodem/call-meter.c
index 336a077e..2fc74c8a 100644
--- a/drivers/isimodem/call-meter.c
+++ b/drivers/isimodem/call-meter.c
@@ -90,11 +90,11 @@ static int isi_call_meter_probe(struct ofono_call_meter *cm,
GIsiModem *idx = user;
struct call_meter_data *data = g_try_new0(struct call_meter_data, 1);
- if (!data)
+ if (data == NULL)
return -ENOMEM;
data->client = g_isi_client_create(idx, PN_SS);
- if (!data->client)
+ if (data->client == NULL)
return -ENOMEM;
ofono_call_meter_set_data(cm, data);
diff --git a/drivers/isimodem/call-settings.c b/drivers/isimodem/call-settings.c
index 23c1982b..3f9c07bf 100644
--- a/drivers/isimodem/call-settings.c
+++ b/drivers/isimodem/call-settings.c
@@ -177,7 +177,7 @@ static void isi_cw_query(struct ofono_call_settings *cs, int cls,
DBG("waiting class %d", cls);
- if (!cbd || !sd)
+ if (cbd == NULL || sd == NULL)
goto error;
if (g_isi_request_make(sd->client, msg, sizeof(msg), SS_TIMEOUT,
@@ -268,7 +268,7 @@ static void isi_cw_set(struct ofono_call_settings *cs, int mode, int cls,
DBG("waiting mode %d class %d", mode, cls);
- if (!cbd || !sd)
+ if (cbd == NULL || sd == NULL)
goto error;
if (g_isi_request_make(sd->client, msg, sizeof(msg), SS_TIMEOUT,
@@ -320,13 +320,11 @@ static int isi_call_settings_probe(struct ofono_call_settings *cs,
struct settings_data *data;
data = g_try_new0(struct settings_data, 1);
-
- if (!data)
+ if (data == NULL)
return -ENOMEM;
data->client = g_isi_client_create(idx, PN_SS);
-
- if (!data->client)
+ if (data->client == NULL)
return -ENOMEM;
ofono_call_settings_set_data(cs, data);
@@ -341,7 +339,7 @@ static void isi_call_settings_remove(struct ofono_call_settings *cs)
{
struct settings_data *data = ofono_call_settings_get_data(cs);
- if (!data)
+ if (data == NULL)
return;
ofono_call_settings_set_data(cs, NULL);
diff --git a/drivers/isimodem/cbs.c b/drivers/isimodem/cbs.c
index 2a327201..f6924ec8 100644
--- a/drivers/isimodem/cbs.c
+++ b/drivers/isimodem/cbs.c
@@ -136,11 +136,11 @@ static int isi_cbs_probe(struct ofono_cbs *cbs, unsigned int vendor,
0x00 /* Languages */
};
- if (!cd)
+ if (cd == NULL)
return -ENOMEM;
cd->client = g_isi_client_create(idx, PN_SMS);
- if (!cd->client)
+ if (cd->client == NULL)
return -ENOMEM;
ofono_cbs_set_data(cbs, cd);
@@ -149,8 +149,8 @@ static int isi_cbs_probe(struct ofono_cbs *cbs, unsigned int vendor,
if (debug && (strcmp(debug, "all") == 0 || strcmp(debug, "cbs") == 0))
g_isi_client_set_debug(cd->client, sms_debug, NULL);
- if (!g_isi_request_make(cd->client, msg, sizeof(msg), CBS_TIMEOUT,
- routing_resp_cb, cbs))
+ if (g_isi_request_make(cd->client, msg, sizeof(msg), CBS_TIMEOUT,
+ routing_resp_cb, cbs) == NULL)
DBG("Failed to set CBS routing.");
return 0;
@@ -173,7 +173,7 @@ static void isi_cbs_remove(struct ofono_cbs *cbs)
0x00 /* Languages */
};
- if (!data)
+ if (data == NULL)
return;
if (data->client) {
diff --git a/drivers/isimodem/devinfo.c b/drivers/isimodem/devinfo.c
index f7960ff6..7f94f9e6 100644
--- a/drivers/isimodem/devinfo.c
+++ b/drivers/isimodem/devinfo.c
@@ -128,7 +128,7 @@ static void isi_query_manufacturer(struct ofono_devinfo *info,
INFO_PRODUCT_MANUFACTURER
};
- if (!cbd || !dev)
+ if (cbd == NULL || dev == NULL)
goto error;
if (g_isi_request_make(dev->client, msg, sizeof(msg),
@@ -152,7 +152,7 @@ static void isi_query_model(struct ofono_devinfo *info,
INFO_PRODUCT_NAME
};
- if (!cbd)
+ if (cbd == NULL)
goto error;
if (g_isi_request_make(dev->client, msg, sizeof(msg),
@@ -177,7 +177,7 @@ static void isi_query_revision(struct ofono_devinfo *info,
0x00, 0x00, 0x00, 0x00
};
- if (!cbd || !dev)
+ if (cbd == NULL || dev == NULL)
goto error;
if (g_isi_request_make(dev->client, msg, sizeof(msg),
@@ -201,7 +201,7 @@ static void isi_query_serial(struct ofono_devinfo *info,
INFO_SN_IMEI_PLAIN
};
- if (!cbd || !dev)
+ if (cbd == NULL || dev == NULL)
goto error;
if (g_isi_request_make(dev->client, msg, sizeof(msg),
@@ -252,11 +252,11 @@ static int isi_devinfo_probe(struct ofono_devinfo *info, unsigned int vendor,
GIsiModem *idx = user;
struct devinfo_data *data = g_try_new0(struct devinfo_data, 1);
- if (!data)
+ if (data == NULL)
return -ENOMEM;
data->client = g_isi_client_create(idx, PN_PHONE_INFO);
- if (!data->client) {
+ if (data->client == NULL) {
g_free(data);
return -ENOMEM;
}
diff --git a/drivers/isimodem/gprs-context.c b/drivers/isimodem/gprs-context.c
index 88450b8a..2dc1263d 100644
--- a/drivers/isimodem/gprs-context.c
+++ b/drivers/isimodem/gprs-context.c
@@ -85,7 +85,7 @@ struct context_data {
static void reset_context(struct context_data *cd)
{
- if (!cd)
+ if (cd == NULL)
return;
g_isi_remove_subscription(cd->client, PN_GPDS,
@@ -399,8 +399,8 @@ static void send_context_authenticate(GIsiClient *client, void *opaque)
{ cd->password, password_len },
};
- if (!g_isi_request_vmake(client, iov, 4, GPDS_TIMEOUT,
- context_auth_cb, cd))
+ if (g_isi_request_vmake(client, iov, 4, GPDS_TIMEOUT,
+ context_auth_cb, cd) == NULL)
gprs_up_fail(cd);
}
@@ -478,8 +478,8 @@ static gboolean create_context_cb(GIsiClient *client,
cd->handle = msg[1] = resp[1];
- if (!g_isi_request_make(client, msg, sizeof(msg), GPDS_TIMEOUT,
- link_conf_cb, cd))
+ if (g_isi_request_make(client, msg, sizeof(msg), GPDS_TIMEOUT,
+ link_conf_cb, cd) == NULL)
return gprs_up_fail(cd);
/* TODO: send context configuration at the same time? */
@@ -495,8 +495,8 @@ static void create_pipe_cb(GIsiPipe *pipe)
GPDS_CONTEXT_ID_CREATE_REQ,
};
- if (!g_isi_request_make(cd->client, msg, sizeof(msg), GPDS_TIMEOUT,
- create_context_cb, cd))
+ if (g_isi_request_make(cd->client, msg, sizeof(msg), GPDS_TIMEOUT,
+ create_context_cb, cd) == NULL)
gprs_up_fail(cd);
}
@@ -582,7 +582,7 @@ static void isi_gprs_deactivate_primary(struct ofono_gprs_context *gc,
0x00, /* GPDS context ID, added later */
};
- if (!cd)
+ if (cd == NULL)
return;
cd->down_cb = cb;
@@ -590,8 +590,8 @@ static void isi_gprs_deactivate_primary(struct ofono_gprs_context *gc,
msg[1] = cd->handle;
- if (!g_isi_request_make(cd->client, msg, sizeof(msg), GPDS_TIMEOUT,
- context_deactivate_cb, cd)) {
+ if (g_isi_request_make(cd->client, msg, sizeof(msg), GPDS_TIMEOUT,
+ context_deactivate_cb, cd) == NULL) {
gprs_down_fail(cd);
return;
}
@@ -630,11 +630,11 @@ static int isi_gprs_context_probe(struct ofono_gprs_context *gc,
GIsiModem *idx = user;
struct context_data *cd = g_try_new0(struct context_data, 1);
- if (!cd)
+ if (cd == NULL)
return -ENOMEM;
cd->client = g_isi_client_create(idx, PN_GPDS);
- if (!cd->client) {
+ if (cd->client == NULL) {
g_free(cd);
return -ENOMEM;
}
@@ -652,7 +652,7 @@ static void isi_gprs_context_remove(struct ofono_gprs_context *gc)
{
struct context_data *cd = ofono_gprs_context_get_data(gc);
- if (!cd)
+ if (cd == NULL)
return;
ofono_gprs_context_set_data(gc, NULL);
diff --git a/drivers/isimodem/gprs.c b/drivers/isimodem/gprs.c
index 9cbe4f3b..3c9facde 100644
--- a/drivers/isimodem/gprs.c
+++ b/drivers/isimodem/gprs.c
@@ -165,11 +165,11 @@ static int isi_gprs_probe(struct ofono_gprs *gprs,
GIsiModem *idx = user;
struct gprs_data *gd = g_try_new0(struct gprs_data, 1);
- if (!gd)
+ if (gd == NULL)
return -ENOMEM;
gd->client = g_isi_client_create(idx, PN_GPDS);
- if (!gd->client) {
+ if (gd->client == NULL) {
g_free(gd);
return -ENOMEM;
}
@@ -187,7 +187,7 @@ static void isi_gprs_remove(struct ofono_gprs *gprs)
{
struct gprs_data *data = ofono_gprs_get_data(gprs);
- if (!data)
+ if (data == NULL)
return;
ofono_gprs_set_data(gprs, NULL);
@@ -286,7 +286,7 @@ static void isi_gprs_set_attached(struct ofono_gprs *gprs, int attached,
GIsiRequest *req;
- if (!cbd || !gd)
+ if (cbd == NULL || gd == NULL)
goto error;
if (attached)
@@ -356,7 +356,7 @@ static void isi_gprs_attached_status(struct ofono_gprs *gprs,
GPDS_STATUS_REQ,
};
- if (!cbd || !gd)
+ if (cbd == NULL || gd == NULL)
goto error;
if (g_isi_send(gd->client, msg, sizeof(msg), GPDS_TIMEOUT,
diff --git a/drivers/isimodem/infoserver.c b/drivers/isimodem/infoserver.c
index 7f07da31..96659964 100644
--- a/drivers/isimodem/infoserver.c
+++ b/drivers/isimodem/infoserver.c
@@ -93,11 +93,11 @@ struct isi_infoserver *isi_infoserver_create(struct ofono_modem *modem,
struct isi_infoserver *self;
self = g_new0(struct isi_infoserver, 1);
- if (!self)
+ if (self == NULL)
return NULL;
self->server = g_isi_server_create(data, PN_EPOC_INFO, 0, 0);
- if (!self->server) {
+ if (self->server == NULL) {
g_free(self);
return NULL;
}
diff --git a/drivers/isimodem/network-registration.c b/drivers/isimodem/network-registration.c
index 1e7c8927..44e84240 100644
--- a/drivers/isimodem/network-registration.c
+++ b/drivers/isimodem/network-registration.c
@@ -255,7 +255,7 @@ static void isi_registration_status(struct ofono_netreg *netreg,
NET_REG_STATUS_GET_REQ
};
- if (!cbd || !nd)
+ if (cbd == NULL || nd == NULL)
goto error;
if (g_isi_request_make(nd->client, msg, sizeof(msg),
@@ -360,7 +360,7 @@ 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_request_make(nd->client, msg, sizeof(msg),
@@ -482,7 +482,7 @@ static void isi_list_operators(struct ofono_netreg *netreg,
0x00
};
- if (!cbd || !net)
+ if (cbd == NULL || net == NULL)
goto error;
if (g_isi_request_make(net->client, msg, sizeof(msg),
@@ -548,7 +548,7 @@ static void isi_register_auto(struct ofono_netreg *netreg,
0x00 /* Index not used */
};
- if (!cbd || !net)
+ if (cbd == NULL || net == NULL)
goto error;
if (g_isi_request_make(net->client, msg, sizeof(msg),
@@ -621,7 +621,7 @@ 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_request_make(nd->client, msg, sizeof(msg),
@@ -866,7 +866,7 @@ static void isi_strength(struct ofono_netreg *netreg,
NET_CURRENT_CELL_RSSI
};
- if (!cbd || !nd)
+ if (cbd == NULL || nd == NULL)
goto error;
if (g_isi_request_make(nd->client, msg, sizeof(msg),
@@ -901,9 +901,8 @@ static gboolean isi_netreg_register(gpointer user)
g_isi_subscribe(nd->client, NET_TIME_IND, time_ind_cb, netreg);
/* Bootstrap current RAT setting */
- if (!g_isi_request_make(nd->client, rat, sizeof(rat),
- NETWORK_TIMEOUT,
- rat_resp_cb, netreg))
+ if (g_isi_request_make(nd->client, rat, sizeof(rat),
+ NETWORK_TIMEOUT, rat_resp_cb, netreg) == NULL)
DBG("Failed to bootstrap RAT");
ofono_netreg_register(netreg);
@@ -935,11 +934,11 @@ static int isi_netreg_probe(struct ofono_netreg *netreg, unsigned int vendor,
GIsiModem *idx = user;
struct netreg_data *nd = g_try_new0(struct netreg_data, 1);
- if (!nd)
+ if (nd == NULL)
return -ENOMEM;
nd->client = g_isi_client_create(idx, PN_NETWORK);
- if (!nd->client) {
+ if (nd->client == NULL) {
g_free(nd);
return -ENOMEM;
}
@@ -954,7 +953,7 @@ static void isi_netreg_remove(struct ofono_netreg *net)
{
struct netreg_data *data = ofono_netreg_get_data(net);
- if (!data)
+ if (data == NULL)
return;
ofono_netreg_set_data(net, NULL);
diff --git a/drivers/isimodem/phonebook.c b/drivers/isimodem/phonebook.c
index dc832c44..5ee43152 100644
--- a/drivers/isimodem/phonebook.c
+++ b/drivers/isimodem/phonebook.c
@@ -192,7 +192,7 @@ static void read_next_entry(GIsiClient *client, int location,
if (location < 0)
goto error;
- if (!cbd)
+ if (cbd == NULL)
goto error;
if (g_isi_request_make(client, msg, sizeof(msg), SIM_TIMEOUT,
@@ -259,7 +259,7 @@ static void isi_export_entries(struct ofono_phonebook *pb, const char *storage,
0, 0 /* filler */
};
- if (!cbd || !pbd)
+ if (cbd == NULL || pbd == NULL)
goto error;
if (strcmp(storage, "SM"))
@@ -314,11 +314,11 @@ static int isi_phonebook_probe(struct ofono_phonebook *pb, unsigned int vendor,
GIsiModem *idx = user;
struct pb_data *data = g_try_new0(struct pb_data, 1);
- if (!data)
+ if (data == NULL)
return -ENOMEM;
data->client = g_isi_client_create(idx, PN_SIM);
- if (!data->client) {
+ if (data->client == NULL) {
g_free(data);
return -ENOMEM;
}
@@ -335,7 +335,7 @@ static void isi_phonebook_remove(struct ofono_phonebook *pb)
{
struct pb_data *data = ofono_phonebook_get_data(pb);
- if (!data)
+ if (data == NULL)
return;
ofono_phonebook_set_data(pb, NULL);
diff --git a/drivers/isimodem/radio-settings.c b/drivers/isimodem/radio-settings.c
index 6111b3ad..01c67195 100644
--- a/drivers/isimodem/radio-settings.c
+++ b/drivers/isimodem/radio-settings.c
@@ -159,7 +159,7 @@ static void isi_query_rat_mode(struct ofono_radio_settings *rs,
0x00 /* subblock count */
};
- if (!cbd || !rd)
+ if (cbd == NULL || rd == NULL)
goto error;
if (g_isi_request_make(rd->client, msg, sizeof(msg), GSS_TIMEOUT,
@@ -226,7 +226,7 @@ static void isi_set_rat_mode(struct ofono_radio_settings *rs,
0x00 /* filler */
};
- if (!cbd || !rd)
+ if (cbd == NULL || rd == NULL)
goto error;
if (isi_mode == -1)
@@ -363,11 +363,11 @@ static int isi_radio_settings_probe(struct ofono_radio_settings *rs,
GIsiModem *idx = user;
struct radio_data *rd = g_try_new0(struct radio_data, 1);
- if (!rd)
+ if (rd == NULL)
return -ENOMEM;
rd->client = g_isi_client_create(idx, PN_GSS);
- if (!rd->client) {
+ if (rd->client == NULL) {
g_free(rd);
return -ENOMEM;
}
@@ -384,7 +384,7 @@ static void isi_radio_settings_remove(struct ofono_radio_settings *rs)
{
struct radio_data *rd = ofono_radio_settings_get_data(rs);
- if (!rd)
+ if (rd == NULL)
return;
ofono_radio_settings_set_data(rs, NULL);
diff --git a/drivers/isimodem/sim.c b/drivers/isimodem/sim.c
index d03a07e9..b79c52af 100644
--- a/drivers/isimodem/sim.c
+++ b/drivers/isimodem/sim.c
@@ -156,7 +156,7 @@ static gboolean isi_read_spn(struct ofono_sim *sim, struct isi_cb_data *cbd)
0
};
- if (!sd)
+ if (sd == NULL)
return FALSE;
return g_isi_request_make(sd->client, msg, sizeof(msg),
@@ -200,7 +200,7 @@ static gboolean isi_read_iccid(struct ofono_sim *sim, struct isi_cb_data *cbd)
struct sim_data *sd = ofono_sim_get_data(sim);
const unsigned char req[] = { SIM_READ_FIELD_REQ, ICC };
- if (!sd)
+ if (sd == NULL)
return FALSE;
return g_isi_request_make(sd->client, req, sizeof(req), SIM_TIMEOUT,
@@ -343,7 +343,7 @@ static void isi_read_imsi(struct ofono_sim *sim,
READ_IMSI
};
- if (!cbd || !sd)
+ if (cbd == NULL || sd == NULL)
goto error;
if (g_isi_request_make(sd->client, msg, sizeof(msg), SIM_TIMEOUT,
@@ -451,11 +451,11 @@ static int isi_sim_probe(struct ofono_sim *sim, unsigned int vendor,
struct sim_data *sd = g_try_new0(struct sim_data, 1);
const char *debug = getenv("OFONO_ISI_DEBUG");
- if (!sd)
+ if (sd == NULL)
return -ENOMEM;
sd->client = g_isi_client_create(idx, PN_SIM);
- if (!sd->client)
+ if (sd->client == NULL)
return -ENOMEM;
ofono_sim_set_data(sim, sd);
@@ -472,7 +472,7 @@ static void isi_sim_remove(struct ofono_sim *sim)
{
struct sim_data *data = ofono_sim_get_data(sim);
- if (!data)
+ if (data == NULL)
return;
ofono_sim_set_data(sim, NULL);
diff --git a/drivers/isimodem/sms.c b/drivers/isimodem/sms.c
index e2c2533d..e8527dd8 100644
--- a/drivers/isimodem/sms.c
+++ b/drivers/isimodem/sms.c
@@ -156,7 +156,7 @@ static void isi_sca_query(struct ofono_sms *sms,
1, /* Location, default is 1 */
};
- if (!cbd || !sd)
+ if (cbd == NULL || sd == NULL)
goto error;
if (g_isi_send(sd->sim, msg, sizeof(msg), SIM_TIMEOUT,
@@ -214,7 +214,7 @@ static void isi_sca_set(struct ofono_sms *sms,
{ &sd->params, sizeof(sd->params) },
};
- if (!cbd || !sd)
+ if (cbd == NULL || sd == NULL)
goto error;
bcd = sd->params.sca;
@@ -350,7 +350,7 @@ static void isi_submit(struct ofono_sms *sms, unsigned char *pdu,
{ sca_sb, sca_sb_len },
};
- if (!cbd || !sd)
+ if (cbd == NULL || sd == NULL)
goto error;
if (use_sca) {
@@ -560,18 +560,18 @@ static int isi_sms_probe(struct ofono_sms *sms, unsigned int vendor,
0x00 /* Sub-sub-block count */
};
- if (!data)
+ if (data == NULL)
return -ENOMEM;
data->params.absent = 0xff;
data->params.alphalen = 1; /* Includes final UCS2-coded NUL */
data->client = g_isi_client_create(idx, PN_SMS);
- if (!data->client)
+ if (data->client == NULL)
return -ENOMEM;
data->sim = g_isi_client_create(idx, PN_SIM);
- if (!data->sim) {
+ if (data->sim == NULL) {
g_isi_client_destroy(data->client);
return -ENOMEM;
}
@@ -586,8 +586,8 @@ static int isi_sms_probe(struct ofono_sms *sms, unsigned int vendor,
g_isi_subscribe(data->client, SMS_MESSAGE_SEND_STATUS_IND,
send_status_ind_cb, sms);
- if (!g_isi_send(data->client, msg, sizeof(msg), SMS_TIMEOUT,
- routing_resp_cb, sms, NULL))
+ if (g_isi_send(data->client, msg, sizeof(msg), SMS_TIMEOUT,
+ routing_resp_cb, sms, NULL) == NULL)
DBG("Failed to set SMS routing.");
return 0;
@@ -609,7 +609,7 @@ static void isi_sms_remove(struct ofono_sms *sms)
0x00 /* Sub-sub-block count */
};
- if (!data)
+ if (data == NULL)
return;
ofono_sms_set_data(sms, NULL);
diff --git a/drivers/isimodem/ssn.c b/drivers/isimodem/ssn.c
index 797ba9d2..402a48a5 100644
--- a/drivers/isimodem/ssn.c
+++ b/drivers/isimodem/ssn.c
@@ -51,11 +51,11 @@ static int isi_ssn_probe(struct ofono_ssn *ssn, unsigned int vendor,
GIsiModem *idx = user;
struct ssn_data *data = g_try_new0(struct ssn_data, 1);
- if (!data)
+ if (data == NULL)
return -ENOMEM;
data->client = g_isi_client_create(idx, PN_SS);
- if (!data->client)
+ if (data->client == NULL)
return -ENOMEM;
ofono_ssn_set_data(ssn, data);
@@ -67,7 +67,7 @@ static void isi_ssn_remove(struct ofono_ssn *ssn)
{
struct ssn_data *data = ofono_ssn_get_data(ssn);
- if (!data)
+ if (data == NULL)
return;
ofono_ssn_set_data(ssn, NULL);
diff --git a/drivers/isimodem/ussd.c b/drivers/isimodem/ussd.c
index 78ac9fe7..a509a0ae 100644
--- a/drivers/isimodem/ussd.c
+++ b/drivers/isimodem/ussd.c
@@ -181,7 +181,7 @@ static void isi_request(struct ofono_ussd *ussd, int dcs,
{ (uint8_t *)pdu, len }
};
- if (!cbd || !ud)
+ if (cbd == NULL || ud == NULL)
goto error;
if (g_isi_vsend(ud->client, iov, 2, SS_TIMEOUT,
@@ -205,7 +205,7 @@ static void isi_cancel(struct ofono_ussd *ussd,
0x00 /* subblock count */
};
- if (!cbd || !ud)
+ if (cbd == NULL || ud == NULL)
goto error;
if (g_isi_send(ud->client, msg, sizeof(msg), SS_TIMEOUT,
@@ -258,11 +258,11 @@ static int isi_ussd_probe(struct ofono_ussd *ussd, unsigned int vendor,
GIsiModem *idx = user;
struct ussd_data *ud = g_try_new0(struct ussd_data, 1);
- if (!ud)
+ if (ud == NULL)
return -ENOMEM;
ud->client = g_isi_client_create(idx, PN_SS);
- if (!ud->client)
+ if (ud->client == NULL)
return -ENOMEM;
ofono_ussd_set_data(ussd, ud);
@@ -275,7 +275,7 @@ static void isi_ussd_remove(struct ofono_ussd *ussd)
{
struct ussd_data *data = ofono_ussd_get_data(ussd);
- if (!data)
+ if (data == NULL)
return;
ofono_ussd_set_data(ussd, NULL);
diff --git a/drivers/isimodem/voicecall.c b/drivers/isimodem/voicecall.c
index 497a2ce0..84b77d16 100644
--- a/drivers/isimodem/voicecall.c
+++ b/drivers/isimodem/voicecall.c
@@ -176,7 +176,7 @@ static gboolean isi_ctx_return(struct isi_call_req_context *irc,
enum ofono_error_type type,
int error)
{
- if (!irc)
+ if (irc == NULL)
return TRUE;
if (irc->cb) {
@@ -1252,14 +1252,14 @@ static int isi_voicecall_probe(struct ofono_voicecall *ovc,
struct isi_voicecall *ivc = g_try_new0(struct isi_voicecall, 1);
int id;
- if (!ivc)
+ if (ivc == NULL)
return -ENOMEM;
for (id = 0; id <= 7; id++)
ivc->calls[id].id = id;
ivc->client = g_isi_client_create(idx, PN_CALL);
- if (!ivc->client) {
+ if (ivc->client == NULL) {
g_free(ivc);
return -ENOMEM;
}
@@ -1302,9 +1302,9 @@ static gboolean isi_call_register(gpointer _ovc)
CALL_STATUS_IND, isi_call_status_ind_cb,
ovc);
- if (!isi_call_status_req(ovc, CALL_ID_ALL,
- CALL_STATUS_MODE_ADDR_AND_ORIGIN,
- NULL, NULL))
+ if (isi_call_status_req(ovc, CALL_ID_ALL,
+ CALL_STATUS_MODE_ADDR_AND_ORIGIN,
+ NULL, NULL) == NULL)
DBG("Failed to request call status");
ofono_voicecall_register(ovc);
@@ -1316,7 +1316,7 @@ static void isi_voicecall_remove(struct ofono_voicecall *call)
{
struct isi_voicecall *data = ofono_voicecall_get_data(call);
- if (!data)
+ if (data == NULL)
return;
ofono_voicecall_set_data(call, NULL);