hv: minor coding style fix in list.h

To add brakets for '(char *)(ptr)' in MACRO
 container_of(), which may be used recursively.

Tracked-On: #6284
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
This commit is contained in:
Yonghua Huang 2021-07-08 14:57:42 +08:00 committed by wenlingz
parent 4da04e3f04
commit ec685509a6
1 changed files with 1 additions and 1 deletions

View File

@ -119,7 +119,7 @@ static inline void list_splice_init(struct list_head *list,
}
#define container_of(ptr, type, member) \
((type *)((char *)(ptr)-offsetof(type, member)))
((type *)(((char *)(ptr)) - offsetof(type, member)))
#define list_for_each(pos, head) \
for ((pos) = (head)->next; (pos) != (head); (pos) = (pos)->next)