Re: [PATCH v2 20/29] nios2: Cpuinfo handling

Ley Foon Tan
2014-07-18T02:43:34Z

On Tue, Jul 15, 2014 at 5:47 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Tuesday 15 July 2014 16:45:47 Ley Foon Tan wrote:
>> +static void *cpuinfo_start(struct seq_file *m, loff_t *pos)
>> +{
>> + unsigned long i = *pos;
>> +
>> + return i < num_possible_cpus() ? (void *) (i + 1) : NULL;
>> +}
>> +
>> +static void *cpuinfo_next(struct seq_file *m, void *v, loff_t *pos)
>> +{
>> + ++*pos;
>> + return cpuinfo_start(m, pos);
>> +}
>
> Do you actually have SMP support?
Not.

>> +const struct seq_operations cpuinfo_op = {
>> + .start = cpuinfo_start,
>> + .next = cpuinfo_next,
>> + .stop = cpuinfo_stop,
>> + .show = show_cpuinfo
>> +};
>
> If not, you can use single_start/next/stop here rather than defining your own.
Okay, I will look into your suggestion.
Thanks.

Regards
Ley Foon