On Thu, Jan 05, 2017 at 11:33:38AM -0500, Felix Kuehling wrote: > This could be done with much less code duplication: > > static const struct { > u32 flag; > const char *name; > } clocks[] = { > {AMD_CG_SUPPORT_GFX_MGCG, "Medium Grain Clock Gating"}, > {AMD_CG_SUPPORT_GFX_MGLS, "Medium Grain memory Light Sleep"}, > ... > {0, NULL} > }; > > for (i = 0; clocks[i].flag; i++) > seq_printf(m, "\t%s: %s\n", > clocks[i].name, > (flags & clocks[i].flag) ? "On" : "Off"); > Looks better. Thank you. Thanks, Rui