staging: wilc1000: simplify msgqueue code
authorArnd Bergmann <arnd@arndb.de>
Mon, 1 Jun 2015 19:06:36 +0000 (21:06 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 2 Jun 2015 04:45:21 +0000 (13:45 +0900)
The driver contains an abstraction for message queues, with
optional unused features, while the driver requires the main
feature.

This makes the msgqueue code unconditional as it's required
but removes the unused parts.

A later cleanup should remove the entire msgqueue code
and replace it with some normal kernel API.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wilc1000/wilc_msgqueue.c
drivers/staging/wilc1000/wilc_msgqueue.h
drivers/staging/wilc1000/wilc_osconfig.h
drivers/staging/wilc1000/wilc_oswrapper.h
drivers/staging/wilc1000/wilc_platform.h

index c1d0dabed4795d6053c337afad90fd7ce97b5782..1113092398d18590cf3af035076d8f6c9f6269e8 100644 (file)
@@ -1,8 +1,6 @@
 
 #include "wilc_oswrapper.h"
 #include <linux/spinlock.h>
-#ifdef CONFIG_WILC_MSG_QUEUE_FEATURE
-
 
 /*!
  *  @author            syounan
@@ -154,11 +152,6 @@ WILC_ErrNo WILC_MsgQueueRecv(WILC_MsgQueueHandle *pHandle,
        spin_unlock_irqrestore(&pHandle->strCriticalSection, flags);
 
        WILC_SemaphoreFillDefault(&strSemAttrs);
-       #ifdef CONFIG_WILC_MSG_QUEUE_TIMEOUT
-       if (pstrAttrs != WILC_NULL) {
-               strSemAttrs.u32TimeOut = pstrAttrs->u32Timeout;
-       }
-       #endif
        s32RetStatus = WILC_SemaphoreAcquire(&(pHandle->hSem), &strSemAttrs);
        if (s32RetStatus == WILC_TIMEOUT) {
                /* timed out, just exit without consumeing the message */
@@ -207,5 +200,3 @@ WILC_ErrNo WILC_MsgQueueRecv(WILC_MsgQueueHandle *pHandle,
 
        return s32RetStatus;
 }
-
-#endif
index a48be533aad9a2145c90b1d88108df456a945a1b..84157368335df267710c17b0a378897ea51be10a 100644 (file)
  *  @version   1.0
  */
 
-#ifndef CONFIG_WILC_MSG_QUEUE_FEATURE
-#error the feature CONFIG_WILC_MSG_QUEUE_FEATURE must be supported to include this file
-#endif
-
 /*!
  *  @struct             tstrWILC_MsgQueueAttrs
  *  @brief             Message Queue API options
  *  @version           1.0
  */
 typedef struct {
-       #ifdef CONFIG_WILC_MSG_QUEUE_IPC_NAME
-       WILC_Char *pcName;
-       #endif
-
-       #ifdef CONFIG_WILC_MSG_QUEUE_TIMEOUT
-       WILC_Uint32 u32Timeout;
-       #endif
-
        /* a dummy member to avoid compiler errors*/
        WILC_Uint8 dummy;
 
 } tstrWILC_MsgQueueAttrs;
 
-/*!
- *  @brief             Fills the MsgQueueAttrs with default parameters
- *  @param[out]        pstrAttrs structure to be filled
- *  @sa                        WILC_TimerAttrs
- *  @author            syounan
- *  @date              30 Aug 2010
- *  @version           1.0
- */
-static void WILC_MsgQueueFillDefault(tstrWILC_MsgQueueAttrs *pstrAttrs)
-{
-       #ifdef CONFIG_WILC_MSG_QUEUE_IPC_NAME
-       pstrAttrs->pcName = WILC_NULL;
-       #endif
-
-       #ifdef CONFIG_WILC_MSG_QUEUE_TIMEOUT
-       pstrAttrs->u32Timeout = WILC_OS_INFINITY;
-       #endif
-}
 /*!
  *  @brief             Creates a new Message queue
  *  @details           Creates a new Message queue, if the feature
index f18615e09400c7c75eb3fd5ec92dc26916096d97..d89864c7697c216c9edceb4f5dc17a7780b6d15d 100644 (file)
@@ -20,9 +20,6 @@
 /* #define CONFIG_WILC_MEMORY_POOLS 1 */
 /* #define CONFIG_WILC_MEMORY_DEBUG 1 */
 /* #define CONFIG_WILC_ASSERTION_SUPPORT 1 */
-#define CONFIG_WILC_MSG_QUEUE_FEATURE
-/* #define CONFIG_WILC_MSG_QUEUE_IPC_NAME */
-/* #define CONFIG_WILC_MSG_QUEUE_TIMEOUT */
 /* #define CONFIG_WILC_FILE_OPERATIONS_FEATURE */
 /* #define CONFIG_WILC_FILE_OPERATIONS_STRING_API */
 /* #define CONFIG_WILC_FILE_OPERATIONS_PATH_API */
index c4e97ae03ae090c1868a7a38c8974d44d681ff75..8b4c3dced981bd7b0786ae89af57542ba2b25c4a 100644 (file)
@@ -78,9 +78,7 @@ typedef WILC_Uint16 WILC_WideChar;
 #include "wilc_strutils.h"
 
 /* Message Queue */
-#ifdef CONFIG_WILC_MSG_QUEUE_FEATURE
 #include "wilc_msgqueue.h"
-#endif
 
 /* File operations */
 #ifdef CONFIG_WILC_FILE_OPERATIONS_FEATURE
index b20bbb839e5a4fe3125f4581b3860f181b7906b0..2f648498956518cc186f2a0e1615757fdf84a15b 100644 (file)
 #error This feature is not supported by this OS
 #endif
 
-/* CONFIG_WILC_MSG_QUEUE_FEATURE is implemented */
-
-/* remove the following block when implementing its feature */
-#ifdef CONFIG_WILC_MSG_QUEUE_IPC_NAME
-#error This feature is not supported by this OS
-#endif
-
-/* remove the following block when implementing its feature */
-/*#ifdef CONFIG_WILC_MSG_QUEUE_TIMEOUT
- * #error This feature is not supported by this OS
- #endif*/
-
 /* CONFIG_WILC_FILE_OPERATIONS_FEATURE is implemented */
 
 /* CONFIG_WILC_FILE_OPERATIONS_STRING_API is implemented */