summaryrefslogtreecommitdiffstats
path: root/drivers/huaweimodem
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@profusion.mobi>2010-11-27 17:38:56 -0200
committerDenis Kenzior <denkenz@gmail.com>2010-11-29 11:37:09 -0600
commitb82a7f851159a42f6ca38a2357551a94a4402e11 (patch)
tree6bf00675085885091b496bf1b0ab899b9a8f79e3 /drivers/huaweimodem
parent43d2435e64e4448cbdce222c68cb1352c5c74276 (diff)
downloadofono-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/huaweimodem')
-rw-r--r--drivers/huaweimodem/audio-settings.c2
-rw-r--r--drivers/huaweimodem/gprs-context.c6
-rw-r--r--drivers/huaweimodem/voicecall.c8
3 files changed, 8 insertions, 8 deletions
diff --git a/drivers/huaweimodem/audio-settings.c b/drivers/huaweimodem/audio-settings.c
index d5d3bba2..305776fb 100644
--- a/drivers/huaweimodem/audio-settings.c
+++ b/drivers/huaweimodem/audio-settings.c
@@ -90,7 +90,7 @@ static int huawei_audio_settings_probe(struct ofono_audio_settings *as,
struct audio_settings_data *asd;
asd = g_try_new0(struct audio_settings_data, 1);
- if (!asd)
+ if (asd == NULL)
return -ENOMEM;
asd->chat = g_at_chat_clone(chat);
diff --git a/drivers/huaweimodem/gprs-context.c b/drivers/huaweimodem/gprs-context.c
index 48e21ab6..ef3d93c2 100644
--- a/drivers/huaweimodem/gprs-context.c
+++ b/drivers/huaweimodem/gprs-context.c
@@ -311,7 +311,7 @@ static void huawei_gprs_activate_primary(struct ofono_gprs_context *gc,
DBG("cid %u", ctx->cid);
- if (!cbd)
+ if (cbd == NULL)
goto error;
gcd->active_context = ctx->cid;
@@ -344,7 +344,7 @@ static void huawei_gprs_deactivate_primary(struct ofono_gprs_context *gc,
DBG("cid %u", cid);
- if (!cbd)
+ if (cbd == NULL)
goto error;
cbd->user = gc;
@@ -376,7 +376,7 @@ static int huawei_gprs_context_probe(struct ofono_gprs_context *gc,
}
gcd = g_try_new0(struct gprs_context_data, 1);
- if (!gcd)
+ if (gcd == NULL)
return -ENOMEM;
gcd->chat = g_at_chat_clone(chat);
diff --git a/drivers/huaweimodem/voicecall.c b/drivers/huaweimodem/voicecall.c
index b4174380..ff08124e 100644
--- a/drivers/huaweimodem/voicecall.c
+++ b/drivers/huaweimodem/voicecall.c
@@ -57,7 +57,7 @@ static struct ofono_call *create_call(struct ofono_voicecall *vc, int type,
/* Generate a call structure for the waiting call */
call = g_try_new0(struct ofono_call, 1);
- if (!call)
+ if (call == NULL)
return NULL;
call->id = id;
@@ -99,7 +99,7 @@ static void huawei_template(struct ofono_voicecall *vc, const char *cmd,
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
struct cb_data *cbd = cb_data_new(cb, data);
- if (!cbd)
+ if (cbd == NULL)
goto error;
if (g_at_chat_send(vd->chat, cmd, none_prefix,
@@ -319,7 +319,7 @@ static void orig_notify(GAtResult *result, gpointer user_data)
ofono_info("Call origin: id %d type %d", call_id, call_type);
call = create_call(vc, call_type, 0, 2, NULL, 128, 2, call_id);
- if (!call) {
+ if (call == NULL) {
ofono_error("Unable to malloc, call tracking will fail!");
return;
}
@@ -472,7 +472,7 @@ static int huawei_voicecall_probe(struct ofono_voicecall *vc,
struct voicecall_data *vd;
vd = g_try_new0(struct voicecall_data, 1);
- if (!vd)
+ if (vd == NULL)
return -ENOMEM;
vd->chat = g_at_chat_clone(chat);