[PATCH] Fix the conflicted for_each_cpu macro with 2.6.28-rc4
Wenji Huang
wenji.huang@oracle.com
Tue Nov 18 05:13:00 GMT 2008
Srikar Dronamraju wrote:
> * Wenji Huang <wenji.huang@oracle.com> [2008-11-18 09:50:07]:
>
>>>> -#ifndef for_each_cpu
>>>> -#define for_each_cpu(cpu) for_each_cpu_mask((cpu), cpu_possible_map)
>>>> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)
>>>> +#ifndef stp_for_each_cpu
>>>> +#define stp_for_each_cpu(cpu) for_each_cpu((cpu), cpu_possible_map)
>>>> +#endif
>>>> +#else
>>>> +#ifndef stp_for_each_cpu
>>>> +#define stp_for_each_cpu(cpu) for_each_cpu_mask((cpu),
>>>> cpu_possible_map)
>>>> +#endif
>>>> #endif
>
> Why do we use for_each_cpu_mask always instead of using for_each_cpu if
> its defined. That would make the code more concise.
>
> --
> Srikar
Good point. Just worry if for_each_cpu_mask will be changed in the later
kernel in terms of defined for_each_cpu.
Regards,
Wenji
More information about the Systemtap
mailing list