+/**
+ * A sized, reference counted, sorted array of integers representing CPU
+ * numbers. This is commonly used to capture which CPUs a PMU is associated
+ * with.
+ */
struct perf_cpu_map {
refcount_t refcnt;
+ /** Length of the map array. */
int nr;
Well, in this case the typical usage doesn't help, as 'struct+ /** The CPU values. */would simply more distinct names for the variables help instead of or in
int map[];
addition to comments?
perf_cpu_map' are being used simply as "map"
where it should be cpu_map,
so we would have:
cpu_map->nr
And all should be obvious, no? Otherwise we would have redundant 'cpu',
like:
cpu_map->nr_cpus
And 'map' should really be entries, so:
cpu_map->entries[index];
Would be clear enough, o?
Thanks John! I agree. The phrase that is often used is intention
revealing names. The kernel style for naming is to be brief: