diff --git a/iscsi-scst/kernel/isert-scst/iser.h b/iscsi-scst/kernel/isert-scst/iser.h index 082cf9cd4..65ae7e3db 100644 --- a/iscsi-scst/kernel/isert-scst/iser.h +++ b/iscsi-scst/kernel/isert-scst/iser.h @@ -36,10 +36,13 @@ #ifndef __ISER_H__ #define __ISER_H__ -#include #include #include #include +#ifndef INSIDE_KERNEL_TREE +#include +#endif + #if defined(RHEL_MAJOR) && RHEL_MAJOR -0 == 5 static inline u16 vlan_dev_vlan_id(const void *dev) { diff --git a/iscsi-scst/kernel/isert-scst/iser_rdma.c b/iscsi-scst/kernel/isert-scst/iser_rdma.c index e24b5ecdb..bfc03f0d9 100644 --- a/iscsi-scst/kernel/isert-scst/iser_rdma.c +++ b/iscsi-scst/kernel/isert-scst/iser_rdma.c @@ -36,9 +36,11 @@ #include #include -#include #include #include +#ifndef INSIDE_KERNEL_TREE +#include +#endif #include "isert_dbg.h" #include "iser.h" diff --git a/iscsi-scst/kernel/isert-scst/isert.h b/iscsi-scst/kernel/isert-scst/isert.h index ee48c33ea..7a4554bce 100644 --- a/iscsi-scst/kernel/isert-scst/isert.h +++ b/iscsi-scst/kernel/isert-scst/isert.h @@ -43,7 +43,6 @@ #include #include #include -#include #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37) #include @@ -55,6 +54,7 @@ #include #include #else +#include #include "isert_scst.h" #include "iscsi_scst.h" #endif diff --git a/iscsi-scst/kernel/isert-scst/isert_dbg.h b/iscsi-scst/kernel/isert-scst/isert_dbg.h index 4531b0c09..9bf2aba17 100644 --- a/iscsi-scst/kernel/isert-scst/isert_dbg.h +++ b/iscsi-scst/kernel/isert-scst/isert_dbg.h @@ -16,8 +16,6 @@ #ifndef ISERT_DBG_H #define ISERT_DBG_H -#include - #ifdef LOG_PREFIX #undef LOG_PREFIX #endif @@ -27,6 +25,7 @@ #ifdef INSIDE_KERNEL_TREE #include #else +#include #include #endif diff --git a/iscsi-scst/kernel/isert-scst/isert_login.c b/iscsi-scst/kernel/isert-scst/isert_login.c index f0220e958..a6ffea6af 100644 --- a/iscsi-scst/kernel/isert-scst/isert_login.c +++ b/iscsi-scst/kernel/isert-scst/isert_login.c @@ -39,7 +39,9 @@ #include /* error codes */ #include #include +#ifndef INSIDE_KERNEL_TREE #include +#endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20) #include #else diff --git a/iscsi-scst/kernel/session.c b/iscsi-scst/kernel/session.c index 19f9b4f84..6111b73d1 100644 --- a/iscsi-scst/kernel/session.c +++ b/iscsi-scst/kernel/session.c @@ -14,7 +14,9 @@ * GNU General Public License for more details. */ +#ifndef INSIDE_KERNEL_TREE #include +#endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0) #include #endif diff --git a/scst/src/dev_handlers/scst_user.c b/scst/src/dev_handlers/scst_user.c index debed3370..6f94728e9 100644 --- a/scst/src/dev_handlers/scst_user.c +++ b/scst/src/dev_handlers/scst_user.c @@ -22,10 +22,6 @@ #include #include #include -#include -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) -#include -#endif #define LOG_PREFIX DEV_USER_NAME @@ -33,11 +29,16 @@ #include #include #else +#include #include "scst.h" #include "scst_user.h" #endif #include "scst_dev_handler.h" +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) +#include +#endif + #ifndef INSIDE_KERNEL_TREE #if defined(CONFIG_HIGHMEM4G) || defined(CONFIG_HIGHMEM64G) #warning HIGHMEM kernel configurations are not supported by this module, \ diff --git a/scst/src/scst_event.c b/scst/src/scst_event.c index 4ec509bf0..ff2a0074b 100644 --- a/scst/src/scst_event.c +++ b/scst/src/scst_event.c @@ -11,7 +11,9 @@ #include #include #include +#ifndef INSIDE_KERNEL_TREE #include +#endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) #include #endif diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 1b105209b..dbf5cdbd5 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -33,7 +33,9 @@ #include #include #include +#ifndef INSIDE_KERNEL_TREE #include +#endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) #include #endif @@ -43,10 +45,6 @@ #include #include -#ifndef INSIDE_KERNEL_TREE -#include -#endif - #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) #include #endif