libfwupdplugin: Fix some NULL/FALSE confusion

This commit is contained in:
Richard Hughes 2020-08-17 14:47:17 +01:00
parent 377cf823f3
commit b81140de75
2 changed files with 8 additions and 8 deletions

View File

@ -2175,7 +2175,7 @@ fu_common_get_volumes_by_kind (const gchar *kind, GError **error)
}
devices = fu_common_get_block_devices (connection, error);
if (devices == NULL)
return FALSE;
return NULL;
volumes = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
for (guint i = 0; i < devices->len; i++) {
const gchar *obj = g_ptr_array_index (devices, i);
@ -2193,7 +2193,7 @@ fu_common_get_volumes_by_kind (const gchar *kind, GError **error)
NULL, error);
if (proxy_part == NULL) {
g_prefix_error (error, "failed to initialize d-bus proxy %s: ", obj);
return FALSE;
return NULL;
}
val = g_dbus_proxy_get_cached_property (proxy_part, "Type");
if (val == NULL)
@ -2211,7 +2211,7 @@ fu_common_get_volumes_by_kind (const gchar *kind, GError **error)
NULL, error);
if (proxy_file == NULL) {
g_prefix_error (error, "failed to initialize d-bus proxy %s: ", obj);
return FALSE;
return NULL;
}
g_ptr_array_add (volumes, fu_volume_new_from_proxy (proxy_file));
}
@ -2250,7 +2250,7 @@ fu_common_get_esp_default (GError **error)
volumes = fu_common_get_volumes_by_kind (FU_VOLUME_KIND_ESP, error);
if (volumes == NULL)
return FALSE;
return NULL;
for (guint i = 0; i < volumes->len; i++) {
FuVolume *vol = g_ptr_array_index (volumes, i);
g_ptr_array_add (fu_volume_is_mounted (vol) ? volumes_mtab : volumes_fstab, vol);
@ -2289,7 +2289,7 @@ fu_common_get_esp_for_path (const gchar *esp_path, GError **error)
volumes = fu_common_get_volumes_by_kind (FU_VOLUME_KIND_ESP, error);
if (volumes == NULL)
return FALSE;
return NULL;
for (guint i = 0; i < volumes->len; i++) {
FuVolume *vol = g_ptr_array_index (volumes, i);
g_autofree gchar *vol_basename = g_path_get_basename (fu_volume_get_id (vol));

View File

@ -1123,8 +1123,8 @@ fu_udev_device_get_sysfs_attr (FuUdevDevice *self, const gchar *attr,
FuUdevDevicePrivate *priv = GET_PRIVATE (self);
const gchar *result;
g_return_val_if_fail (FU_IS_UDEV_DEVICE (self), FALSE);
g_return_val_if_fail (attr != NULL, FALSE);
g_return_val_if_fail (FU_IS_UDEV_DEVICE (self), NULL);
g_return_val_if_fail (attr != NULL, NULL);
/* nothing to do */
if (priv->udev_device == NULL) {
@ -1141,7 +1141,7 @@ fu_udev_device_get_sysfs_attr (FuUdevDevice *self, const gchar *attr,
G_IO_ERROR_NOT_FOUND,
"attribute %s returned no data",
attr);
return FALSE;
return NULL;
}
return result;