Commit daec83c7 authored by Marcin Ślusarz's avatar Marcin Ślusarz Committed by Marge Bot

intel/genxml: don't generate identical code for different branches

Quiets 16 Coverity warnings like:

CID 1403401: Identical code for different branches (IDENTICAL_BRANCHES)
Signed-off-by: Marcin Ślusarz's avatarMarcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
Reviewed-by: Lionel Landwerlin's avatarLionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <!7351>
parent e96f33cd
Pipeline #220278 waiting for manual action with stages
in 27 seconds
......@@ -86,19 +86,27 @@ ${item.token_name}_${prop}(const struct gen_device_info *devinfo)
case 9: return ${item.get_prop(prop, 9)};
case 8: return ${item.get_prop(prop, 8)};
case 7:
%if item.get_prop(prop, 7.5) == item.get_prop(prop, 7):
return ${item.get_prop(prop, 7)};
%else:
if (devinfo->is_haswell) {
return ${item.get_prop(prop, 7.5)};
} else {
return ${item.get_prop(prop, 7)};
}
%endif
case 6: return ${item.get_prop(prop, 6)};
case 5: return ${item.get_prop(prop, 5)};
case 4:
%if item.get_prop(prop, 4.5) == item.get_prop(prop, 4):
return ${item.get_prop(prop, 4)};
%else:
if (devinfo->is_g4x) {
return ${item.get_prop(prop, 4.5)};
} else {
return ${item.get_prop(prop, 4)};
}
%endif
default:
unreachable("Invalid hardware generation");
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment