mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
Move list related utilities from i915_utils.h to separate new file i915_list_util.h. Clean up related includes. Note: Arguably none of this should exist in i915 in the first place. At least isolate it better. Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://lore.kernel.org/r/d7526809735194137116682f37cfa126a6a87ec9.1757582214.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
24 lines
515 B
C
24 lines
515 B
C
/* SPDX-License-Identifier: MIT */
|
|
/* Copyright © 2025 Intel Corporation */
|
|
|
|
#ifndef __I915_LIST_UTIL_H__
|
|
#define __I915_LIST_UTIL_H__
|
|
|
|
#include <linux/list.h>
|
|
#include <asm/rwonce.h>
|
|
|
|
static inline void __list_del_many(struct list_head *head,
|
|
struct list_head *first)
|
|
{
|
|
first->prev = head;
|
|
WRITE_ONCE(head->next, first);
|
|
}
|
|
|
|
static inline int list_is_last_rcu(const struct list_head *list,
|
|
const struct list_head *head)
|
|
{
|
|
return READ_ONCE(list->next) == head;
|
|
}
|
|
|
|
#endif /* __I915_LIST_UTIL_H__ */
|