Each code path either assigns to 'flags', or leaves the routine. There
is no potential path that leaves the variable at the initially assigned
value, so the assignment took no effect. Remove it.
Nit: Trim the source code line length while we are here.
This was reported by clang's scan-build.
break;
case SR_CONF_PATTERN_MODE:
stropt = g_variant_get_string(data, NULL);
- flag = 0xffff;
if (!strcmp(stropt, STR_PATTERN_NONE)) {
sr_info("Disabling test modes.");
flag = 0x0000;
} else {
return SR_ERR;
}
- if (flag != 0xffff) {
- devc->flag_reg &= ~(FLAG_INTERNAL_TEST_MODE | FLAG_EXTERNAL_TEST_MODE);
- devc->flag_reg |= flag;
- }
+ devc->flag_reg &= ~FLAG_INTERNAL_TEST_MODE;
+ devc->flag_reg &= ~FLAG_EXTERNAL_TEST_MODE;
+ devc->flag_reg |= flag;
break;
case SR_CONF_SWAP:
if (g_variant_get_boolean(data)) {
break;
case SR_CONF_PATTERN_MODE:
stropt = g_variant_get_string(data, NULL);
- flag = 0xffff;
if (!strcmp(stropt, STR_PATTERN_NONE)) {
sr_info("Disabling test modes.");
flag = 0x0000;
} else {
return SR_ERR;
}
- if (flag != 0xffff) {
- devc->flag_reg &= ~(FLAG_INTERNAL_TEST_MODE | FLAG_EXTERNAL_TEST_MODE);
- devc->flag_reg |= flag;
- }
+ devc->flag_reg &= ~FLAG_INTERNAL_TEST_MODE;
+ devc->flag_reg &= ~FLAG_EXTERNAL_TEST_MODE;
+ devc->flag_reg |= flag;
break;
case SR_CONF_SWAP:
if (g_variant_get_boolean(data)) {