scst/include/backport.h: Fix build against MOFED >= 4.5 for lk < v4.18

Avoid that the following error is reported when building SCST against
a Linux kernel older than v4.18 combined with MOFED >= 4.5:

scst/include/backport.h:910:21: error: redefinition of 'kvcalloc'
 static inline void *kvcalloc(size_t n, size_t size, gfp_t flags)
                     ^
In file included from ./include/linux/highmem.h:8:0,
                 from ./include/linux/bio.h:21,
                 from ./scst/include/backport.h:24,
                 from ./scst/include/scst_debug.h:42,
                 from isert-scst/isert_dbg.h:29,
                 from isert-scst/iser_global.c:40:
/usr/src/ofa_kernel/default/include/linux/mm.h:78:21: note: previous definition of 'kvcalloc' was here
 static inline void *kvcalloc(size_t n, size_t size, gfp_t flags)
                     ^

Signed-off-by: Sergey Gorenko <sergeygo@mellanox.com>
[bvanassche: renamed MOFED_*_VERSION INTO MOFED_*]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8398 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2019-05-30 13:42:42 +00:00
parent 8e862c6d9b
commit 4486fd014e
+3 -1
View File
@@ -905,7 +905,9 @@ static inline void *kvzalloc(size_t size, gfp_t flags)
}
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0)
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0) && \
(!defined(MOFED_MAJOR) || !defined(MOFED_MINOR) || \
MOFED_MAJOR < 4 || (MOFED_MAJOR == 4 && MOFED_MINOR < 5))
/* See also commit 1c542f38ab8d ("mm: Introduce kvcalloc()") # v4.18. */
static inline void *kvcalloc(size_t n, size_t size, gfp_t flags)
{