[Mesa-dev] [PATCH v3 1/3] Fix missing initializer warning in sid_tables.h by adding appropriate default fields in sid_tables.py

Nicolai Hähnle nhaehnle at gmail.com
Mon Jun 12 10:07:54 UTC 2017


On 11.06.2017 19:17, Benedikt Schemmer wrote:
> Fix missing initializer warning in sid_tables.h by adding appropriate designated initializers in sid_tables.py
> 
> ---
>   src/amd/common/sid_tables.py | 15 ++++++++++-----
>   1 file changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/src/amd/common/sid_tables.py b/src/amd/common/sid_tables.py
> index fd88d3c9d5..691d766b08 100644
> --- a/src/amd/common/sid_tables.py
> +++ b/src/amd/common/sid_tables.py
> @@ -266,11 +266,13 @@ struct si_packet3 {
>                           while value[1] >= len(values_offsets):
>                               values_offsets.append(-1)
>                           values_offsets[value[1]] = strings.add(strip_prefix(value[0]))
> -                    print '\t{%s, %s(~0u), %s, %s},' % (
> -                        strings.add(field.name), field.s_name,
> +                    print '\t{.name_offset\t= %s,\r\n\t .mask\t\t\t= %s(~0u), \

No space at end of line, and no DOS-style newlines, i.e. no \r.

Also, can you please make sure your editor's tab width is set to 8 and 
re-check? Those three tabs there are suspicious.


> +                           \r\n\t .num_values\t= %s,\r\n\t .values_offset\t= %s},' \
> +                           % (strings.add(field.name), field.s_name,
>                           len(values_offsets), strings_offsets.add(values_offsets))
>                   else:
> -                    print '\t{%s, %s(~0u)},' % (strings.add(field.name), field.s_name)
> +                    print '\t{.name_offset\t= %s,\r\n\t .mask\t\t\t= %s(~0u)},' \

Same as above.

> +                           % (strings.add(field.name), field.s_name)
>                   fields_idx += 1
> 
>       print '};'
> @@ -279,10 +281,13 @@ struct si_packet3 {
>       print 'static const struct si_reg sid_reg_table[] = {'
>       for reg in regs:
>           if len(reg.fields):
> -            print '\t{%s, %s, %s, %s},' % (strings.add(reg.name), reg.r_name,
> +            print '\t{.name_offset\t= %s,\r\n\t .offset\t\t= %s, \
> +                   \r\n\t .num_fields\t= %s,\r\n\t .fields_offset\t= %s},' \
> +                   % (strings.add(reg.name), reg.r_name,
>                   len(reg.fields), reg.fields_idx if reg.own_fields else reg.fields_owner.fields_idx)
>           else:
> -            print '\t{%s, %s},' % (strings.add(reg.name), reg.r_name)
> +            print '\t{.name_offset\t= %s,\r\n\t .offset\t\t= %s},' \
> +                   % (strings.add(reg.name), reg.r_name)

Again, same as above.

Cheers,
Nicolai

>       print '};'
>       print
> 


-- 
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.


More information about the mesa-dev mailing list