From 67f78f680d4b72d24a280be528a00778dcdf28dc Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Sat, 27 Nov 2010 17:39:02 -0200 Subject: plugins: 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 // --- plugins/hso.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'plugins/hso.c') diff --git a/plugins/hso.c b/plugins/hso.c index 055c63b3..e01ee870 100644 --- a/plugins/hso.c +++ b/plugins/hso.c @@ -63,7 +63,7 @@ static int hso_probe(struct ofono_modem *modem) DBG("%p", modem); data = g_try_new0(struct hso_data, 1); - if (!data) + if (data == NULL) return -ENOMEM; ofono_modem_set_data(modem, data); @@ -124,7 +124,7 @@ static GAtChat *create_port(const char *device) GAtChat *chat; channel = g_at_tty_open(device, NULL); - if (!channel) + if (channel == NULL) return NULL; syntax = g_at_syntax_new_gsm_permissive(); @@ -132,7 +132,7 @@ static GAtChat *create_port(const char *device) g_at_syntax_unref(syntax); g_io_channel_unref(channel); - if (!chat) + if (chat == NULL) return NULL; return chat; @@ -149,7 +149,7 @@ static int hso_enable(struct ofono_modem *modem) control = ofono_modem_get_string(modem, "ControlPort"); app = ofono_modem_get_string(modem, "ApplicationPort"); - if (!app || !control) + if (app == NULL || control == NULL) return -EINVAL; data->control = create_port(control); @@ -201,7 +201,7 @@ static int hso_disable(struct ofono_modem *modem) DBG("%p", modem); - if (!data->control) + if (data->control == NULL) return 0; g_at_chat_cancel_all(data->control); @@ -237,7 +237,7 @@ static void hso_set_online(struct ofono_modem *modem, ofono_bool_t online, DBG("modem %p %s", modem, online ? "online" : "offline"); - if (!cbd) + if (cbd == NULL) goto error; if (g_at_chat_send(chat, command, NULL, set_online_cb, cbd, g_free)) -- cgit v1.2.3