staging: wilc1000: remove unused memory handling code
authorArnd Bergmann <arnd@arndb.de>
Mon, 1 Jun 2015 19:06:37 +0000 (21:06 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 2 Jun 2015 04:45:21 +0000 (13:45 +0900)
The driver contains its own abstraction for memory allocation,
most of it unused. This removes the unused parts, but the
rest should also be removed later.

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

index cf0976b443b8fac5179fa9ab55b5fdb8d97aa8b3..fbba38da19bcb924115b1b4677cfabeb5d34779a 100644 (file)
@@ -1,9 +1,6 @@
 
 #include "wilc_oswrapper.h"
 
-#ifdef CONFIG_WILC_MEMORY_FEATURE
-
-
 /*!
  *  @author    syounan
  *  @date      18 Aug 2010
@@ -59,5 +56,3 @@ void WILC_MemoryFree(void *pvBlock, tstrWILC_MemoryAttrs *strAttrs,
 {
        kfree(pvBlock);
 }
-
-#endif
index 1e45641af4547a62d7dde3869198083fb1b110c9..012f03cae0c8efd365f04ded573fd96cdd6ec83c 100644 (file)
  *  @version   1.0
  */
 
-#ifndef CONFIG_WILC_MEMORY_FEATURE
-#error the feature CONFIG_WILC_MEMORY_FEATURE must be supported to include this file
-#endif
-
 /*!
  *  @struct             tstrWILC_MemoryAttrs
  *  @brief             Memory API options
  *  @version           1.0
  */
 typedef struct {
-       #ifdef CONFIG_WILC_MEMORY_POOLS
-       /*!< the allocation pool to use for this memory, NULL for system
-        * allocation. Default is NULL
-        */
-       WILC_MemoryPoolHandle *pAllocationPool;
-       #endif
-
-       /* a dummy member to avoid compiler errors*/
-       WILC_Uint8 dummy;
 } tstrWILC_MemoryAttrs;
 
-/*!
- *  @brief     Fills the tstrWILC_MemoryAttrs with default parameters
- *  @param[out]        pstrAttrs structure to be filled
- *  @sa                tstrWILC_MemoryAttrs
- *  @author    syounan
- *  @date      16 Aug 2010
- *  @version   1.0
- */
-static void WILC_MemoryFillDefault(tstrWILC_MemoryAttrs *pstrAttrs)
-{
-       #ifdef CONFIG_WILC_MEMORY_POOLS
-       pstrAttrs->pAllocationPool = WILC_NULL;
-       #endif
-}
-
 /*!
  *  @brief     Allocates a given size of bytes
  *  @param[in] u32Size size of memory in bytes to be allocated
@@ -144,69 +116,6 @@ void *WILC_MemoryRealloc(void *pvOldBlock, WILC_Uint32 u32NewSize,
 void WILC_MemoryFree(void *pvBlock, tstrWILC_MemoryAttrs *strAttrs,
                        WILC_Char *pcFileName, WILC_Uint32 u32LineNo);
 
-/*!
- *  @brief     Creates a new memory pool
- *  @param[out]        pHandle the handle to the new Pool
- *  @param[in] u32PoolSize The pool size in bytes
- *  @param[in] strAttrs Optional attributes, NULL for default
- *  @return    Error code indicating sucess/failure
- *  @sa                sttrWILC_MemoryAttrs
- *  @author    syounan
- *  @date      16 Aug 2010
- *  @version   1.0
- */
-WILC_ErrNo WILC_MemoryNewPool(WILC_MemoryPoolHandle *pHandle, WILC_Uint32 u32PoolSize,
-                             tstrWILC_MemoryAttrs *strAttrs);
-
-/*!
- *  @brief     Deletes a memory pool, freeing all memory allocated from it as well
- *  @param[in] pHandle the handle to the deleted Pool
- *  @param[in] strAttrs Optional attributes, NULL for default
- *  @return    Error code indicating sucess/failure
- *  @sa                sttrWILC_MemoryAttrs
- *  @author    syounan
- *  @date      16 Aug 2010
- *  @version   1.0
- */
-WILC_ErrNo WILC_MemoryDelPool(WILC_MemoryPoolHandle *pHandle, tstrWILC_MemoryAttrs *strAttrs);
-
-
-#ifdef CONFIG_WILC_MEMORY_DEBUG
-
-/*!
- * @brief      standrad malloc wrapper with custom attributes
- */
-       #define WILC_MALLOC_EX(__size__, __attrs__) \
-       (WILC_MemoryAlloc( \
-                (__size__), __attrs__, \
-                (WILC_Char *)__WILC_FILE__, (WILC_Uint32)__WILC_LINE__))
-
-/*!
- * @brief      standrad calloc wrapper with custom attributes
- */
-       #define WILC_CALLOC_EX(__size__, __attrs__) \
-       (WILC_MemoryCalloc( \
-                (__size__), __attrs__, \
-                (WILC_Char *)__WILC_FILE__, (WILC_Uint32)__WILC_LINE__))
-
-/*!
- * @brief      standrad realloc wrapper with custom attributes
- */
-       #define WILC_REALLOC_EX(__ptr__, __new_size__, __attrs__) \
-       (WILC_MemoryRealloc( \
-                (__ptr__), (__new_size__), __attrs__, \
-                (WILC_Char *)__WILC_FILE__, (WILC_Uint32)__WILC_LINE__))
-
-/*!
- * @brief      standrad free wrapper with custom attributes
- */
-       #define WILC_FREE_EX(__ptr__, __attrs__) \
-       (WILC_MemoryFree( \
-                (__ptr__), __attrs__, \
-                (WILC_Char *)__WILC_FILE__, (WILC_Uint32)__WILC_LINE__))
-
-#else
-
 /*!
  * @brief      standrad malloc wrapper with custom attributes
  */
@@ -234,8 +143,6 @@ WILC_ErrNo WILC_MemoryDelPool(WILC_MemoryPoolHandle *pHandle, tstrWILC_MemoryAtt
        (WILC_MemoryFree( \
                 (__ptr__), __attrs__, WILC_NULL, 0))
 
-#endif
-
 /*!
  * @brief      Allocates a block (with custom attributes) of given type and number of
  * elements
index d89864c7697c216c9edceb4f5dc17a7780b6d15d..eec93b351f147dd3a5e9f274235973b8379be4e2 100644 (file)
@@ -16,9 +16,6 @@
 #define CONFIG_WILC_SLEEP_HI_RES 1
 #define CONFIG_WILC_TIMER_FEATURE 1
 /* #define CONFIG_WILC_TIMER_PERIODIC 1 */
-#define CONFIG_WILC_MEMORY_FEATURE 1
-/* #define CONFIG_WILC_MEMORY_POOLS 1 */
-/* #define CONFIG_WILC_MEMORY_DEBUG 1 */
 /* #define CONFIG_WILC_ASSERTION_SUPPORT 1 */
 /* #define CONFIG_WILC_FILE_OPERATIONS_FEATURE */
 /* #define CONFIG_WILC_FILE_OPERATIONS_STRING_API */
index 8b4c3dced981bd7b0786ae89af57542ba2b25c4a..fd5dd3c6316e11064310d260346d849e907b5a08 100644 (file)
@@ -70,9 +70,7 @@ typedef WILC_Uint16 WILC_WideChar;
 #endif
 
 /* Memory support */
-#ifdef CONFIG_WILC_MEMORY_FEATURE
 #include "wilc_memory.h"
-#endif
 
 /* String Utilities */
 #include "wilc_strutils.h"
index 2f648498956518cc186f2a0e1615757fdf84a15b..36e2e707354beb848afaa669c19df1479b5c3e50 100644 (file)
 
 /* CONFIG_WILC_TIMER_PERIODIC is implemented */
 
-/* CONFIG_WILC_MEMORY_FEATURE is implemented */
-
-/* remove the following block when implementing its feature */
-#ifdef CONFIG_WILC_MEMORY_POOLS
-#error This feature is not supported by this OS
-#endif
-
-/* remove the following block when implementing its feature */
-#ifdef CONFIG_WILC_MEMORY_DEBUG
-#error This feature is not supported by this OS
-#endif
-
 /* remove the following block when implementing its feature */
 #ifdef CONFIG_WILC_ASSERTION_SUPPORT
 #error This feature is not supported by this OS
  *      OS specific types
  *******************************************************************/
 
-typedef void *WILC_MemoryPoolHandle;
 typedef struct semaphore WILC_SemaphoreHandle;
 
 typedef struct timer_list WILC_TimerHandle;