Re: sparse context warning problem ...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Saturday 10 May 2008, Johannes Berg wrote:
> This is probably my mistake.
> 
> However, I took __releases and __acquires to mean that this function
> *changed* the context, doing both doesn't really make much sense. I
> think the function should actually be declared
> 
> static void
> finish_urb(...)
> __requires(ohci->lock)
> {...}
> 
> where __requires is (for sparse) defined as
> 
> #define __requires(x) __attribute__((context(x,1,1)))

ISTR suggesting special syntax for this to Linus (this was way
back when "sparse" was just starting) and he wanted to just do
it by having those two attributes.

So at this point, I'd want to see the regression fixed (and the
tests updated to avoid this in the future) before exploring any
alternative syntax for kernel annotations.


On the plus side, having syntax *IS* more general.  It can serve
as an annotation that the function requires particular locking
context, whether or not that context is explicitly accessed.

- Dave



> It's probably possible to merge the __acquires and __releases into one
> though.


--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux