[PATCH 2/3] ep93xx: add /proc/cpuinfo extension

H Hartley Sweeten hartleys at visionengravers.com
Thu Mar 17 12:15:23 EDT 2011


On Wednesday, March 16, 2011 8:30 PM, Martin Guy wrote:
>
> Just spotted an off-by-one error in this patch, if of very minor and
> unlikely effect.
>
> On 22 March 2010 19:39, H Hartley Sweeten <hartleys at visionengravers.com> wrote:

Cool.. I time traveled...

Actually, I submitted this last year.  I think Russell NAK'ed it at that time since
it modified the output of /proc/cpuinfo and he did not see a valid reason for it.

There is some discussion going on right now to add a "socinfo" to sysfs where this
information could be exposed.  When that gets worked out I will come up with a new
patch.

>> Add a callback to mach-ep93xx for the /proc/cpuinfo extension.
>>
>> This cpuinfo extension dumps the processor unique ID and Maverick
>> Key as well as the processor silicon revision and a number of
>> boot configuration options.
>> ...
>> diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c
>> index 90fb591..fe1eb7a 100644
>> --- a/arch/arm/mach-ep93xx/core.c
>> +++ b/arch/arm/mach-ep93xx/core.c
>>...
>> +static const char *ep93xx_rev[] = {
>> +       "A", "B", "C", "D0", "D1", "E0", "E1", "E2", "??"
>> +};
>>...
>> +       val = ep93xx_chip_revision();
>> +       if (val > ARRAY_SIZE(ep93xx_rev))
>> +               val = ARRAY_SIZE(ep93xx_rev) - 1;
>> +       seq_printf(m, "Silicon Rev\t: %s\n", ep93xx_rev[val]);
>
> Shouldn't that be
>
> +       if (val >= ARRAY_SIZE(ep93xx_rev))
>

Regardless, if I remember correctly, someone already pointed this out.  I'll
keep it in mind when I re-do this patch based on the "socinfo" stuff.

Thanks,
Hartley


More information about the linux-arm-kernel mailing list