mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-20 00:10:25 +01:00
intel/genxml: Avoid generating identical 12.5 and 12 branches.
Fix defects reported by Coverity Scan. Identical code for different branches (IDENTICAL_BRANCHES) identical_branches: The same code is executed regardless of whether 0 is true, because the 'then' and 'else' branches are identical. Should one of the branches be modified, or the entire 'if' statement replaced? Signed-off-by: Vinson Lee <vlee@freedesktop.org> Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8001>
This commit is contained in:
parent
73c3380335
commit
56cb5cf34e
1 changed files with 4 additions and 0 deletions
|
|
@ -81,11 +81,15 @@ ${item.token_name}_${prop}(const struct gen_device_info *devinfo)
|
|||
{
|
||||
switch (devinfo->gen) {
|
||||
case 12:
|
||||
%if item.get_prop(prop, 12.5) == item.get_prop(prop, 12):
|
||||
return ${item.get_prop(prop, 12)};
|
||||
%else:
|
||||
if (gen_device_info_is_12hp(devinfo)) {
|
||||
return ${item.get_prop(prop, 12.5)};
|
||||
} else {
|
||||
return ${item.get_prop(prop, 12)};
|
||||
}
|
||||
%endif
|
||||
case 11: return ${item.get_prop(prop, 11)};
|
||||
case 9: return ${item.get_prop(prop, 9)};
|
||||
case 8: return ${item.get_prop(prop, 8)};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue