Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
llist: clang: introduce member_address_is_nonnull()
Currently llist_for_each_entry() and llist_for_each_entry_safe() iterate until &pos->member != NULL. But when building the kernel with Clang, the compiler assumes &pos->member cannot be NULL if the member's offset is greater than 0 (which would be equivalent to the object being non-contiguous in memory). Therefore the loop condition is always true, and the loops become infinite. To work around this, introduce the member_address_is_nonnull() macro, which casts object pointer to uintptr_t, thus letting the member pointer to be NULL. Signed-off-by: Alexander Potapenko <[email protected]> Tested-by: Sodagudi Prasad <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
- Loading branch information