* Negative if @lh_a is better than @lh_b, zero if they're equivalent, or
* positive if @lh_b is better than @lh_a.
*/
-static int drm_mode_compare(void *priv, struct list_head *lh_a, struct list_head *lh_b)
+static int drm_mode_compare(void *priv, const struct list_head *lh_a,
+ const struct list_head *lh_b)
{
struct drm_display_mode *a = list_entry(lh_a, struct drm_display_mode, head);
struct drm_display_mode *b = list_entry(lh_b, struct drm_display_mode, head);
[VIDEO_ENHANCEMENT_CLASS] = I915_ENGINE_CLASS_VIDEO_ENHANCE,
};
-static int engine_cmp(void *priv, struct list_head *A, struct list_head *B)
+static int engine_cmp(void *priv, const struct list_head *A,
+ const struct list_head *B)
{
const struct intel_engine_cs *a =
container_of((struct rb_node *)A, typeof(*a), uabi_node);
/* Compare two diff_mmio items. */
static int mmio_offset_compare(void *priv,
- struct list_head *a, struct list_head *b)
+ const struct list_head *a, const struct list_head *b)
{
struct diff_mmio *ma;
struct diff_mmio *mb;
return exercise_ppgtt(arg, shrink_boom);
}
-static int sort_holes(void *priv, struct list_head *A, struct list_head *B)
+static int sort_holes(void *priv, const struct list_head *A,
+ const struct list_head *B)
{
struct drm_mm_node *a = list_entry(A, typeof(*a), hole_stack);
struct drm_mm_node *b = list_entry(B, typeof(*b), hole_stack);
-/* $OpenBSD: list.h,v 1.3 2021/07/07 02:38:36 jsg Exp $ */
+/* $OpenBSD: list.h,v 1.4 2021/10/01 04:36:38 jsg Exp $ */
/* drm_linux_list.h -- linux list functions for the BSDs.
* Created: Mon Apr 7 14:30:16 1999 by anholt@FreeBSD.org
*/
}
void list_sort(void *, struct list_head *,
- int (*)(void *, struct list_head *, struct list_head *));
+ int (*)(void *, const struct list_head *, const struct list_head *));
#define hlist_entry(ptr, type, member) \
((ptr) ? container_of(ptr, type, member) : NULL)
static struct list_head *
list_sort_merge(struct list_head *, struct list_head *,
- int (*)(void *, struct list_head *,
- struct list_head *), void *);
+ int (*)(void *, const struct list_head *,
+ const struct list_head *), void *);
static void
list_sort_merge_into(struct list_head *,
struct list_head *, struct list_head *,
- int (*)(void *, struct list_head *,
- struct list_head *), void *);
+ int (*)(void *, const struct list_head *,
+ const struct list_head *), void *);
void
list_sort(void *arg, struct list_head *list,
- int (*compare)(void *, struct list_head *, struct list_head *))
+ int (*compare)(void *, const struct list_head *, const struct list_head *))
{
/*
* Array of sorted sublists, counting in binary: accum[i]
*/
static struct list_head *
list_sort_merge(struct list_head *a, struct list_head *b,
- int (*compare)(void *, struct list_head *,
- struct list_head *), void *arg)
+ int (*compare)(void *, const struct list_head *,
+ const struct list_head *), void *arg)
{
struct list_head head, *tail = &head;
static void
list_sort_merge_into(struct list_head *list,
struct list_head *a, struct list_head *b,
- int (*compare)(void *, struct list_head *,
- struct list_head *), void *arg)
+ int (*compare)(void *, const struct list_head *,
+ const struct list_head *), void *arg)
{
struct list_head *prev = list;
return 0;
}
-static int cmp_size_smaller_first(void *priv, struct list_head *a,
- struct list_head *b)
+static int cmp_size_smaller_first(void *priv, const struct list_head *a,
+ const struct list_head *b)
{
struct radeon_bo_list *la = list_entry(a, struct radeon_bo_list, tv.head);
struct radeon_bo_list *lb = list_entry(b, struct radeon_bo_list, tv.head);