[ovs-dev] [PATCH 01/12] datapath: Add compatibility code for sparse annotations.

Jesse Gross jesse at nicira.com
Mon Dec 13 21:37:08 UTC 2010


On Mon, Dec 13, 2010 at 10:36 AM, Ben Pfaff <blp at nicira.com> wrote:
> On Sun, Dec 12, 2010 at 12:52:56PM -0800, Jesse Gross wrote:
>> The __percpu and __rcu annotations for sparse are relatively
>> recent additions, so provide no-op definitions on older kernels.
>>
>> Signed-off-by: Jesse Gross <jesse at nicira.com>
>
> Acked-by: Ben Pfaff <blp at nicira.com>
>
> Would it make sense to provide the upstream definition of __percpu if
> __CHECKER__ is defined?

That was my initial thought as well.  However, on kernels where
__percpu is not defined, the kernel headers won't be annotated with
it.  So, for example, assigning the result of alloc_percpu() to a
__percpu variable would cause a warning on those kernels because
alloc_percpu() doesn't know to return a pointer of type __percpu.

When I was working on this I didn't find anything interesting in the
version specific code.  Given that, it's really most productive to
just run sparse on the latest version (I was using net-next) since the
information in the headers gets better as time goes on.  On older
kernels I just cared that it didn't break anything.




More information about the dev mailing list