diff --git a/linuxkm/linuxkm_wc_port.h b/linuxkm/linuxkm_wc_port.h index 3e7048f2f..d7a784c75 100644 --- a/linuxkm/linuxkm_wc_port.h +++ b/linuxkm/linuxkm_wc_port.h @@ -61,8 +61,6 @@ #define WOLFSSL_KTHREADS - typedef struct mutex wolfSSL_Mutex; - #ifdef BUILDING_WOLFSSL #if defined(CONFIG_MIPS) && defined(HAVE_LINUXKM_PIE_SUPPORT) @@ -578,6 +576,13 @@ #endif /* BUILDING_WOLFSSL */ + /* if BUILDING_WOLFSSL, mutex.h will have already been included recursively + * above, with the bevy of warnings suppressed, and the below include will + * be a redundant no-op. + */ + #include + typedef struct mutex wolfSSL_Mutex; + #define XMALLOC(s, h, t) ({(void)(h); (void)(t); kmalloc(s, GFP_KERNEL);}) #define XFREE(p, h, t) ({void* _xp; (void)(h); _xp = (p); if(_xp) kfree(_xp);}) #define XREALLOC(p, n, h, t) ({(void)(h); (void)(t); krealloc((p), (n), GFP_KERNEL);}) diff --git a/wolfssl/wolfcrypt/wc_port.h b/wolfssl/wolfcrypt/wc_port.h index 95dd55f3c..d21fabfdb 100644 --- a/wolfssl/wolfcrypt/wc_port.h +++ b/wolfssl/wolfcrypt/wc_port.h @@ -219,8 +219,6 @@ typedef CRITICAL_SECTION wolfSSL_Mutex; #elif defined(WOLFSSL_PTHREADS) typedef pthread_mutex_t wolfSSL_Mutex; - #elif defined(WOLFSSL_KTHREADS) - typedef struct mutex wolfSSL_Mutex; #elif defined(THREADX) typedef TX_MUTEX wolfSSL_Mutex; #elif defined(WOLFSSL_DEOS)