libdfu: Fix up some NULL/FALSE confusion

This commit is contained in:
Richard Hughes 2016-03-18 12:21:39 +00:00
parent b3849683b6
commit bd046c8a19
4 changed files with 13 additions and 13 deletions

View File

@ -481,8 +481,8 @@ dfu_context_get_device_by_vid_pid (DfuContext *context,
GUsbDevice *dev;
guint i;
g_return_val_if_fail (DFU_IS_CONTEXT (context), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
g_return_val_if_fail (DFU_IS_CONTEXT (context), NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
/* search all devices */
for (i = 0; i < priv->devices->len; i++) {
@ -536,8 +536,8 @@ dfu_context_get_device_by_platform_id (DfuContext *context,
DfuContextItem *item;
guint i;
g_return_val_if_fail (DFU_IS_CONTEXT (context), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
g_return_val_if_fail (DFU_IS_CONTEXT (context), NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
/* search all devices */
for (i = 0; i < priv->devices->len; i++) {
@ -573,8 +573,8 @@ dfu_context_get_device_default (DfuContext *context, GError **error)
DfuContextPrivate *priv = GET_PRIVATE (context);
DfuContextItem *item;
g_return_val_if_fail (DFU_IS_CONTEXT (context), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
g_return_val_if_fail (DFU_IS_CONTEXT (context), NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
/* none */
if (priv->devices->len == 0) {

View File

@ -1700,7 +1700,7 @@ dfu_device_upload (DfuDevice *device,
DFU_ERROR,
DFU_ERROR_NOT_SUPPORTED,
"device is not in DFU mode");
return FALSE;
return NULL;
}
g_debug ("detaching");

View File

@ -716,7 +716,7 @@ dfu_firmware_write_data_ihex (DfuFirmware *firmware, GError **error)
if (!dfu_firmware_write_data_ihex_element (element,
str,
error))
return FALSE;
return NULL;
}
}

View File

@ -917,7 +917,7 @@ dfu_target_upload_chunk (DfuTarget *target, guint8 index,
/* for ST devices, the action only occurs when we do GetStatus */
if (!dfu_device_has_quirk (priv->device, DFU_DEVICE_QUIRK_NO_GET_STATUS_UPLOAD)) {
if (!dfu_target_check_status (target, cancellable, error))
return FALSE;
return NULL;
}
return g_bytes_new_take (buf, actual_length);
@ -970,7 +970,7 @@ dfu_target_upload_element (DfuTarget *target,
DFU_ERROR_INVALID_DEVICE,
"no memory sector at 0x%04x",
(guint) offset);
return FALSE;
return NULL;
}
if (!dfu_sector_has_cap (sector, DFU_SECTOR_CAP_READABLE)) {
g_set_error (error,
@ -978,7 +978,7 @@ dfu_target_upload_element (DfuTarget *target,
DFU_ERROR_INVALID_DEVICE,
"memory sector at 0x%04x is not readble",
(guint) offset);
return FALSE;
return NULL;
}
/* manually set the sector address */
@ -988,7 +988,7 @@ dfu_target_upload_element (DfuTarget *target,
offset,
cancellable,
error))
return FALSE;
return NULL;
last_sector_id = dfu_sector_get_id (sector);
}
}
@ -1533,7 +1533,7 @@ dfu_target_get_alt_name (DfuTarget *target, GError **error)
DFU_ERROR,
DFU_ERROR_NOT_FOUND,
"no alt-name");
return FALSE;
return NULL;
}
return priv->alt_name;