trivial: Remove some unused variables

This commit is contained in:
Richard Hughes 2021-12-09 23:12:11 +00:00
parent d7aeac4663
commit 8fc8539146
13 changed files with 4 additions and 20 deletions

View File

@ -879,7 +879,6 @@ fu_dfu_target_upload_element_dfu(FuDfuTarget *self,
{
FuDfuTargetPrivate *priv = GET_PRIVATE(self);
GBytes *chunk_tmp;
guint32 offset = 0;
guint percentage_size = expected_size > 0 ? expected_size : maximum_size;
gsize total_size = 0;
guint16 transfer_size = fu_dfu_device_get_transfer_size(priv->device);
@ -906,7 +905,6 @@ fu_dfu_target_upload_element_dfu(FuDfuTarget *self,
/* keep a sum of all the chunks */
chunk_size = (guint32)g_bytes_get_size(chunk_tmp);
total_size += chunk_size;
offset += chunk_size;
/* add to array */
g_debug("got #%04x chunk of size %" G_GUINT32_FORMAT, idx, chunk_size);

View File

@ -649,7 +649,6 @@ fu_fastboot_device_write_firmware(FuDevice *device,
GError **error)
{
g_autoptr(FuFirmware) manifest = NULL;
g_autoptr(GBytes) fw = NULL;
/* load the manifest of operations */
manifest = fu_firmware_get_image_by_id(firmware, "partition_nand.xml", NULL);

View File

@ -73,8 +73,11 @@ GByteArray *
proto_manager_generate_set_device_time_request(void)
{
GByteArray *buf = g_byte_array_new();
#if GLIB_CHECK_VERSION(2, 57, 1)
g_autoptr(GTimeZone) tz = g_time_zone_new_local();
#else
g_autoptr(GDateTime) dt = g_date_time_new_now_utc();
#endif
Logi__Device__Proto__Header header_msg = LOGI__DEVICE__PROTO__HEADER__INIT;
Logi__Device__Proto__SetDeviceTimeRequest set_devicetime_msg =

View File

@ -311,7 +311,6 @@ fu_logitech_bulkcontroller_device_send_sync_cmd(FuLogitechBulkcontrollerDevice *
GError **error)
{
g_autoptr(GByteArray) buf_pkt = g_byte_array_new();
g_autoptr(GByteArray) buf_ack = g_byte_array_new();
fu_byte_array_append_uint32(buf_pkt, cmd, G_LITTLE_ENDIAN); /* Type(T) : Command type */
fu_byte_array_append_uint32(buf_pkt,

View File

@ -119,7 +119,6 @@ fu_plugin_mm_udev_device_port_added(FuPlugin *plugin,
FuPluginData *priv = fu_plugin_get_data(plugin);
FuMmDevice *existing;
g_autoptr(FuMmDevice) dev = NULL;
g_autoptr(GError) error = NULL;
g_return_if_fail(priv->inhibited != NULL);
existing = fu_plugin_cache_lookup(plugin, priv->inhibited->physical_id);

View File

@ -659,7 +659,6 @@ flash_iface_write(FuRealtekMstDevice *self,
FuProgress *progress,
GError **error)
{
gsize bytes_written = 0;
gsize total_size = g_bytes_get_size(data);
g_autoptr(GPtrArray) chunks = fu_chunk_array_new_from_bytes(data, address, 0, 256);
@ -711,8 +710,6 @@ flash_iface_write(FuRealtekMstDevice *self,
address);
return FALSE;
}
bytes_written += chunk_size;
fu_progress_set_percentage_full(progress, i + 1, chunks->len);
}

View File

@ -212,7 +212,6 @@ fu_redfish_plugin_ipmi_create_user(FuPlugin *plugin, GError **error)
g_autoptr(FuDeviceLocker) locker = NULL;
g_autoptr(FuIpmiDevice) device = fu_ipmi_device_new(fu_plugin_get_context(plugin));
g_autoptr(FuRedfishRequest) request = NULL;
g_autoptr(GError) error_local = NULL;
g_autoptr(JsonBuilder) builder = json_builder_new();
/* create device */

View File

@ -184,7 +184,6 @@ fu_steelseries_gamepad_setup(FuDevice *device, GError **error)
{
g_autofree gchar *bootloader_version = NULL;
g_autofree gchar *version = NULL;
g_autofree gchar *tmp = NULL;
guint16 fw_ver;
guint8 data[STEELSERIES_BUFFER_CONTROL_SIZE] = {0};

View File

@ -43,7 +43,6 @@ static void
fu_plugin_tpm_set_bios_pcr0s(FuPlugin *plugin)
{
FuPluginData *data = fu_plugin_get_data(plugin);
g_autoptr(GError) error_local = NULL;
g_autoptr(GPtrArray) pcr0s = NULL;
if (data->tpm_device == NULL)

View File

@ -126,7 +126,6 @@ fu_tpm_eventlog_parse_v1_func(void)
g_autoptr(GPtrArray) items = NULL;
g_autoptr(GError) error = NULL;
g_autoptr(GPtrArray) pcr0s = NULL;
g_autoptr(FuContext) ctx = fu_context_new();
fn = g_test_build_filename(G_TEST_DIST, "tests", "binary_bios_measurements-v1", NULL);
if (!g_file_test(fn, G_FILE_TEST_EXISTS) && ci == NULL) {
@ -161,7 +160,6 @@ fu_tpm_eventlog_parse_v2_func(void)
g_autoptr(GPtrArray) items = NULL;
g_autoptr(GError) error = NULL;
g_autoptr(GPtrArray) pcr0s = NULL;
g_autoptr(FuContext) ctx = fu_context_new();
fn = g_test_build_filename(G_TEST_DIST, "tests", "binary_bios_measurements-v2", NULL);
if (!g_file_test(fn, G_FILE_TEST_EXISTS) && ci == NULL) {
@ -200,8 +198,6 @@ fu_tpm_empty_pcr_func(void)
g_autoptr(FuSecurityAttrs) attrs = fu_security_attrs_new();
g_autoptr(FwupdSecurityAttr) attr = NULL;
g_autoptr(GError) error = NULL;
g_autoptr(GPtrArray) pcr0s = NULL;
g_autoptr(GPtrArray) pcrXs = NULL;
/* do not save silo */
ret = fu_context_load_quirks(ctx, FU_QUIRKS_LOAD_FLAG_NO_CACHE, &error);

View File

@ -518,7 +518,6 @@ fu_plugin_uefi_capsule_startup(FuPlugin *plugin, GError **error)
g_autofree gchar *esp_path = NULL;
g_autofree gchar *nvram_total_str = NULL;
g_autoptr(GError) error_local = NULL;
g_autoptr(GError) error_fde = NULL;
/* don't let user's environment influence test suite failures */
if (g_getenv("FWUPD_UEFI_TEST") != NULL)

View File

@ -315,7 +315,6 @@ void
fu_security_attrs_to_json(FuSecurityAttrs *attrs, JsonBuilder *builder)
{
g_autoptr(GPtrArray) items = NULL;
g_autoptr(GError) error = NULL;
json_builder_begin_object(builder);
json_builder_set_member_name(builder, "SecurityAttributes");

View File

@ -1010,11 +1010,9 @@ fu_util_device_test(FuUtilPrivate *priv, gchar **values, GError **error)
json_builder_set_member_name(builder, "results");
json_builder_begin_array(builder);
for (guint i = 0; values[i] != NULL; i++) {
g_autoptr(GError) error_local = NULL;
json_builder_begin_object(builder);
if (!fu_util_device_test_filename(priv, &helper, values[i], error)) {
if (!fu_util_device_test_filename(priv, &helper, values[i], error))
return FALSE;
}
json_builder_end_object(builder);
}
json_builder_end_array(builder);