mirror of
https://github.com/sailfishos/ofono
synced 2025-12-02 07:31:04 +08:00
plugins: 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>
This commit is contained in:
committed by
Denis Kenzior
parent
521071a785
commit
67f78f680d
@@ -62,7 +62,7 @@ static int nokia_probe(struct ofono_modem *modem)
|
||||
DBG("%p", modem);
|
||||
|
||||
data = g_try_new0(struct nokia_data, 1);
|
||||
if (!data)
|
||||
if (data == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
ofono_modem_set_data(modem, data);
|
||||
@@ -106,7 +106,7 @@ static GAtChat *open_device(struct ofono_modem *modem,
|
||||
DBG("%s %s", key, device);
|
||||
|
||||
channel = g_at_tty_open(device, NULL);
|
||||
if (!channel)
|
||||
if (channel == NULL)
|
||||
return NULL;
|
||||
|
||||
syntax = g_at_syntax_new_gsm_permissive();
|
||||
@@ -114,7 +114,7 @@ static GAtChat *open_device(struct ofono_modem *modem,
|
||||
g_at_syntax_unref(syntax);
|
||||
g_io_channel_unref(channel);
|
||||
|
||||
if (!chat)
|
||||
if (chat == NULL)
|
||||
return NULL;
|
||||
|
||||
if (getenv("OFONO_AT_DEBUG"))
|
||||
@@ -137,7 +137,7 @@ static void nokia_disconnect(gpointer user_data)
|
||||
data->modem = NULL;
|
||||
|
||||
data->modem = open_device(modem, "Modem", "Modem: ");
|
||||
if (!data->modem)
|
||||
if (data->modem == NULL)
|
||||
return;
|
||||
|
||||
g_at_chat_set_disconnect_function(data->modem,
|
||||
@@ -216,7 +216,7 @@ static int nokia_disable(struct ofono_modem *modem)
|
||||
data->modem = NULL;
|
||||
}
|
||||
|
||||
if (!data->control)
|
||||
if (data->control == NULL)
|
||||
return 0;
|
||||
|
||||
g_at_chat_cancel_all(data->control);
|
||||
|
||||
Reference in New Issue
Block a user