On 01 May 2015, at 12:23, Mike McTernan (wavemobile) mike.mcternan@wavemobile.com wrote:
I think the definition of container_of() shouldn't cast ptr:
#define container_of(ptr, type, member) ({ \
const typeof( ((type *)0)->member ) *__mptr = (typeof( ((type *)0)->member ) *)(ptr); \
const typeof( ((type *)0)->member ) *__mptr = (ptr); \ (type *)( (char *)__mptr - offsetof(type, member) );})
good point. I thought we have a void* in our hands but we do have the llist_head here. The container_of macro in linux 2.6.12-rc2 (initial git commit) didn’t cast either so we should definitely take your commit.
Jacob, would you also like/be able to check that the above change is good with Coverity, incase that can dig out any other bugs?
Our jenkins only submits HEAD as build to coverity. We don’t have a try server or similar