<soum...@nvidia.com> writes:
> From: Soumya AR <soum...@nvidia.com>
>
> Hi,
>
> This RFC and subsequent patch series introduces support for printing and 
> parsing
> of aarch64 tuning parameters in the form of JSON.

Thanks for doing this.  It looks really useful.  My main question is:
rather than write the parsing and printing routines by hand, could we
generate the structure definitions, the parsing code, and the printing
code from the schema?

The schema would need to provide more information about the structures
compared to the current one.  The approach would also presumably need
build/*.o versions of the json routines.  But it seems like something
that we might want to do elsewhere, so would be worth building a bit
of infrastructure around.  And it would reduce the maintenance burden
associated with adding a new field or changing an existing one.

Much more minor, but: in patch 1, I'm all in favour of removing the
"const"s from the field declarations, such as:
 
 struct scale_addr_mode_cost
 {
-  const int hi;
-  const int si;
-  const int di;
-  const int ti;
+  int hi;
+  int si;
+  int di;
+  int ti;
 };

IMO those consts should never have been there.  But can we keep the
predefined tables themselves as const, without things like:

-const struct cpu_cost_table tsv110_extra_costs =
+struct cpu_cost_table tsv110_extra_costs =

?  If we make any changes to the contents of these tables, it should
IMO be done via temporaries instead.

Thanks,
Richard

Reply via email to