Fix the various scan-build warnings for dead assignments

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer
2017-07-10 15:21:15 +10:00
committed by Benjamin Tissoires
parent df2a06690d
commit 37c8dec45c
6 changed files with 15 additions and 10 deletions

View File

@@ -652,6 +652,9 @@ etekcity_probe(struct ratbag_device *device)
rc = ratbag_hidraw_raw_request(device, ETEKCITY_REPORT_ID_SPEED_SETTING,
drv_data->speed_setting, ETEKCITY_REPORT_SIZE_SPEED_SETTING,
HID_FEATURE_REPORT, HID_REQ_GET_REPORT);
if (rc)
return rc;
log_debug(device->ratbag, "device is at %d ms of latency\n", drv_data->speed_setting[2]);
/* profiles are 0-indexed */

View File

@@ -772,6 +772,8 @@ hidpp20drv_init_feature(struct ratbag_device *device, uint16_t feature)
&feature_index,
&feature_type,
&feature_version);
if (rc < 0)
return rc;
switch (feature) {
case HIDPP_PAGE_ROOT:

View File

@@ -1080,7 +1080,6 @@ hidpp10_onboard_profiles_macro_next(struct hidpp10_device *device,
break;
case HIDPP10_MACRO_END:
step = 1;
return 0;
default:
if (macro->any.type >= 0x80 && macro->any.type <= 0xFE) {

View File

@@ -975,7 +975,6 @@ int hidpp20_adjustable_dpi_get_sensors(struct hidpp20_device *device,
*sensors_list = s_list;
return num_sensors;
err:
num_sensors = 0;
free(s_list);
return rc > 0 ? -EPROTO : rc;
}
@@ -1457,7 +1456,6 @@ hidpp20_onboard_profiles_macro_next(struct hidpp20_device *device,
rc = -EAGAIN;
break;
case HIDPP20_MACRO_END:
step = 1;
return 0;
default:
hidpp_log_error(&device->base, "unknown tag: 0x%02x\n", macro->any.type);