On Wednesday 16 March 2016, Karel Zak wrote: > On Wed, Mar 16, 2016 at 08:57:26AM +0100, Ruediger Meier wrote: > > > + if (cpu) { > > > + free(desc->modelname); > > > + desc->modelname = cpu; > > > + } > > > + if (revision) { > > > + free(desc->model); > > > + desc->model = revision; > > > + } > > > + > > The problem I see is that Linux kernel does not provide any unified > abstraction for /proc/cpuinfo, the file is generated individually by > architecture specific code, so the field names are very arch > specific. (use "git grep show_cpuinfo" in kernel tree to see more) > > For example "revision" is no PPC specific, it's also used by ia64. > Alpha uses "cpu revision" and "cpu model", etc. Yes, but the probability is high that the new code will do it better. Like in sparc case. > The ideal solution (for v2.29) would be to have more > read_cpuinfo_<arch>() functions to hide the differences. > > > Watching this again today I think it could be even better to add > > cpu and revision members to the struct and move both if conditions > > to the printing code section. > > Do you want to send a new version of the patch? Yep. -- To unsubscribe from this list: send the line "unsubscribe util-linux" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html