diff options
| author | Ed Schouten <ed@FreeBSD.org> | 2022-09-30 22:26:30 +0000 |
|---|---|---|
| committer | Xin LI <delphij@FreeBSD.org> | 2022-09-30 22:26:30 +0000 |
| commit | af3c78886fd8d4ca5eebdbe581a459a6f6d29d6a (patch) | |
| tree | 9ff804d16ae1d811e013a58e71f8c824c2ff2488 /sys/dev | |
| parent | 69d79ceb2c01931c129c5bafc300c33f3e106efd (diff) | |
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/bhnd/nvram/bhnd_nvram_store_subr.c | 9 | ||||
| -rw-r--r-- | sys/dev/drm2/drm_linux_list_sort.c | 4 |
2 files changed, 6 insertions, 7 deletions
diff --git a/sys/dev/bhnd/nvram/bhnd_nvram_store_subr.c b/sys/dev/bhnd/nvram/bhnd_nvram_store_subr.c index 730b9d51da45..fd05648147f5 100644 --- a/sys/dev/bhnd/nvram/bhnd_nvram_store_subr.c +++ b/sys/dev/bhnd/nvram/bhnd_nvram_store_subr.c @@ -59,8 +59,7 @@ __FBSDID("$FreeBSD$"); #include "bhnd_nvram_storevar.h" -static int bhnd_nvstore_idx_cmp(void *ctx, - const void *lhs, const void *rhs); +static int bhnd_nvstore_idx_cmp(const void *lhs, const void *rhs, void *ctx); /** * Allocate and initialize a new path instance. @@ -198,7 +197,7 @@ bhnd_nvstore_index_append(struct bhnd_nvram_store *sc, /* sort function for bhnd_nvstore_index_prepare() */ static int -bhnd_nvstore_idx_cmp(void *ctx, const void *lhs, const void *rhs) +bhnd_nvstore_idx_cmp(const void *lhs, const void *rhs, void *ctx) { struct bhnd_nvram_store *sc; void *l_cookiep, *r_cookiep; @@ -259,8 +258,8 @@ bhnd_nvstore_index_prepare(struct bhnd_nvram_store *sc, BHND_NVSTORE_LOCK_ASSERT(sc, MA_OWNED); /* Sort the index table */ - qsort_r(index->cookiep, index->count, sizeof(index->cookiep[0]), sc, - bhnd_nvstore_idx_cmp); + qsort_r(index->cookiep, index->count, sizeof(index->cookiep[0]), + bhnd_nvstore_idx_cmp, sc); return (0); } diff --git a/sys/dev/drm2/drm_linux_list_sort.c b/sys/dev/drm2/drm_linux_list_sort.c index f9a64154c796..04cdf28180c8 100644 --- a/sys/dev/drm2/drm_linux_list_sort.c +++ b/sys/dev/drm2/drm_linux_list_sort.c @@ -37,7 +37,7 @@ struct drm_list_sort_thunk { }; static int -drm_le_cmp(void *priv, const void *d1, const void *d2) +drm_le_cmp(const void *d1, const void *d2, void *priv) { struct list_head *le1, *le2; struct drm_list_sort_thunk *thunk; @@ -68,7 +68,7 @@ drm_list_sort(void *priv, struct list_head *head, int (*cmp)(void *priv, ar[i++] = le; thunk.cmp = cmp; thunk.priv = priv; - qsort_r(ar, count, sizeof(struct list_head *), &thunk, drm_le_cmp); + qsort_r(ar, count, sizeof(struct list_head *), drm_le_cmp, &thunk); INIT_LIST_HEAD(head); for (i = 0; i < count; i++) list_add_tail(ar[i], head); |
