提交 227abcc6 编写于 作者: D Dan Carpenter 提交者: Greg Kroah-Hartman

staging: kernel.h: Prevent macro expantion bug in container_of_safe()

There aren't many users of this so it doesn't cause a problem, but we
obviously want to use "__mptr" here instead of "ptr" to prevent the
parameter from being executed twice.
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Acked-by: NNeilBrown <neilb@suse.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 2bbdd815
...@@ -977,7 +977,7 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { } ...@@ -977,7 +977,7 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \ BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
!__same_type(*(ptr), void), \ !__same_type(*(ptr), void), \
"pointer type mismatch in container_of()"); \ "pointer type mismatch in container_of()"); \
IS_ERR_OR_NULL(ptr) ? ERR_CAST(ptr) : \ IS_ERR_OR_NULL(__mptr) ? ERR_CAST(__mptr) : \
((type *)(__mptr - offsetof(type, member))); }) ((type *)(__mptr - offsetof(type, member))); })
/* Rebuild everything on CONFIG_FTRACE_MCOUNT_RECORD */ /* Rebuild everything on CONFIG_FTRACE_MCOUNT_RECORD */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册