all: remove redundant return-if-fail checks

NM_IS_FOO(x) returns FALSE if x is NULL, so we don't need a separate
(x != NULL) check before it.
This commit is contained in:
Dan Winship
2013-03-07 07:30:23 -05:00
parent 0006c6aa1d
commit 6f44b7f3c6
28 changed files with 0 additions and 162 deletions

View File

@@ -88,7 +88,6 @@ nm_device_modem_error_quark (void)
NMDeviceModemCapabilities NMDeviceModemCapabilities
nm_device_modem_get_modem_capabilities (NMDeviceModem *self) nm_device_modem_get_modem_capabilities (NMDeviceModem *self)
{ {
g_return_val_if_fail (self != NULL, NM_DEVICE_MODEM_CAPABILITY_NONE);
g_return_val_if_fail (NM_IS_DEVICE_MODEM (self), NM_DEVICE_MODEM_CAPABILITY_NONE); g_return_val_if_fail (NM_IS_DEVICE_MODEM (self), NM_DEVICE_MODEM_CAPABILITY_NONE);
_nm_object_ensure_inited (NM_OBJECT (self)); _nm_object_ensure_inited (NM_OBJECT (self));
@@ -109,7 +108,6 @@ nm_device_modem_get_modem_capabilities (NMDeviceModem *self)
NMDeviceModemCapabilities NMDeviceModemCapabilities
nm_device_modem_get_current_capabilities (NMDeviceModem *self) nm_device_modem_get_current_capabilities (NMDeviceModem *self)
{ {
g_return_val_if_fail (self != NULL, NM_DEVICE_MODEM_CAPABILITY_NONE);
g_return_val_if_fail (NM_IS_DEVICE_MODEM (self), NM_DEVICE_MODEM_CAPABILITY_NONE); g_return_val_if_fail (NM_IS_DEVICE_MODEM (self), NM_DEVICE_MODEM_CAPABILITY_NONE);
_nm_object_ensure_inited (NM_OBJECT (self)); _nm_object_ensure_inited (NM_OBJECT (self));

View File

@@ -130,7 +130,6 @@ nm_remote_connection_commit_changes (NMRemoteConnection *self,
GHashTable *settings = NULL; GHashTable *settings = NULL;
RemoteCall *call; RemoteCall *call;
g_return_if_fail (self != NULL);
g_return_if_fail (NM_IS_REMOTE_CONNECTION (self)); g_return_if_fail (NM_IS_REMOTE_CONNECTION (self));
g_return_if_fail (callback != NULL); g_return_if_fail (callback != NULL);
@@ -184,7 +183,6 @@ nm_remote_connection_delete (NMRemoteConnection *self,
NMRemoteConnectionPrivate *priv; NMRemoteConnectionPrivate *priv;
RemoteCall *call; RemoteCall *call;
g_return_if_fail (self != NULL);
g_return_if_fail (NM_IS_REMOTE_CONNECTION (self)); g_return_if_fail (NM_IS_REMOTE_CONNECTION (self));
priv = NM_REMOTE_CONNECTION_GET_PRIVATE (self); priv = NM_REMOTE_CONNECTION_GET_PRIVATE (self);
@@ -236,7 +234,6 @@ nm_remote_connection_get_secrets (NMRemoteConnection *self,
NMRemoteConnectionPrivate *priv; NMRemoteConnectionPrivate *priv;
RemoteCall *call; RemoteCall *call;
g_return_if_fail (self != NULL);
g_return_if_fail (NM_IS_REMOTE_CONNECTION (self)); g_return_if_fail (NM_IS_REMOTE_CONNECTION (self));
g_return_if_fail (callback != NULL); g_return_if_fail (callback != NULL);

View File

@@ -186,7 +186,6 @@ nm_remote_settings_get_connection_by_path (NMRemoteSettings *settings, const cha
{ {
NMRemoteSettingsPrivate *priv; NMRemoteSettingsPrivate *priv;
g_return_val_if_fail (settings != NULL, NULL);
g_return_val_if_fail (NM_IS_REMOTE_SETTINGS (settings), NULL); g_return_val_if_fail (NM_IS_REMOTE_SETTINGS (settings), NULL);
g_return_val_if_fail (path != NULL, NULL); g_return_val_if_fail (path != NULL, NULL);
@@ -214,7 +213,6 @@ nm_remote_settings_get_connection_by_uuid (NMRemoteSettings *settings, const cha
GHashTableIter iter; GHashTableIter iter;
NMRemoteConnection *candidate; NMRemoteConnection *candidate;
g_return_val_if_fail (settings != NULL, NULL);
g_return_val_if_fail (NM_IS_REMOTE_SETTINGS (settings), NULL); g_return_val_if_fail (NM_IS_REMOTE_SETTINGS (settings), NULL);
g_return_val_if_fail (uuid != NULL, NULL); g_return_val_if_fail (uuid != NULL, NULL);
@@ -500,7 +498,6 @@ nm_remote_settings_list_connections (NMRemoteSettings *settings)
GHashTableIter iter; GHashTableIter iter;
gpointer value; gpointer value;
g_return_val_if_fail (settings != NULL, NULL);
g_return_val_if_fail (NM_IS_REMOTE_SETTINGS (settings), NULL); g_return_val_if_fail (NM_IS_REMOTE_SETTINGS (settings), NULL);
priv = NM_REMOTE_SETTINGS_GET_PRIVATE (settings); priv = NM_REMOTE_SETTINGS_GET_PRIVATE (settings);
@@ -557,9 +554,7 @@ nm_remote_settings_add_connection (NMRemoteSettings *settings,
AddConnectionInfo *info; AddConnectionInfo *info;
GHashTable *new_settings; GHashTable *new_settings;
g_return_val_if_fail (settings != NULL, FALSE);
g_return_val_if_fail (NM_IS_REMOTE_SETTINGS (settings), FALSE); g_return_val_if_fail (NM_IS_REMOTE_SETTINGS (settings), FALSE);
g_return_val_if_fail (connection != NULL, FALSE);
g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE); g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE);
g_return_val_if_fail (callback != NULL, FALSE); g_return_val_if_fail (callback != NULL, FALSE);
@@ -663,7 +658,6 @@ nm_remote_settings_save_hostname (NMRemoteSettings *settings,
NMRemoteSettingsPrivate *priv; NMRemoteSettingsPrivate *priv;
SaveHostnameInfo *info; SaveHostnameInfo *info;
g_return_val_if_fail (settings != NULL, FALSE);
g_return_val_if_fail (NM_IS_REMOTE_SETTINGS (settings), FALSE); g_return_val_if_fail (NM_IS_REMOTE_SETTINGS (settings), FALSE);
g_return_val_if_fail (hostname != NULL, FALSE); g_return_val_if_fail (hostname != NULL, FALSE);
g_return_val_if_fail (callback != NULL, FALSE); g_return_val_if_fail (callback != NULL, FALSE);

View File

@@ -569,7 +569,6 @@ nm_secret_agent_register (NMSecretAgent *self)
NMSecretAgentPrivate *priv; NMSecretAgentPrivate *priv;
NMSecretAgentClass *class; NMSecretAgentClass *class;
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (NM_IS_SECRET_AGENT (self), FALSE); g_return_val_if_fail (NM_IS_SECRET_AGENT (self), FALSE);
priv = NM_SECRET_AGENT_GET_PRIVATE (self); priv = NM_SECRET_AGENT_GET_PRIVATE (self);
@@ -619,7 +618,6 @@ nm_secret_agent_unregister (NMSecretAgent *self)
{ {
NMSecretAgentPrivate *priv; NMSecretAgentPrivate *priv;
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (NM_IS_SECRET_AGENT (self), FALSE); g_return_val_if_fail (NM_IS_SECRET_AGENT (self), FALSE);
priv = NM_SECRET_AGENT_GET_PRIVATE (self); priv = NM_SECRET_AGENT_GET_PRIVATE (self);
@@ -645,7 +643,6 @@ nm_secret_agent_unregister (NMSecretAgent *self)
gboolean gboolean
nm_secret_agent_get_registered (NMSecretAgent *self) nm_secret_agent_get_registered (NMSecretAgent *self)
{ {
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (NM_IS_SECRET_AGENT (self), FALSE); g_return_val_if_fail (NM_IS_SECRET_AGENT (self), FALSE);
return NM_SECRET_AGENT_GET_PRIVATE (self)->registered; return NM_SECRET_AGENT_GET_PRIVATE (self)->registered;
@@ -692,9 +689,7 @@ nm_secret_agent_get_secrets (NMSecretAgent *self,
NMSecretAgentGetSecretsFunc callback, NMSecretAgentGetSecretsFunc callback,
gpointer user_data) gpointer user_data)
{ {
g_return_if_fail (self != NULL);
g_return_if_fail (NM_IS_SECRET_AGENT (self)); g_return_if_fail (NM_IS_SECRET_AGENT (self));
g_return_if_fail (connection != NULL);
g_return_if_fail (NM_IS_CONNECTION (connection)); g_return_if_fail (NM_IS_CONNECTION (connection));
g_return_if_fail (nm_connection_get_path (connection)); g_return_if_fail (nm_connection_get_path (connection));
g_return_if_fail (setting_name != NULL); g_return_if_fail (setting_name != NULL);
@@ -729,9 +724,7 @@ nm_secret_agent_save_secrets (NMSecretAgent *self,
NMSecretAgentSaveSecretsFunc callback, NMSecretAgentSaveSecretsFunc callback,
gpointer user_data) gpointer user_data)
{ {
g_return_if_fail (self != NULL);
g_return_if_fail (NM_IS_SECRET_AGENT (self)); g_return_if_fail (NM_IS_SECRET_AGENT (self));
g_return_if_fail (connection != NULL);
g_return_if_fail (NM_IS_CONNECTION (connection)); g_return_if_fail (NM_IS_CONNECTION (connection));
g_return_if_fail (nm_connection_get_path (connection)); g_return_if_fail (nm_connection_get_path (connection));
@@ -760,9 +753,7 @@ nm_secret_agent_delete_secrets (NMSecretAgent *self,
NMSecretAgentDeleteSecretsFunc callback, NMSecretAgentDeleteSecretsFunc callback,
gpointer user_data) gpointer user_data)
{ {
g_return_if_fail (self != NULL);
g_return_if_fail (NM_IS_SECRET_AGENT (self)); g_return_if_fail (NM_IS_SECRET_AGENT (self));
g_return_if_fail (connection != NULL);
g_return_if_fail (NM_IS_CONNECTION (connection)); g_return_if_fail (NM_IS_CONNECTION (connection));
g_return_if_fail (nm_connection_get_path (connection)); g_return_if_fail (nm_connection_get_path (connection));

View File

@@ -461,7 +461,6 @@ nm_connection_replace_settings (NMConnection *connection,
GHashTable *new_settings, GHashTable *new_settings,
GError **error) GError **error)
{ {
g_return_val_if_fail (connection != NULL, FALSE);
g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE); g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE);
g_return_val_if_fail (new_settings != NULL, FALSE); g_return_val_if_fail (new_settings != NULL, FALSE);
if (error) if (error)
@@ -600,7 +599,6 @@ nm_connection_diff (NMConnection *a,
{ {
GHashTable *diffs; GHashTable *diffs;
g_return_val_if_fail (a != NULL, FALSE);
g_return_val_if_fail (NM_IS_CONNECTION (a), FALSE); g_return_val_if_fail (NM_IS_CONNECTION (a), FALSE);
g_return_val_if_fail (out_settings != NULL, FALSE); g_return_val_if_fail (out_settings != NULL, FALSE);
g_return_val_if_fail (*out_settings == NULL, FALSE); g_return_val_if_fail (*out_settings == NULL, FALSE);
@@ -752,7 +750,6 @@ nm_connection_update_secrets (NMConnection *connection,
gboolean success; gboolean success;
GHashTable *tmp; GHashTable *tmp;
g_return_val_if_fail (connection != NULL, FALSE);
g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE); g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE);
g_return_val_if_fail (secrets != NULL, FALSE); g_return_val_if_fail (secrets != NULL, FALSE);
if (error) if (error)
@@ -848,7 +845,6 @@ nm_connection_need_secrets (NMConnection *connection,
const char *name = NULL; const char *name = NULL;
NMSetting *setting; NMSetting *setting;
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
if (hints) if (hints)
g_return_val_if_fail (*hints == NULL, NULL); g_return_val_if_fail (*hints == NULL, NULL);
@@ -953,7 +949,6 @@ nm_connection_to_hash (NMConnection *connection, NMSettingHashFlags flags)
gpointer key, data; gpointer key, data;
GHashTable *ret, *setting_hash; GHashTable *ret, *setting_hash;
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
ret = g_hash_table_new_full (g_str_hash, g_str_equal, ret = g_hash_table_new_full (g_str_hash, g_str_equal,
@@ -998,7 +993,6 @@ nm_connection_is_type (NMConnection *connection, const char *type)
NMSettingConnection *s_con; NMSettingConnection *s_con;
const char *type2; const char *type2;
g_return_val_if_fail (connection != NULL, FALSE);
g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE); g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE);
g_return_val_if_fail (type != NULL, FALSE); g_return_val_if_fail (type != NULL, FALSE);
@@ -1218,7 +1212,6 @@ nm_connection_get_uuid (NMConnection *connection)
{ {
NMSettingConnection *s_con; NMSettingConnection *s_con;
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
s_con = nm_connection_get_setting_connection (connection); s_con = nm_connection_get_setting_connection (connection);
@@ -1240,7 +1233,6 @@ nm_connection_get_id (NMConnection *connection)
{ {
NMSettingConnection *s_con; NMSettingConnection *s_con;
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
s_con = nm_connection_get_setting_connection (connection); s_con = nm_connection_get_setting_connection (connection);
@@ -1298,7 +1290,6 @@ nm_connection_get_carrier_detect (NMConnection *connection)
NMSetting8021x * NMSetting8021x *
nm_connection_get_setting_802_1x (NMConnection *connection) nm_connection_get_setting_802_1x (NMConnection *connection)
{ {
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
return (NMSetting8021x *) nm_connection_get_setting (connection, NM_TYPE_SETTING_802_1X); return (NMSetting8021x *) nm_connection_get_setting (connection, NM_TYPE_SETTING_802_1X);
@@ -1315,7 +1306,6 @@ nm_connection_get_setting_802_1x (NMConnection *connection)
NMSettingBluetooth * NMSettingBluetooth *
nm_connection_get_setting_bluetooth (NMConnection *connection) nm_connection_get_setting_bluetooth (NMConnection *connection)
{ {
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
return (NMSettingBluetooth *) nm_connection_get_setting (connection, NM_TYPE_SETTING_BLUETOOTH); return (NMSettingBluetooth *) nm_connection_get_setting (connection, NM_TYPE_SETTING_BLUETOOTH);
@@ -1332,7 +1322,6 @@ nm_connection_get_setting_bluetooth (NMConnection *connection)
NMSettingBond * NMSettingBond *
nm_connection_get_setting_bond (NMConnection *connection) nm_connection_get_setting_bond (NMConnection *connection)
{ {
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
return (NMSettingBond *) nm_connection_get_setting (connection, NM_TYPE_SETTING_BOND); return (NMSettingBond *) nm_connection_get_setting (connection, NM_TYPE_SETTING_BOND);
@@ -1349,7 +1338,6 @@ nm_connection_get_setting_bond (NMConnection *connection)
NMSettingBridge * NMSettingBridge *
nm_connection_get_setting_bridge (NMConnection *connection) nm_connection_get_setting_bridge (NMConnection *connection)
{ {
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
return (NMSettingBridge *) nm_connection_get_setting (connection, NM_TYPE_SETTING_BRIDGE); return (NMSettingBridge *) nm_connection_get_setting (connection, NM_TYPE_SETTING_BRIDGE);
@@ -1366,7 +1354,6 @@ nm_connection_get_setting_bridge (NMConnection *connection)
NMSettingCdma * NMSettingCdma *
nm_connection_get_setting_cdma (NMConnection *connection) nm_connection_get_setting_cdma (NMConnection *connection)
{ {
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
return (NMSettingCdma *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CDMA); return (NMSettingCdma *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CDMA);
@@ -1383,7 +1370,6 @@ nm_connection_get_setting_cdma (NMConnection *connection)
NMSettingConnection * NMSettingConnection *
nm_connection_get_setting_connection (NMConnection *connection) nm_connection_get_setting_connection (NMConnection *connection)
{ {
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
return (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION); return (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION);
@@ -1400,7 +1386,6 @@ nm_connection_get_setting_connection (NMConnection *connection)
NMSettingGsm * NMSettingGsm *
nm_connection_get_setting_gsm (NMConnection *connection) nm_connection_get_setting_gsm (NMConnection *connection)
{ {
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
return (NMSettingGsm *) nm_connection_get_setting (connection, NM_TYPE_SETTING_GSM); return (NMSettingGsm *) nm_connection_get_setting (connection, NM_TYPE_SETTING_GSM);
@@ -1417,7 +1402,6 @@ nm_connection_get_setting_gsm (NMConnection *connection)
NMSettingInfiniband * NMSettingInfiniband *
nm_connection_get_setting_infiniband (NMConnection *connection) nm_connection_get_setting_infiniband (NMConnection *connection)
{ {
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
return (NMSettingInfiniband *) nm_connection_get_setting (connection, NM_TYPE_SETTING_INFINIBAND); return (NMSettingInfiniband *) nm_connection_get_setting (connection, NM_TYPE_SETTING_INFINIBAND);
@@ -1434,7 +1418,6 @@ nm_connection_get_setting_infiniband (NMConnection *connection)
NMSettingIP4Config * NMSettingIP4Config *
nm_connection_get_setting_ip4_config (NMConnection *connection) nm_connection_get_setting_ip4_config (NMConnection *connection)
{ {
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
return (NMSettingIP4Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG); return (NMSettingIP4Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG);
@@ -1451,7 +1434,6 @@ nm_connection_get_setting_ip4_config (NMConnection *connection)
NMSettingIP6Config * NMSettingIP6Config *
nm_connection_get_setting_ip6_config (NMConnection *connection) nm_connection_get_setting_ip6_config (NMConnection *connection)
{ {
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
return (NMSettingIP6Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG); return (NMSettingIP6Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG);
@@ -1468,7 +1450,6 @@ nm_connection_get_setting_ip6_config (NMConnection *connection)
NMSettingOlpcMesh * NMSettingOlpcMesh *
nm_connection_get_setting_olpc_mesh (NMConnection *connection) nm_connection_get_setting_olpc_mesh (NMConnection *connection)
{ {
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
return (NMSettingOlpcMesh *) nm_connection_get_setting (connection, NM_TYPE_SETTING_OLPC_MESH); return (NMSettingOlpcMesh *) nm_connection_get_setting (connection, NM_TYPE_SETTING_OLPC_MESH);
@@ -1485,7 +1466,6 @@ nm_connection_get_setting_olpc_mesh (NMConnection *connection)
NMSettingPPP * NMSettingPPP *
nm_connection_get_setting_ppp (NMConnection *connection) nm_connection_get_setting_ppp (NMConnection *connection)
{ {
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
return (NMSettingPPP *) nm_connection_get_setting (connection, NM_TYPE_SETTING_PPP); return (NMSettingPPP *) nm_connection_get_setting (connection, NM_TYPE_SETTING_PPP);
@@ -1502,7 +1482,6 @@ nm_connection_get_setting_ppp (NMConnection *connection)
NMSettingPPPOE * NMSettingPPPOE *
nm_connection_get_setting_pppoe (NMConnection *connection) nm_connection_get_setting_pppoe (NMConnection *connection)
{ {
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
return (NMSettingPPPOE *) nm_connection_get_setting (connection, NM_TYPE_SETTING_PPPOE); return (NMSettingPPPOE *) nm_connection_get_setting (connection, NM_TYPE_SETTING_PPPOE);
@@ -1519,7 +1498,6 @@ nm_connection_get_setting_pppoe (NMConnection *connection)
NMSettingSerial * NMSettingSerial *
nm_connection_get_setting_serial (NMConnection *connection) nm_connection_get_setting_serial (NMConnection *connection)
{ {
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
return (NMSettingSerial *) nm_connection_get_setting (connection, NM_TYPE_SETTING_SERIAL); return (NMSettingSerial *) nm_connection_get_setting (connection, NM_TYPE_SETTING_SERIAL);
@@ -1536,7 +1514,6 @@ nm_connection_get_setting_serial (NMConnection *connection)
NMSettingVPN * NMSettingVPN *
nm_connection_get_setting_vpn (NMConnection *connection) nm_connection_get_setting_vpn (NMConnection *connection)
{ {
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
return (NMSettingVPN *) nm_connection_get_setting (connection, NM_TYPE_SETTING_VPN); return (NMSettingVPN *) nm_connection_get_setting (connection, NM_TYPE_SETTING_VPN);
@@ -1553,7 +1530,6 @@ nm_connection_get_setting_vpn (NMConnection *connection)
NMSettingWimax * NMSettingWimax *
nm_connection_get_setting_wimax (NMConnection *connection) nm_connection_get_setting_wimax (NMConnection *connection)
{ {
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
return (NMSettingWimax *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIMAX); return (NMSettingWimax *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIMAX);
@@ -1570,7 +1546,6 @@ nm_connection_get_setting_wimax (NMConnection *connection)
NMSettingWired * NMSettingWired *
nm_connection_get_setting_wired (NMConnection *connection) nm_connection_get_setting_wired (NMConnection *connection)
{ {
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
return (NMSettingWired *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED); return (NMSettingWired *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED);
@@ -1587,7 +1562,6 @@ nm_connection_get_setting_wired (NMConnection *connection)
NMSettingAdsl * NMSettingAdsl *
nm_connection_get_setting_adsl (NMConnection *connection) nm_connection_get_setting_adsl (NMConnection *connection)
{ {
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
return (NMSettingAdsl *) nm_connection_get_setting (connection, NM_TYPE_SETTING_ADSL); return (NMSettingAdsl *) nm_connection_get_setting (connection, NM_TYPE_SETTING_ADSL);
@@ -1604,7 +1578,6 @@ nm_connection_get_setting_adsl (NMConnection *connection)
NMSettingWireless * NMSettingWireless *
nm_connection_get_setting_wireless (NMConnection *connection) nm_connection_get_setting_wireless (NMConnection *connection)
{ {
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
return (NMSettingWireless *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS); return (NMSettingWireless *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS);
@@ -1621,7 +1594,6 @@ nm_connection_get_setting_wireless (NMConnection *connection)
NMSettingWirelessSecurity * NMSettingWirelessSecurity *
nm_connection_get_setting_wireless_security (NMConnection *connection) nm_connection_get_setting_wireless_security (NMConnection *connection)
{ {
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
return (NMSettingWirelessSecurity *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS_SECURITY); return (NMSettingWirelessSecurity *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS_SECURITY);
@@ -1638,7 +1610,6 @@ nm_connection_get_setting_wireless_security (NMConnection *connection)
NMSettingBridgePort * NMSettingBridgePort *
nm_connection_get_setting_bridge_port (NMConnection *connection) nm_connection_get_setting_bridge_port (NMConnection *connection)
{ {
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
return (NMSettingBridgePort *) nm_connection_get_setting (connection, NM_TYPE_SETTING_BRIDGE_PORT); return (NMSettingBridgePort *) nm_connection_get_setting (connection, NM_TYPE_SETTING_BRIDGE_PORT);
@@ -1655,7 +1626,6 @@ nm_connection_get_setting_bridge_port (NMConnection *connection)
NMSettingVlan * NMSettingVlan *
nm_connection_get_setting_vlan (NMConnection *connection) nm_connection_get_setting_vlan (NMConnection *connection)
{ {
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
return (NMSettingVlan *) nm_connection_get_setting (connection, NM_TYPE_SETTING_VLAN); return (NMSettingVlan *) nm_connection_get_setting (connection, NM_TYPE_SETTING_VLAN);

View File

@@ -275,7 +275,6 @@ nm_setting_vpn_foreach_data_item (NMSettingVPN *setting,
NMVPNIterFunc func, NMVPNIterFunc func,
gpointer user_data) gpointer user_data)
{ {
g_return_if_fail (setting != NULL);
g_return_if_fail (NM_IS_SETTING_VPN (setting)); g_return_if_fail (NM_IS_SETTING_VPN (setting));
foreach_item_helper (NM_SETTING_VPN_GET_PRIVATE (setting)->data, func, user_data); foreach_item_helper (NM_SETTING_VPN_GET_PRIVATE (setting)->data, func, user_data);
@@ -370,7 +369,6 @@ nm_setting_vpn_foreach_secret (NMSettingVPN *setting,
NMVPNIterFunc func, NMVPNIterFunc func,
gpointer user_data) gpointer user_data)
{ {
g_return_if_fail (setting != NULL);
g_return_if_fail (NM_IS_SETTING_VPN (setting)); g_return_if_fail (NM_IS_SETTING_VPN (setting));
foreach_item_helper (NM_SETTING_VPN_GET_PRIVATE (setting)->secrets, func, user_data); foreach_item_helper (NM_SETTING_VPN_GET_PRIVATE (setting)->secrets, func, user_data);

View File

@@ -104,7 +104,6 @@ nm_setting_to_hash (NMSetting *setting, NMSettingHashFlags flags)
guint n_property_specs; guint n_property_specs;
guint i; guint i;
g_return_val_if_fail (setting != NULL, NULL);
g_return_val_if_fail (NM_IS_SETTING (setting), NULL); g_return_val_if_fail (NM_IS_SETTING (setting), NULL);
property_specs = g_object_class_list_properties (G_OBJECT_GET_CLASS (setting), &n_property_specs); property_specs = g_object_class_list_properties (G_OBJECT_GET_CLASS (setting), &n_property_specs);
@@ -481,7 +480,6 @@ nm_setting_diff (NMSetting *a,
gboolean results_created = FALSE; gboolean results_created = FALSE;
g_return_val_if_fail (results != NULL, FALSE); g_return_val_if_fail (results != NULL, FALSE);
g_return_val_if_fail (a != NULL, FALSE);
g_return_val_if_fail (NM_IS_SETTING (a), FALSE); g_return_val_if_fail (NM_IS_SETTING (a), FALSE);
if (b) { if (b) {
g_return_val_if_fail (NM_IS_SETTING (b), FALSE); g_return_val_if_fail (NM_IS_SETTING (b), FALSE);
@@ -764,7 +762,6 @@ nm_setting_update_secrets (NMSetting *setting, GHashTable *secrets, GError **err
gpointer key, data; gpointer key, data;
GError *tmp_error = NULL; GError *tmp_error = NULL;
g_return_val_if_fail (setting != NULL, FALSE);
g_return_val_if_fail (NM_IS_SETTING (setting), FALSE); g_return_val_if_fail (NM_IS_SETTING (setting), FALSE);
g_return_val_if_fail (secrets != NULL, FALSE); g_return_val_if_fail (secrets != NULL, FALSE);
if (error) if (error)
@@ -851,7 +848,6 @@ nm_setting_get_secret_flags (NMSetting *setting,
NMSettingSecretFlags *out_flags, NMSettingSecretFlags *out_flags,
GError **error) GError **error)
{ {
g_return_val_if_fail (setting != NULL, FALSE);
g_return_val_if_fail (NM_IS_SETTING (setting), FALSE); g_return_val_if_fail (NM_IS_SETTING (setting), FALSE);
g_return_val_if_fail (secret_name != NULL, FALSE); g_return_val_if_fail (secret_name != NULL, FALSE);
@@ -895,7 +891,6 @@ nm_setting_set_secret_flags (NMSetting *setting,
NMSettingSecretFlags flags, NMSettingSecretFlags flags,
GError **error) GError **error)
{ {
g_return_val_if_fail (setting != NULL, FALSE);
g_return_val_if_fail (NM_IS_SETTING (setting), FALSE); g_return_val_if_fail (NM_IS_SETTING (setting), FALSE);
g_return_val_if_fail (secret_name != NULL, FALSE); g_return_val_if_fail (secret_name != NULL, FALSE);
g_return_val_if_fail (flags <= NM_SETTING_SECRET_FLAGS_ALL, FALSE); g_return_val_if_fail (flags <= NM_SETTING_SECRET_FLAGS_ALL, FALSE);

View File

@@ -80,7 +80,6 @@ enum {
GPid GPid
nm_dhcp_client_get_pid (NMDHCPClient *self) nm_dhcp_client_get_pid (NMDHCPClient *self)
{ {
g_return_val_if_fail (self != NULL, -1);
g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), -1); g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), -1);
return NM_DHCP_CLIENT_GET_PRIVATE (self)->pid; return NM_DHCP_CLIENT_GET_PRIVATE (self)->pid;
@@ -89,7 +88,6 @@ nm_dhcp_client_get_pid (NMDHCPClient *self)
const char * const char *
nm_dhcp_client_get_iface (NMDHCPClient *self) nm_dhcp_client_get_iface (NMDHCPClient *self)
{ {
g_return_val_if_fail (self != NULL, NULL);
g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), NULL); g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), NULL);
return NM_DHCP_CLIENT_GET_PRIVATE (self)->iface; return NM_DHCP_CLIENT_GET_PRIVATE (self)->iface;
@@ -98,7 +96,6 @@ nm_dhcp_client_get_iface (NMDHCPClient *self)
gboolean gboolean
nm_dhcp_client_get_ipv6 (NMDHCPClient *self) nm_dhcp_client_get_ipv6 (NMDHCPClient *self)
{ {
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), FALSE); g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), FALSE);
return NM_DHCP_CLIENT_GET_PRIVATE (self)->ipv6; return NM_DHCP_CLIENT_GET_PRIVATE (self)->ipv6;
@@ -107,7 +104,6 @@ nm_dhcp_client_get_ipv6 (NMDHCPClient *self)
const char * const char *
nm_dhcp_client_get_uuid (NMDHCPClient *self) nm_dhcp_client_get_uuid (NMDHCPClient *self)
{ {
g_return_val_if_fail (self != NULL, NULL);
g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), NULL); g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), NULL);
return NM_DHCP_CLIENT_GET_PRIVATE (self)->uuid; return NM_DHCP_CLIENT_GET_PRIVATE (self)->uuid;
@@ -188,7 +184,6 @@ stop (NMDHCPClient *self, gboolean release, const GByteArray *duid)
{ {
NMDHCPClientPrivate *priv; NMDHCPClientPrivate *priv;
g_return_if_fail (self != NULL);
g_return_if_fail (NM_IS_DHCP_CLIENT (self)); g_return_if_fail (NM_IS_DHCP_CLIENT (self));
priv = NM_DHCP_CLIENT_GET_PRIVATE (self); priv = NM_DHCP_CLIENT_GET_PRIVATE (self);
@@ -305,7 +300,6 @@ nm_dhcp_client_start_ip4 (NMDHCPClient *self,
{ {
NMDHCPClientPrivate *priv; NMDHCPClientPrivate *priv;
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), FALSE); g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), FALSE);
priv = NM_DHCP_CLIENT_GET_PRIVATE (self); priv = NM_DHCP_CLIENT_GET_PRIVATE (self);
@@ -457,7 +451,6 @@ nm_dhcp_client_start_ip6 (NMDHCPClient *self,
NMDHCPClientPrivate *priv; NMDHCPClientPrivate *priv;
char *escaped; char *escaped;
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), FALSE); g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), FALSE);
priv = NM_DHCP_CLIENT_GET_PRIVATE (self); priv = NM_DHCP_CLIENT_GET_PRIVATE (self);
@@ -534,7 +527,6 @@ nm_dhcp_client_stop (NMDHCPClient *self, gboolean release)
{ {
NMDHCPClientPrivate *priv; NMDHCPClientPrivate *priv;
g_return_if_fail (self != NULL);
g_return_if_fail (NM_IS_DHCP_CLIENT (self)); g_return_if_fail (NM_IS_DHCP_CLIENT (self));
priv = NM_DHCP_CLIENT_GET_PRIVATE (self); priv = NM_DHCP_CLIENT_GET_PRIVATE (self);
@@ -700,7 +692,6 @@ nm_dhcp_client_new_options (NMDHCPClient *self,
guint32 old_state; guint32 old_state;
guint32 new_state; guint32 new_state;
g_return_if_fail (self != NULL);
g_return_if_fail (NM_IS_DHCP_CLIENT (self)); g_return_if_fail (NM_IS_DHCP_CLIENT (self));
g_return_if_fail (options != NULL); g_return_if_fail (options != NULL);
g_return_if_fail (reason != NULL); g_return_if_fail (reason != NULL);
@@ -761,7 +752,6 @@ nm_dhcp_client_foreach_option (NMDHCPClient *self,
GHashTableIter iter; GHashTableIter iter;
gpointer iterkey, itervalue; gpointer iterkey, itervalue;
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), FALSE); g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), FALSE);
g_return_val_if_fail (func != NULL, FALSE); g_return_val_if_fail (func != NULL, FALSE);
@@ -1145,7 +1135,6 @@ ip4_options_to_config (NMDHCPClient *self)
char *str = NULL; char *str = NULL;
guint32 gwaddr = 0, prefix = 0; guint32 gwaddr = 0, prefix = 0;
g_return_val_if_fail (self != NULL, NULL);
g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), NULL); g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), NULL);
priv = NM_DHCP_CLIENT_GET_PRIVATE (self); priv = NM_DHCP_CLIENT_GET_PRIVATE (self);
@@ -1307,7 +1296,6 @@ nm_dhcp_client_get_ip4_config (NMDHCPClient *self, gboolean test)
{ {
NMDHCPClientPrivate *priv; NMDHCPClientPrivate *priv;
g_return_val_if_fail (self != NULL, NULL);
g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), NULL); g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), NULL);
priv = NM_DHCP_CLIENT_GET_PRIVATE (self); priv = NM_DHCP_CLIENT_GET_PRIVATE (self);
@@ -1345,7 +1333,6 @@ ip6_options_to_config (NMDHCPClient *self)
GHashTableIter iter; GHashTableIter iter;
gpointer key, value; gpointer key, value;
g_return_val_if_fail (self != NULL, NULL);
g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), NULL); g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), NULL);
priv = NM_DHCP_CLIENT_GET_PRIVATE (self); priv = NM_DHCP_CLIENT_GET_PRIVATE (self);
@@ -1415,7 +1402,6 @@ nm_dhcp_client_get_ip6_config (NMDHCPClient *self, gboolean test)
{ {
NMDHCPClientPrivate *priv; NMDHCPClientPrivate *priv;
g_return_val_if_fail (self != NULL, NULL);
g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), NULL); g_return_val_if_fail (NM_IS_DHCP_CLIENT (self), NULL);
priv = NM_DHCP_CLIENT_GET_PRIVATE (self); priv = NM_DHCP_CLIENT_GET_PRIVATE (self);

View File

@@ -119,7 +119,6 @@ get_client_for_pid (NMDHCPManager *manager, GPid pid)
GHashTableIter iter; GHashTableIter iter;
gpointer value; gpointer value;
g_return_val_if_fail (manager != NULL, NULL);
g_return_val_if_fail (NM_IS_DHCP_MANAGER (manager), NULL); g_return_val_if_fail (NM_IS_DHCP_MANAGER (manager), NULL);
priv = NM_DHCP_MANAGER_GET_PRIVATE (manager); priv = NM_DHCP_MANAGER_GET_PRIVATE (manager);
@@ -144,7 +143,6 @@ get_client_for_iface (NMDHCPManager *manager,
GHashTableIter iter; GHashTableIter iter;
gpointer value; gpointer value;
g_return_val_if_fail (manager != NULL, NULL);
g_return_val_if_fail (NM_IS_DHCP_MANAGER (manager), NULL); g_return_val_if_fail (NM_IS_DHCP_MANAGER (manager), NULL);
g_return_val_if_fail (iface, NULL); g_return_val_if_fail (iface, NULL);
@@ -553,7 +551,6 @@ nm_dhcp_manager_get_lease_config (NMDHCPManager *self,
const char *uuid, const char *uuid,
gboolean ipv6) gboolean ipv6)
{ {
g_return_val_if_fail (self != NULL, NULL);
g_return_val_if_fail (NM_IS_DHCP_MANAGER (self), NULL); g_return_val_if_fail (NM_IS_DHCP_MANAGER (self), NULL);
g_return_val_if_fail (iface != NULL, NULL); g_return_val_if_fail (iface != NULL, NULL);
g_return_val_if_fail (uuid != NULL, NULL); g_return_val_if_fail (uuid != NULL, NULL);

View File

@@ -175,7 +175,6 @@ nm_firewall_manager_remove_from_zone (NMFirewallManager *self,
void nm_firewall_manager_cancel_call (NMFirewallManager *self, gpointer call) void nm_firewall_manager_cancel_call (NMFirewallManager *self, gpointer call)
{ {
g_return_if_fail (self != NULL);
g_return_if_fail (NM_IS_FIREWALL_MANAGER (self)); g_return_if_fail (NM_IS_FIREWALL_MANAGER (self));
dbus_g_proxy_cancel_call (NM_FIREWALL_MANAGER_GET_PRIVATE (self)->proxy, dbus_g_proxy_cancel_call (NM_FIREWALL_MANAGER_GET_PRIVATE (self)->proxy,
(DBusGProxyCall *) call); (DBusGProxyCall *) call);

View File

@@ -223,7 +223,6 @@ nm_ip6_manager_get_device (NMIP6Manager *manager, int ifindex)
{ {
NMIP6ManagerPrivate *priv; NMIP6ManagerPrivate *priv;
g_return_val_if_fail (manager != NULL, NULL);
g_return_val_if_fail (NM_IS_IP6_MANAGER (manager), NULL); g_return_val_if_fail (NM_IS_IP6_MANAGER (manager), NULL);
priv = NM_IP6_MANAGER_GET_PRIVATE (manager); priv = NM_IP6_MANAGER_GET_PRIVATE (manager);

View File

@@ -237,9 +237,7 @@ static_stage3_ip4_config_start (NMModem *self,
{ {
NMModemGenericPrivate *priv; NMModemGenericPrivate *priv;
g_return_val_if_fail (self != NULL, NM_ACT_STAGE_RETURN_FAILURE);
g_return_val_if_fail (NM_IS_MODEM (self), NM_ACT_STAGE_RETURN_FAILURE); g_return_val_if_fail (NM_IS_MODEM (self), NM_ACT_STAGE_RETURN_FAILURE);
g_return_val_if_fail (req != NULL, NM_ACT_STAGE_RETURN_FAILURE);
g_return_val_if_fail (NM_IS_ACT_REQUEST (req), NM_ACT_STAGE_RETURN_FAILURE); g_return_val_if_fail (NM_IS_ACT_REQUEST (req), NM_ACT_STAGE_RETURN_FAILURE);
g_return_val_if_fail (reason != NULL, NM_ACT_STAGE_RETURN_FAILURE); g_return_val_if_fail (reason != NULL, NM_ACT_STAGE_RETURN_FAILURE);

View File

@@ -172,7 +172,6 @@ ask_for_pin (NMModemGsm *self, gboolean always_ask)
NMModemGsmPrivate *priv; NMModemGsmPrivate *priv;
guint32 tries = 0; guint32 tries = 0;
g_return_if_fail (self != NULL);
g_return_if_fail (NM_IS_MODEM_GSM (self)); g_return_if_fail (NM_IS_MODEM_GSM (self));
priv = NM_MODEM_GSM_GET_PRIVATE (self); priv = NM_MODEM_GSM_GET_PRIVATE (self);
@@ -241,7 +240,6 @@ do_enable (NMModemGsm *self)
{ {
DBusGProxy *proxy; DBusGProxy *proxy;
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (NM_IS_MODEM_GSM (self), FALSE); g_return_val_if_fail (NM_IS_MODEM_GSM (self), FALSE);
NM_MODEM_GSM_GET_PRIVATE (self)->enable_delay_id = 0; NM_MODEM_GSM_GET_PRIVATE (self)->enable_delay_id = 0;

View File

@@ -218,9 +218,7 @@ ppp_stage3_ip4_config_start (NMModem *self,
NMActStageReturn ret; NMActStageReturn ret;
guint ip_timeout = 20; guint ip_timeout = 20;
g_return_val_if_fail (self != NULL, NM_ACT_STAGE_RETURN_FAILURE);
g_return_val_if_fail (NM_IS_MODEM (self), NM_ACT_STAGE_RETURN_FAILURE); g_return_val_if_fail (NM_IS_MODEM (self), NM_ACT_STAGE_RETURN_FAILURE);
g_return_val_if_fail (req != NULL, NM_ACT_STAGE_RETURN_FAILURE);
g_return_val_if_fail (NM_IS_ACT_REQUEST (req), NM_ACT_STAGE_RETURN_FAILURE); g_return_val_if_fail (NM_IS_ACT_REQUEST (req), NM_ACT_STAGE_RETURN_FAILURE);
g_return_val_if_fail (reason != NULL, NM_ACT_STAGE_RETURN_FAILURE); g_return_val_if_fail (reason != NULL, NM_ACT_STAGE_RETURN_FAILURE);
@@ -281,11 +279,8 @@ nm_modem_stage3_ip4_config_start (NMModem *self,
NMActRequest *req; NMActRequest *req;
NMActStageReturn ret; NMActStageReturn ret;
g_return_val_if_fail (self != NULL, NM_ACT_STAGE_RETURN_FAILURE);
g_return_val_if_fail (NM_IS_MODEM (self), NM_ACT_STAGE_RETURN_FAILURE); g_return_val_if_fail (NM_IS_MODEM (self), NM_ACT_STAGE_RETURN_FAILURE);
g_return_val_if_fail (device != NULL, NM_ACT_STAGE_RETURN_FAILURE);
g_return_val_if_fail (NM_IS_DEVICE (device), NM_ACT_STAGE_RETURN_FAILURE); g_return_val_if_fail (NM_IS_DEVICE (device), NM_ACT_STAGE_RETURN_FAILURE);
g_return_val_if_fail (device_class != NULL, NM_ACT_STAGE_RETURN_FAILURE);
g_return_val_if_fail (NM_IS_DEVICE_CLASS (device_class), NM_ACT_STAGE_RETURN_FAILURE); g_return_val_if_fail (NM_IS_DEVICE_CLASS (device_class), NM_ACT_STAGE_RETURN_FAILURE);
g_return_val_if_fail (reason != NULL, NM_ACT_STAGE_RETURN_FAILURE); g_return_val_if_fail (reason != NULL, NM_ACT_STAGE_RETURN_FAILURE);
@@ -523,9 +518,7 @@ deactivate (NMModem *self, NMDevice *device)
NMModemPrivate *priv; NMModemPrivate *priv;
int ifindex; int ifindex;
g_return_if_fail (self != NULL);
g_return_if_fail (NM_IS_MODEM (self)); g_return_if_fail (NM_IS_MODEM (self));
g_return_if_fail (device != NULL);
g_return_if_fail (NM_IS_DEVICE (device)); g_return_if_fail (NM_IS_DEVICE (device));
priv = NM_MODEM_GET_PRIVATE (self); priv = NM_MODEM_GET_PRIVATE (self);
@@ -586,7 +579,6 @@ nm_modem_device_state_changed (NMModem *self,
gboolean was_connected = FALSE, warn = TRUE; gboolean was_connected = FALSE, warn = TRUE;
NMModemPrivate *priv; NMModemPrivate *priv;
g_return_if_fail (self != NULL);
g_return_if_fail (NM_IS_MODEM (self)); g_return_if_fail (NM_IS_MODEM (self));
if (old_state >= NM_DEVICE_STATE_PREPARE && old_state <= NM_DEVICE_STATE_ACTIVATED) if (old_state >= NM_DEVICE_STATE_PREPARE && old_state <= NM_DEVICE_STATE_ACTIVATED)
@@ -629,7 +621,6 @@ nm_modem_device_state_changed (NMModem *self,
const char * const char *
nm_modem_get_uid (NMModem *self) nm_modem_get_uid (NMModem *self)
{ {
g_return_val_if_fail (self != NULL, NULL);
g_return_val_if_fail (NM_IS_MODEM (self), NULL); g_return_val_if_fail (NM_IS_MODEM (self), NULL);
return NM_MODEM_GET_PRIVATE (self)->uid; return NM_MODEM_GET_PRIVATE (self)->uid;
@@ -638,7 +629,6 @@ nm_modem_get_uid (NMModem *self)
const char * const char *
nm_modem_get_path (NMModem *self) nm_modem_get_path (NMModem *self)
{ {
g_return_val_if_fail (self != NULL, NULL);
g_return_val_if_fail (NM_IS_MODEM (self), NULL); g_return_val_if_fail (NM_IS_MODEM (self), NULL);
return NM_MODEM_GET_PRIVATE (self)->path; return NM_MODEM_GET_PRIVATE (self)->path;
@@ -647,7 +637,6 @@ nm_modem_get_path (NMModem *self)
const char * const char *
nm_modem_get_control_port (NMModem *self) nm_modem_get_control_port (NMModem *self)
{ {
g_return_val_if_fail (self != NULL, NULL);
g_return_val_if_fail (NM_IS_MODEM (self), NULL); g_return_val_if_fail (NM_IS_MODEM (self), NULL);
return NM_MODEM_GET_PRIVATE (self)->control_port; return NM_MODEM_GET_PRIVATE (self)->control_port;
@@ -656,7 +645,6 @@ nm_modem_get_control_port (NMModem *self)
const char * const char *
nm_modem_get_data_port (NMModem *self) nm_modem_get_data_port (NMModem *self)
{ {
g_return_val_if_fail (self != NULL, NULL);
g_return_val_if_fail (NM_IS_MODEM (self), NULL); g_return_val_if_fail (NM_IS_MODEM (self), NULL);
/* The ppp_iface takes precedence over the data interface when PPP is used, /* The ppp_iface takes precedence over the data interface when PPP is used,

View File

@@ -112,7 +112,6 @@ nm_bt_error_quark (void)
guint32 nm_device_bt_get_capabilities (NMDeviceBt *self) guint32 nm_device_bt_get_capabilities (NMDeviceBt *self)
{ {
g_return_val_if_fail (self != NULL, NM_BT_CAPABILITY_NONE);
g_return_val_if_fail (NM_IS_DEVICE_BT (self), NM_BT_CAPABILITY_NONE); g_return_val_if_fail (NM_IS_DEVICE_BT (self), NM_BT_CAPABILITY_NONE);
return NM_DEVICE_BT_GET_PRIVATE (self)->capabilities; return NM_DEVICE_BT_GET_PRIVATE (self)->capabilities;
@@ -616,9 +615,7 @@ nm_device_bt_modem_added (NMDeviceBt *self,
NMDeviceState state; NMDeviceState state;
NMDeviceStateReason reason = NM_DEVICE_STATE_REASON_NONE; NMDeviceStateReason reason = NM_DEVICE_STATE_REASON_NONE;
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (NM_IS_DEVICE_BT (self), FALSE); g_return_val_if_fail (NM_IS_DEVICE_BT (self), FALSE);
g_return_val_if_fail (modem != NULL, FALSE);
g_return_val_if_fail (NM_IS_MODEM (modem), FALSE); g_return_val_if_fail (NM_IS_MODEM (modem), FALSE);
priv = NM_DEVICE_BT_GET_PRIVATE (self); priv = NM_DEVICE_BT_GET_PRIVATE (self);
@@ -691,9 +688,7 @@ nm_device_bt_modem_removed (NMDeviceBt *self, NMModem *modem)
NMDeviceBtPrivate *priv; NMDeviceBtPrivate *priv;
NMDeviceState state; NMDeviceState state;
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (NM_IS_DEVICE_BT (self), FALSE); g_return_val_if_fail (NM_IS_DEVICE_BT (self), FALSE);
g_return_val_if_fail (modem != NULL, FALSE);
g_return_val_if_fail (NM_IS_MODEM (modem), FALSE); g_return_val_if_fail (NM_IS_MODEM (modem), FALSE);
priv = NM_DEVICE_BT_GET_PRIVATE (self); priv = NM_DEVICE_BT_GET_PRIVATE (self);

View File

@@ -196,7 +196,6 @@ modem_connected_cb (NMModem *modem, GParamSpec *pspec, gpointer user_data)
NMModem * NMModem *
nm_device_modem_get_modem (NMDeviceModem *self) nm_device_modem_get_modem (NMDeviceModem *self)
{ {
g_return_val_if_fail (self != NULL, NULL);
g_return_val_if_fail (NM_IS_DEVICE_MODEM (self), NULL); g_return_val_if_fail (NM_IS_DEVICE_MODEM (self), NULL);
return NM_DEVICE_MODEM_GET_PRIVATE (self)->modem; return NM_DEVICE_MODEM_GET_PRIVATE (self)->modem;
@@ -350,7 +349,6 @@ nm_device_modem_new (NMModem *modem, const char *driver)
const gchar *type_desc = NULL; const gchar *type_desc = NULL;
const gchar *ip_iface = NULL; const gchar *ip_iface = NULL;
g_return_val_if_fail (modem != NULL, NULL);
g_return_val_if_fail (NM_IS_MODEM (modem), NULL); g_return_val_if_fail (NM_IS_MODEM (modem), NULL);
g_return_val_if_fail (driver != NULL, NULL); g_return_val_if_fail (driver != NULL, NULL);

View File

@@ -322,7 +322,6 @@ update_accept_ra_save (NMDevice *self)
const char *ip_iface; const char *ip_iface;
char *new_path; char *new_path;
g_return_if_fail (self != NULL);
g_return_if_fail (NM_IS_DEVICE (self)); g_return_if_fail (NM_IS_DEVICE (self));
priv = NM_DEVICE_GET_PRIVATE (self); priv = NM_DEVICE_GET_PRIVATE (self);
@@ -358,7 +357,6 @@ update_ip6_privacy_save (NMDevice *self)
const char *ip_iface; const char *ip_iface;
char *new_path; char *new_path;
g_return_if_fail (self != NULL);
g_return_if_fail (NM_IS_DEVICE (self)); g_return_if_fail (NM_IS_DEVICE (self));
priv = NM_DEVICE_GET_PRIVATE (self); priv = NM_DEVICE_GET_PRIVATE (self);
@@ -625,7 +623,6 @@ nm_device_set_ip_iface (NMDevice *self, const char *iface)
const guint8 * const guint8 *
nm_device_get_hw_address (NMDevice *dev, guint *out_len) nm_device_get_hw_address (NMDevice *dev, guint *out_len)
{ {
g_return_val_if_fail (dev != NULL, NULL);
g_return_val_if_fail (NM_IS_DEVICE (dev), NULL); g_return_val_if_fail (NM_IS_DEVICE (dev), NULL);
g_return_val_if_fail (out_len != NULL, NULL); g_return_val_if_fail (out_len != NULL, NULL);
g_return_val_if_fail (*out_len == 0, NULL); g_return_val_if_fail (*out_len == 0, NULL);
@@ -768,7 +765,6 @@ nm_device_set_connection_provider (NMDevice *device,
NMDevicePrivate *priv; NMDevicePrivate *priv;
g_return_if_fail (device != NULL); g_return_if_fail (device != NULL);
g_return_if_fail (provider != NULL);
g_return_if_fail (NM_IS_CONNECTION_PROVIDER (provider)); g_return_if_fail (NM_IS_CONNECTION_PROVIDER (provider));
priv = NM_DEVICE_GET_PRIVATE (device); priv = NM_DEVICE_GET_PRIVATE (device);
@@ -1321,7 +1317,6 @@ nm_device_has_available_connection (NMDevice *self)
gboolean gboolean
nm_device_get_enabled (NMDevice *self) nm_device_get_enabled (NMDevice *self)
{ {
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (NM_IS_DEVICE (self), FALSE); g_return_val_if_fail (NM_IS_DEVICE (self), FALSE);
if (NM_DEVICE_GET_CLASS (self)->get_enabled) if (NM_DEVICE_GET_CLASS (self)->get_enabled)
@@ -1332,7 +1327,6 @@ nm_device_get_enabled (NMDevice *self)
void void
nm_device_set_enabled (NMDevice *self, gboolean enabled) nm_device_set_enabled (NMDevice *self, gboolean enabled)
{ {
g_return_if_fail (self != NULL);
g_return_if_fail (NM_IS_DEVICE (self)); g_return_if_fail (NM_IS_DEVICE (self));
if (NM_DEVICE_GET_CLASS (self)->set_enabled) if (NM_DEVICE_GET_CLASS (self)->set_enabled)
@@ -1342,7 +1336,6 @@ nm_device_set_enabled (NMDevice *self, gboolean enabled)
RfKillType RfKillType
nm_device_get_rfkill_type (NMDevice *self) nm_device_get_rfkill_type (NMDevice *self)
{ {
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (NM_IS_DEVICE (self), FALSE); g_return_val_if_fail (NM_IS_DEVICE (self), FALSE);
return NM_DEVICE_GET_PRIVATE (self)->rfkill_type; return NM_DEVICE_GET_PRIVATE (self)->rfkill_type;
@@ -1472,9 +1465,7 @@ nm_device_check_connection_compatible (NMDevice *device,
NMConnection *connection, NMConnection *connection,
GError **error) GError **error)
{ {
g_return_val_if_fail (device != NULL, FALSE);
g_return_val_if_fail (NM_IS_DEVICE (device), FALSE); g_return_val_if_fail (NM_IS_DEVICE (device), FALSE);
g_return_val_if_fail (connection != NULL, FALSE);
g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE); g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE);
if (NM_DEVICE_GET_CLASS (device)->check_connection_compatible) if (NM_DEVICE_GET_CLASS (device)->check_connection_compatible)
@@ -1485,7 +1476,6 @@ nm_device_check_connection_compatible (NMDevice *device,
gboolean gboolean
nm_device_can_assume_connections (NMDevice *device) nm_device_can_assume_connections (NMDevice *device)
{ {
g_return_val_if_fail (device != NULL, FALSE);
g_return_val_if_fail (NM_IS_DEVICE (device), FALSE); g_return_val_if_fail (NM_IS_DEVICE (device), FALSE);
return !!NM_DEVICE_GET_CLASS (device)->connection_match_config; return !!NM_DEVICE_GET_CLASS (device)->connection_match_config;
@@ -3903,7 +3893,6 @@ nm_device_deactivate (NMDevice *self, NMDeviceStateReason reason)
gboolean tried_ipv6 = FALSE; gboolean tried_ipv6 = FALSE;
int ifindex, family; int ifindex, family;
g_return_if_fail (self != NULL);
g_return_if_fail (NM_IS_DEVICE (self)); g_return_if_fail (NM_IS_DEVICE (self));
nm_log_info (LOGD_DEVICE, "(%s): deactivating device (reason '%s') [%d]", nm_log_info (LOGD_DEVICE, "(%s): deactivating device (reason '%s') [%d]",
@@ -4040,9 +4029,7 @@ nm_device_activate (NMDevice *self, NMActRequest *req)
NMDevicePrivate *priv; NMDevicePrivate *priv;
NMConnection *connection; NMConnection *connection;
g_return_if_fail (self != NULL);
g_return_if_fail (NM_IS_DEVICE (self)); g_return_if_fail (NM_IS_DEVICE (self));
g_return_if_fail (req != NULL);
g_return_if_fail (NM_IS_ACT_REQUEST (req)); g_return_if_fail (NM_IS_ACT_REQUEST (req));
priv = NM_DEVICE_GET_PRIVATE (self); priv = NM_DEVICE_GET_PRIVATE (self);
@@ -4135,7 +4122,6 @@ nm_device_can_interrupt_activation (NMDevice *self)
NMDHCP4Config * NMDHCP4Config *
nm_device_get_dhcp4_config (NMDevice *self) nm_device_get_dhcp4_config (NMDevice *self)
{ {
g_return_val_if_fail (self != NULL, NULL);
g_return_val_if_fail (NM_IS_DEVICE (self), NULL); g_return_val_if_fail (NM_IS_DEVICE (self), NULL);
return NM_DEVICE_GET_PRIVATE (self)->dhcp4_config; return NM_DEVICE_GET_PRIVATE (self)->dhcp4_config;
@@ -4144,7 +4130,6 @@ nm_device_get_dhcp4_config (NMDevice *self)
NMIP4Config * NMIP4Config *
nm_device_get_ip4_config (NMDevice *self) nm_device_get_ip4_config (NMDevice *self)
{ {
g_return_val_if_fail (self != NULL, NULL);
g_return_val_if_fail (NM_IS_DEVICE (self), NULL); g_return_val_if_fail (NM_IS_DEVICE (self), NULL);
return NM_DEVICE_GET_PRIVATE (self)->ip4_config; return NM_DEVICE_GET_PRIVATE (self)->ip4_config;
@@ -4262,7 +4247,6 @@ nm_device_set_ip6_config (NMDevice *self,
NMDHCP6Config * NMDHCP6Config *
nm_device_get_dhcp6_config (NMDevice *self) nm_device_get_dhcp6_config (NMDevice *self)
{ {
g_return_val_if_fail (self != NULL, NULL);
g_return_val_if_fail (NM_IS_DEVICE (self), NULL); g_return_val_if_fail (NM_IS_DEVICE (self), NULL);
return NM_DEVICE_GET_PRIVATE (self)->dhcp6_config; return NM_DEVICE_GET_PRIVATE (self)->dhcp6_config;
@@ -4271,7 +4255,6 @@ nm_device_get_dhcp6_config (NMDevice *self)
NMIP6Config * NMIP6Config *
nm_device_get_ip6_config (NMDevice *self) nm_device_get_ip6_config (NMDevice *self)
{ {
g_return_val_if_fail (self != NULL, NULL);
g_return_val_if_fail (NM_IS_DEVICE (self), NULL); g_return_val_if_fail (NM_IS_DEVICE (self), NULL);
return NM_DEVICE_GET_PRIVATE (self)->ip6_config; return NM_DEVICE_GET_PRIVATE (self)->ip6_config;
@@ -5015,7 +4998,6 @@ nm_device_set_firmware_missing (NMDevice *self, gboolean new_missing)
{ {
NMDevicePrivate *priv; NMDevicePrivate *priv;
g_return_if_fail (self != NULL);
g_return_if_fail (NM_IS_DEVICE (self)); g_return_if_fail (NM_IS_DEVICE (self));
priv = NM_DEVICE_GET_PRIVATE (self); priv = NM_DEVICE_GET_PRIVATE (self);
@@ -5389,7 +5371,6 @@ nm_device_queue_state (NMDevice *self,
{ {
NMDevicePrivate *priv; NMDevicePrivate *priv;
g_return_if_fail (self != NULL);
g_return_if_fail (NM_IS_DEVICE (self)); g_return_if_fail (NM_IS_DEVICE (self));
priv = NM_DEVICE_GET_PRIVATE (self); priv = NM_DEVICE_GET_PRIVATE (self);
@@ -5414,7 +5395,6 @@ nm_device_queued_state_peek (NMDevice *self)
{ {
NMDevicePrivate *priv; NMDevicePrivate *priv;
g_return_val_if_fail (self != NULL, NM_DEVICE_STATE_UNKNOWN);
g_return_val_if_fail (NM_IS_DEVICE (self), NM_DEVICE_STATE_UNKNOWN); g_return_val_if_fail (NM_IS_DEVICE (self), NM_DEVICE_STATE_UNKNOWN);
priv = NM_DEVICE_GET_PRIVATE (self); priv = NM_DEVICE_GET_PRIVATE (self);
@@ -5481,7 +5461,6 @@ nm_device_set_managed (NMDevice *device,
gboolean gboolean
nm_device_spec_match_list (NMDevice *device, const GSList *specs) nm_device_spec_match_list (NMDevice *device, const GSList *specs)
{ {
g_return_val_if_fail (device != NULL, FALSE);
g_return_val_if_fail (NM_IS_DEVICE (device), FALSE); g_return_val_if_fail (NM_IS_DEVICE (device), FALSE);
if (NM_DEVICE_GET_CLASS (device)->spec_match_list) if (NM_DEVICE_GET_CLASS (device)->spec_match_list)
@@ -5583,7 +5562,6 @@ nm_device_match_ip_config (NMDevice *device, NMConnection *connection)
NMConnection * NMConnection *
nm_device_connection_match_config (NMDevice *device, const GSList *connections) nm_device_connection_match_config (NMDevice *device, const GSList *connections)
{ {
g_return_val_if_fail (device != NULL, NULL);
g_return_val_if_fail (NM_IS_DEVICE (device), NULL); g_return_val_if_fail (NM_IS_DEVICE (device), NULL);
if (NM_DEVICE_GET_CLASS (device)->connection_match_config) if (NM_DEVICE_GET_CLASS (device)->connection_match_config)
@@ -5616,7 +5594,6 @@ nm_device_hwaddr_matches (NMDevice *device,
guint other_hwaddr_len, guint other_hwaddr_len,
gboolean fail_if_no_hwaddr) gboolean fail_if_no_hwaddr)
{ {
g_return_val_if_fail (device != NULL, FALSE);
g_return_val_if_fail (NM_IS_DEVICE (device), FALSE); g_return_val_if_fail (NM_IS_DEVICE (device), FALSE);
if (other_hwaddr) if (other_hwaddr)
g_return_val_if_fail (other_hwaddr_len > 0, FALSE); g_return_val_if_fail (other_hwaddr_len > 0, FALSE);
@@ -5721,7 +5698,6 @@ nm_device_recheck_available_connections (NMDevice *device)
NMDevicePrivate *priv; NMDevicePrivate *priv;
const GSList *connections, *iter; const GSList *connections, *iter;
g_return_if_fail (device != NULL);
g_return_if_fail (NM_IS_DEVICE (device)); g_return_if_fail (NM_IS_DEVICE (device));
priv = NM_DEVICE_GET_PRIVATE(device); priv = NM_DEVICE_GET_PRIVATE(device);

View File

@@ -471,7 +471,6 @@ error:
static gboolean static gboolean
open_connection (NMNetlinkMonitor *self, GError **error) open_connection (NMNetlinkMonitor *self, GError **error)
{ {
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (NM_IS_NETLINK_MONITOR (self), FALSE); g_return_val_if_fail (NM_IS_NETLINK_MONITOR (self), FALSE);
if (!event_connection_setup (self, error)) if (!event_connection_setup (self, error))
@@ -558,7 +557,6 @@ nm_netlink_monitor_request_ip6_info (NMNetlinkMonitor *self, GError **error)
{ {
NMNetlinkMonitorPrivate *priv; NMNetlinkMonitorPrivate *priv;
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (NM_IS_NETLINK_MONITOR (self), FALSE); g_return_val_if_fail (NM_IS_NETLINK_MONITOR (self), FALSE);
priv = NM_NETLINK_MONITOR_GET_PRIVATE (self); priv = NM_NETLINK_MONITOR_GET_PRIVATE (self);
@@ -635,7 +633,6 @@ nm_netlink_monitor_get_flags_sync (NMNetlinkMonitor *self,
struct rtnl_link *filter; struct rtnl_link *filter;
int err; int err;
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (NM_IS_NETLINK_MONITOR (self), FALSE); g_return_val_if_fail (NM_IS_NETLINK_MONITOR (self), FALSE);
g_return_val_if_fail (ifflags != NULL, FALSE); g_return_val_if_fail (ifflags != NULL, FALSE);

View File

@@ -91,7 +91,6 @@ get_best_ip4_device (NMManager *manager)
NMDevice *best = NULL; NMDevice *best = NULL;
int best_prio = G_MAXINT; int best_prio = G_MAXINT;
g_return_val_if_fail (manager != NULL, NULL);
g_return_val_if_fail (NM_IS_MANAGER (manager), NULL); g_return_val_if_fail (NM_IS_MANAGER (manager), NULL);
devices = nm_manager_get_devices (manager); devices = nm_manager_get_devices (manager);
@@ -164,7 +163,6 @@ get_best_ip6_device (NMManager *manager)
NMDevice *best = NULL; NMDevice *best = NULL;
int best_prio = G_MAXINT; int best_prio = G_MAXINT;
g_return_val_if_fail (manager != NULL, NULL);
g_return_val_if_fail (NM_IS_MANAGER (manager), NULL); g_return_val_if_fail (NM_IS_MANAGER (manager), NULL);
devices = nm_manager_get_devices (manager); devices = nm_manager_get_devices (manager);

View File

@@ -523,7 +523,6 @@ nm_udev_manager_query_devices (NMUdevManager *self)
GUdevEnumerator *enumerator; GUdevEnumerator *enumerator;
GList *devices, *iter; GList *devices, *iter;
g_return_if_fail (self != NULL);
g_return_if_fail (NM_IS_UDEV_MANAGER (self)); g_return_if_fail (NM_IS_UDEV_MANAGER (self));
enumerator = g_udev_enumerator_new (priv->client); enumerator = g_udev_enumerator_new (priv->client);

View File

@@ -756,7 +756,6 @@ nm_ap_dump (NMAccessPoint *ap, const char *prefix)
{ {
NMAccessPointPrivate *priv; NMAccessPointPrivate *priv;
g_return_if_fail (ap != NULL);
g_return_if_fail (NM_IS_AP (ap)); g_return_if_fail (NM_IS_AP (ap));
priv = NM_AP_GET_PRIVATE (ap); priv = NM_AP_GET_PRIVATE (ap);

View File

@@ -1048,7 +1048,6 @@ nm_agent_manager_get_secrets (NMAgentManager *self,
Request *req; Request *req;
g_return_val_if_fail (self != NULL, 0); g_return_val_if_fail (self != NULL, 0);
g_return_val_if_fail (connection != NULL, 0);
g_return_val_if_fail (NM_IS_CONNECTION (connection), 0); g_return_val_if_fail (NM_IS_CONNECTION (connection), 0);
g_return_val_if_fail (callback != NULL, 0); g_return_val_if_fail (callback != NULL, 0);
@@ -1179,7 +1178,6 @@ nm_agent_manager_save_secrets (NMAgentManager *self,
Request *req; Request *req;
g_return_val_if_fail (self != NULL, 0); g_return_val_if_fail (self != NULL, 0);
g_return_val_if_fail (connection != NULL, 0);
g_return_val_if_fail (NM_IS_CONNECTION (connection), 0); g_return_val_if_fail (NM_IS_CONNECTION (connection), 0);
nm_log_dbg (LOGD_SETTINGS, nm_log_dbg (LOGD_SETTINGS,
@@ -1276,7 +1274,6 @@ nm_agent_manager_delete_secrets (NMAgentManager *self,
Request *req; Request *req;
g_return_val_if_fail (self != NULL, 0); g_return_val_if_fail (self != NULL, 0);
g_return_val_if_fail (connection != NULL, 0);
g_return_val_if_fail (NM_IS_CONNECTION (connection), 0); g_return_val_if_fail (NM_IS_CONNECTION (connection), 0);
nm_log_dbg (LOGD_SETTINGS, nm_log_dbg (LOGD_SETTINGS,

View File

@@ -105,7 +105,6 @@ nm_default_wired_connection_new (const GByteArray *mac,
g_return_val_if_fail (mac != NULL, NULL); g_return_val_if_fail (mac != NULL, NULL);
g_return_val_if_fail (mac->len == ETH_ALEN, NULL); g_return_val_if_fail (mac->len == ETH_ALEN, NULL);
g_return_val_if_fail (device != NULL, NULL);
g_return_val_if_fail (NM_IS_DEVICE (device), NULL); g_return_val_if_fail (NM_IS_DEVICE (device), NULL);
g_return_val_if_fail (defname != NULL, NULL); g_return_val_if_fail (defname != NULL, NULL);

View File

@@ -100,7 +100,6 @@ nm_secret_agent_get_description (NMSecretAgent *agent)
{ {
NMSecretAgentPrivate *priv; NMSecretAgentPrivate *priv;
g_return_val_if_fail (agent != NULL, NULL);
g_return_val_if_fail (NM_IS_SECRET_AGENT (agent), NULL); g_return_val_if_fail (NM_IS_SECRET_AGENT (agent), NULL);
priv = NM_SECRET_AGENT_GET_PRIVATE (agent); priv = NM_SECRET_AGENT_GET_PRIVATE (agent);
@@ -117,7 +116,6 @@ nm_secret_agent_get_description (NMSecretAgent *agent)
const char * const char *
nm_secret_agent_get_dbus_owner (NMSecretAgent *agent) nm_secret_agent_get_dbus_owner (NMSecretAgent *agent)
{ {
g_return_val_if_fail (agent != NULL, NULL);
g_return_val_if_fail (NM_IS_SECRET_AGENT (agent), NULL); g_return_val_if_fail (NM_IS_SECRET_AGENT (agent), NULL);
return NM_SECRET_AGENT_GET_PRIVATE (agent)->owner; return NM_SECRET_AGENT_GET_PRIVATE (agent)->owner;
@@ -126,7 +124,6 @@ nm_secret_agent_get_dbus_owner (NMSecretAgent *agent)
const char * const char *
nm_secret_agent_get_identifier (NMSecretAgent *agent) nm_secret_agent_get_identifier (NMSecretAgent *agent)
{ {
g_return_val_if_fail (agent != NULL, NULL);
g_return_val_if_fail (NM_IS_SECRET_AGENT (agent), NULL); g_return_val_if_fail (NM_IS_SECRET_AGENT (agent), NULL);
return NM_SECRET_AGENT_GET_PRIVATE (agent)->identifier; return NM_SECRET_AGENT_GET_PRIVATE (agent)->identifier;
@@ -135,7 +132,6 @@ nm_secret_agent_get_identifier (NMSecretAgent *agent)
uid_t uid_t
nm_secret_agent_get_owner_uid (NMSecretAgent *agent) nm_secret_agent_get_owner_uid (NMSecretAgent *agent)
{ {
g_return_val_if_fail (agent != NULL, G_MAXUINT);
g_return_val_if_fail (NM_IS_SECRET_AGENT (agent), G_MAXUINT); g_return_val_if_fail (NM_IS_SECRET_AGENT (agent), G_MAXUINT);
return NM_SECRET_AGENT_GET_PRIVATE (agent)->owner_uid; return NM_SECRET_AGENT_GET_PRIVATE (agent)->owner_uid;
@@ -144,7 +140,6 @@ nm_secret_agent_get_owner_uid (NMSecretAgent *agent)
const char * const char *
nm_secret_agent_get_owner_username(NMSecretAgent *agent) nm_secret_agent_get_owner_username(NMSecretAgent *agent)
{ {
g_return_val_if_fail (agent != NULL, NULL);
g_return_val_if_fail (NM_IS_SECRET_AGENT (agent), NULL); g_return_val_if_fail (NM_IS_SECRET_AGENT (agent), NULL);
return NM_SECRET_AGENT_GET_PRIVATE (agent)->owner_username; return NM_SECRET_AGENT_GET_PRIVATE (agent)->owner_username;
@@ -153,7 +148,6 @@ nm_secret_agent_get_owner_username(NMSecretAgent *agent)
guint32 guint32
nm_secret_agent_get_hash (NMSecretAgent *agent) nm_secret_agent_get_hash (NMSecretAgent *agent)
{ {
g_return_val_if_fail (agent != NULL, 0);
g_return_val_if_fail (NM_IS_SECRET_AGENT (agent), 0); g_return_val_if_fail (NM_IS_SECRET_AGENT (agent), 0);
return NM_SECRET_AGENT_GET_PRIVATE (agent)->hash; return NM_SECRET_AGENT_GET_PRIVATE (agent)->hash;

View File

@@ -205,7 +205,6 @@ set_visible (NMSettingsConnection *self, gboolean new_visible)
gboolean gboolean
nm_settings_connection_is_visible (NMSettingsConnection *self) nm_settings_connection_is_visible (NMSettingsConnection *self)
{ {
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (NM_IS_SETTINGS_CONNECTION (self), FALSE); g_return_val_if_fail (NM_IS_SETTINGS_CONNECTION (self), FALSE);
return NM_SETTINGS_CONNECTION_GET_PRIVATE (self)->visible; return NM_SETTINGS_CONNECTION_GET_PRIVATE (self)->visible;
@@ -218,7 +217,6 @@ nm_settings_connection_recheck_visibility (NMSettingsConnection *self)
NMSettingConnection *s_con; NMSettingConnection *s_con;
guint32 num, i; guint32 num, i;
g_return_if_fail (self != NULL);
g_return_if_fail (NM_IS_SETTINGS_CONNECTION (self)); g_return_if_fail (NM_IS_SETTINGS_CONNECTION (self));
priv = NM_SETTINGS_CONNECTION_GET_PRIVATE (self); priv = NM_SETTINGS_CONNECTION_GET_PRIVATE (self);
@@ -269,7 +267,6 @@ nm_settings_connection_check_permission (NMSettingsConnection *self,
guint32 num, i; guint32 num, i;
const char *puser; const char *puser;
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (NM_IS_SETTINGS_CONNECTION (self), FALSE); g_return_val_if_fail (NM_IS_SETTINGS_CONNECTION (self), FALSE);
priv = NM_SETTINGS_CONNECTION_GET_PRIVATE (self); priv = NM_SETTINGS_CONNECTION_GET_PRIVATE (self);
@@ -383,9 +380,7 @@ nm_settings_connection_replace_settings (NMSettingsConnection *self,
GHashTable *new_settings, *hash = NULL; GHashTable *new_settings, *hash = NULL;
gboolean success = FALSE; gboolean success = FALSE;
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (NM_IS_SETTINGS_CONNECTION (self), FALSE); g_return_val_if_fail (NM_IS_SETTINGS_CONNECTION (self), FALSE);
g_return_val_if_fail (new != NULL, FALSE);
g_return_val_if_fail (NM_IS_CONNECTION (new), FALSE); g_return_val_if_fail (NM_IS_CONNECTION (new), FALSE);
priv = NM_SETTINGS_CONNECTION_GET_PRIVATE (self); priv = NM_SETTINGS_CONNECTION_GET_PRIVATE (self);
@@ -436,9 +431,7 @@ nm_settings_connection_replace_and_commit (NMSettingsConnection *self,
{ {
GError *error = NULL; GError *error = NULL;
g_return_if_fail (self != NULL);
g_return_if_fail (NM_IS_SETTINGS_CONNECTION (self)); g_return_if_fail (NM_IS_SETTINGS_CONNECTION (self));
g_return_if_fail (new != NULL);
g_return_if_fail (NM_IS_CONNECTION (new)); g_return_if_fail (NM_IS_CONNECTION (new));
if (!callback) if (!callback)
@@ -465,7 +458,6 @@ nm_settings_connection_commit_changes (NMSettingsConnection *connection,
NMSettingsConnectionCommitFunc callback, NMSettingsConnectionCommitFunc callback,
gpointer user_data) gpointer user_data)
{ {
g_return_if_fail (connection != NULL);
g_return_if_fail (NM_IS_SETTINGS_CONNECTION (connection)); g_return_if_fail (NM_IS_SETTINGS_CONNECTION (connection));
g_return_if_fail (callback != NULL); g_return_if_fail (callback != NULL);
@@ -487,7 +479,6 @@ nm_settings_connection_delete (NMSettingsConnection *connection,
NMSettingsConnectionDeleteFunc callback, NMSettingsConnectionDeleteFunc callback,
gpointer user_data) gpointer user_data)
{ {
g_return_if_fail (connection != NULL);
g_return_if_fail (NM_IS_SETTINGS_CONNECTION (connection)); g_return_if_fail (NM_IS_SETTINGS_CONNECTION (connection));
g_return_if_fail (callback != NULL); g_return_if_fail (callback != NULL);
@@ -1021,7 +1012,6 @@ check_writable (NMConnection *connection, GError **error)
{ {
NMSettingConnection *s_con; NMSettingConnection *s_con;
g_return_val_if_fail (connection != NULL, FALSE);
g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE); g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE);
s_con = nm_connection_get_setting_connection (connection); s_con = nm_connection_get_setting_connection (connection);
@@ -1426,7 +1416,6 @@ gboolean
nm_settings_connection_get_timestamp (NMSettingsConnection *connection, nm_settings_connection_get_timestamp (NMSettingsConnection *connection,
guint64 *out_timestamp) guint64 *out_timestamp)
{ {
g_return_val_if_fail (connection != NULL, 0);
g_return_val_if_fail (NM_IS_SETTINGS_CONNECTION (connection), 0); g_return_val_if_fail (NM_IS_SETTINGS_CONNECTION (connection), 0);
if (out_timestamp) if (out_timestamp)
@@ -1572,7 +1561,6 @@ nm_settings_connection_get_seen_bssids (NMSettingsConnection *connection)
char *bssid_str; char *bssid_str;
GSList *bssid_list = NULL; GSList *bssid_list = NULL;
g_return_val_if_fail (connection != NULL, 0);
g_return_val_if_fail (NM_IS_SETTINGS_CONNECTION (connection), NULL); g_return_val_if_fail (NM_IS_SETTINGS_CONNECTION (connection), NULL);
g_hash_table_iter_init (&iter, priv->seen_bssids); g_hash_table_iter_init (&iter, priv->seen_bssids);
@@ -1593,7 +1581,6 @@ gboolean
nm_settings_connection_has_seen_bssid (NMSettingsConnection *connection, nm_settings_connection_has_seen_bssid (NMSettingsConnection *connection,
const struct ether_addr *bssid) const struct ether_addr *bssid)
{ {
g_return_val_if_fail (connection != NULL, FALSE);
g_return_val_if_fail (NM_IS_SETTINGS_CONNECTION (connection), FALSE); g_return_val_if_fail (NM_IS_SETTINGS_CONNECTION (connection), FALSE);
g_return_val_if_fail (bssid != NULL, FALSE); g_return_val_if_fail (bssid != NULL, FALSE);

View File

@@ -203,7 +203,6 @@ nm_settings_for_each_connection (NMSettings *self,
GHashTableIter iter; GHashTableIter iter;
gpointer data; gpointer data;
g_return_if_fail (self != NULL);
g_return_if_fail (NM_IS_SETTINGS (self)); g_return_if_fail (NM_IS_SETTINGS (self));
g_return_if_fail (for_each_func != NULL); g_return_if_fail (for_each_func != NULL);
@@ -241,7 +240,6 @@ nm_settings_get_connection_by_uuid (NMSettings *self, const char *uuid)
NMSettingsConnection *candidate; NMSettingsConnection *candidate;
GHashTableIter iter; GHashTableIter iter;
g_return_val_if_fail (self != NULL, NULL);
g_return_val_if_fail (NM_IS_SETTINGS (self), NULL); g_return_val_if_fail (NM_IS_SETTINGS (self), NULL);
g_return_val_if_fail (uuid != NULL, NULL); g_return_val_if_fail (uuid != NULL, NULL);
@@ -331,7 +329,6 @@ nm_settings_get_connection_by_path (NMSettings *self, const char *path)
{ {
NMSettingsPrivate *priv; NMSettingsPrivate *priv;
g_return_val_if_fail (self != NULL, NULL);
g_return_val_if_fail (NM_IS_SETTINGS (self), NULL); g_return_val_if_fail (NM_IS_SETTINGS (self), NULL);
g_return_val_if_fail (path != NULL, NULL); g_return_val_if_fail (path != NULL, NULL);

View File

@@ -690,7 +690,6 @@ nm_supplicant_interface_credentials_reply (NMSupplicantInterface *self,
{ {
NMSupplicantInterfacePrivate *priv; NMSupplicantInterfacePrivate *priv;
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (NM_IS_SUPPLICANT_INTERFACE (self), FALSE); g_return_val_if_fail (NM_IS_SUPPLICANT_INTERFACE (self), FALSE);
g_return_val_if_fail (field != NULL, FALSE); g_return_val_if_fail (field != NULL, FALSE);
g_return_val_if_fail (value != NULL, FALSE); g_return_val_if_fail (value != NULL, FALSE);
@@ -1442,7 +1441,6 @@ nm_supplicant_interface_state_to_string (guint32 state)
const char * const char *
nm_supplicant_interface_get_device (NMSupplicantInterface * self) nm_supplicant_interface_get_device (NMSupplicantInterface * self)
{ {
g_return_val_if_fail (self != NULL, NULL);
g_return_val_if_fail (NM_IS_SUPPLICANT_INTERFACE (self), NULL); g_return_val_if_fail (NM_IS_SUPPLICANT_INTERFACE (self), NULL);
return NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self)->dev; return NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self)->dev;
@@ -1451,7 +1449,6 @@ nm_supplicant_interface_get_device (NMSupplicantInterface * self)
const char * const char *
nm_supplicant_interface_get_object_path (NMSupplicantInterface *self) nm_supplicant_interface_get_object_path (NMSupplicantInterface *self)
{ {
g_return_val_if_fail (self != NULL, NULL);
g_return_val_if_fail (NM_IS_SUPPLICANT_INTERFACE (self), NULL); g_return_val_if_fail (NM_IS_SUPPLICANT_INTERFACE (self), NULL);
return NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self)->object_path; return NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self)->object_path;
@@ -1460,7 +1457,6 @@ nm_supplicant_interface_get_object_path (NMSupplicantInterface *self)
const char * const char *
nm_supplicant_interface_get_ifname (NMSupplicantInterface *self) nm_supplicant_interface_get_ifname (NMSupplicantInterface *self)
{ {
g_return_val_if_fail (self != NULL, NULL);
g_return_val_if_fail (NM_IS_SUPPLICANT_INTERFACE (self), NULL); g_return_val_if_fail (NM_IS_SUPPLICANT_INTERFACE (self), NULL);
return NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self)->dev; return NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self)->dev;
@@ -1469,7 +1465,6 @@ nm_supplicant_interface_get_ifname (NMSupplicantInterface *self)
guint guint
nm_supplicant_interface_get_max_scan_ssids (NMSupplicantInterface *self) nm_supplicant_interface_get_max_scan_ssids (NMSupplicantInterface *self)
{ {
g_return_val_if_fail (self != NULL, 0);
g_return_val_if_fail (NM_IS_SUPPLICANT_INTERFACE (self), 0); g_return_val_if_fail (NM_IS_SUPPLICANT_INTERFACE (self), 0);
return NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self)->max_scan_ssids; return NM_SUPPLICANT_INTERFACE_GET_PRIVATE (self)->max_scan_ssids;

View File

@@ -210,7 +210,6 @@ check_capabilities (NMSupplicantManager *self)
gboolean gboolean
nm_supplicant_manager_available (NMSupplicantManager *self) nm_supplicant_manager_available (NMSupplicantManager *self)
{ {
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (NM_IS_SUPPLICANT_MANAGER (self), FALSE); g_return_val_if_fail (NM_IS_SUPPLICANT_MANAGER (self), FALSE);
if (die_count_exceeded (NM_SUPPLICANT_MANAGER_GET_PRIVATE (self)->die_count)) if (die_count_exceeded (NM_SUPPLICANT_MANAGER_GET_PRIVATE (self)->die_count))