From 7a1d0ddaf53e3b7d709c17140302e1e139185f2c Mon Sep 17 00:00:00 2001 From: Gleb Chesnokov Date: Mon, 10 Jul 2023 13:55:19 +0300 Subject: [PATCH] qla2x00t-32gbit: Backport to older kernel versions Unbreak the build for the previous commit against kernel versions before v5.1. --- scst/include/backport.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scst/include/backport.h b/scst/include/backport.h index 80683bc64..4e693aeab 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -687,6 +687,19 @@ static inline bool list_entry_in_list(const struct list_head *entry) return !list_empty(entry); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(8, 1)) +/* + * See also commit 70b44595eafe ("mm, compaction: use free lists to quickly + * locate a migration source") # v5.1. + */ +static inline int list_is_first(const struct list_head *list, const struct list_head *head) +{ + return list->prev == head; +} +#endif + /* */ /*