From 780bba625d2d09478527ec6038f0f6e15eb6e651 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sat, 2 May 2015 07:59:00 +0200 Subject: linuxlist: Remove casting of ptr from container_of macro The cast is not present in the original macro and was added in OpenBSC with commit (be68f6fc6cde1367a4481d2e774a64e2cd657267) to help using the header with C++. Due the recent issue in the bssgp flow control code, let's remove the cast to see wrong pointer usage. In case C++ code doesn't compile anymore we can see how to add a cast back to it. Change was proposed by Michael McTernan --- include/osmocom/core/linuxlist.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/osmocom/core/linuxlist.h b/include/osmocom/core/linuxlist.h index b6841520..a8a28ee7 100644 --- a/include/osmocom/core/linuxlist.h +++ b/include/osmocom/core/linuxlist.h @@ -17,7 +17,7 @@ static inline void prefetch(const void *x) {;} * */ #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) );}) -- cgit v1.2.3