From b82a7f851159a42f6ca38a2357551a94a4402e11 Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Sat, 27 Nov 2010 17:38:56 -0200 Subject: drivers: 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 // --- drivers/mbmmodem/gprs-context.c | 6 +++--- drivers/mbmmodem/stk.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'drivers/mbmmodem') diff --git a/drivers/mbmmodem/gprs-context.c b/drivers/mbmmodem/gprs-context.c index 553b7fd1..0a1ca2c3 100644 --- a/drivers/mbmmodem/gprs-context.c +++ b/drivers/mbmmodem/gprs-context.c @@ -364,7 +364,7 @@ static void mbm_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; @@ -408,7 +408,7 @@ static void mbm_gprs_deactivate_primary(struct ofono_gprs_context *gc, DBG("cid %u", cid); - if (!cbd) + if (cbd == NULL) goto error; cbd->user = gc; @@ -471,7 +471,7 @@ static int mbm_gprs_context_probe(struct ofono_gprs_context *gc, DBG(""); 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/mbmmodem/stk.c b/drivers/mbmmodem/stk.c index 87a2dd0e..81c36dba 100644 --- a/drivers/mbmmodem/stk.c +++ b/drivers/mbmmodem/stk.c @@ -88,7 +88,7 @@ static void mbm_stk_envelope(struct ofono_stk *stk, int length, DBG(""); - if (!cbd || !buf) + if (cbd == NULL || buf == NULL) goto error; len = sprintf(buf, "AT*STKE=\""); @@ -134,7 +134,7 @@ static void mbm_stk_terminal_response(struct ofono_stk *stk, int length, DBG(""); - if (!cbd || !buf) + if (cbd == NULL || buf == NULL) goto error; len = sprintf(buf, "AT*STKR=\""); @@ -236,7 +236,7 @@ static int mbm_stk_probe(struct ofono_stk *stk, unsigned int vendor, void *data) DBG(""); sd = g_try_new0(struct stk_data, 1); - if (!sd) + if (sd == NULL) return -ENOMEM; sd->chat = g_at_chat_clone(chat); -- cgit v1.2.3