public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: Rachel Kim <rachel.kim@atmel.com>, Dean Lee <dean.lee@atmel.com>,
	Chris Park <chris.park@atmel.com>,
	devel@driverdev.osuosl.org, nicolas.ferre@atmel.com,
	Johnny Kim <johnny.kim@atmel.com>,
	linux-kernel@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>
Subject: [PATCH 08/16] staging: wilc1000: remove unused memory handling code
Date: Fri, 29 May 2015 22:52:19 +0200	[thread overview]
Message-ID: <1432932747-3739705-9-git-send-email-arnd@arndb.de> (raw)
In-Reply-To: <1432932747-3739705-1-git-send-email-arnd@arndb.de>

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>
---
 drivers/staging/wilc1000/wilc_memory.c    |  5 --
 drivers/staging/wilc1000/wilc_memory.h    | 93 -------------------------------
 drivers/staging/wilc1000/wilc_osconfig.h  |  3 -
 drivers/staging/wilc1000/wilc_oswrapper.h |  2 -
 drivers/staging/wilc1000/wilc_platform.h  | 13 -----
 5 files changed, 116 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_memory.c b/drivers/staging/wilc1000/wilc_memory.c
index cf0976b443b8..fbba38da19bc 100644
--- a/drivers/staging/wilc1000/wilc_memory.c
+++ b/drivers/staging/wilc1000/wilc_memory.c
@@ -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
diff --git a/drivers/staging/wilc1000/wilc_memory.h b/drivers/staging/wilc1000/wilc_memory.h
index 1e45641af454..012f03cae0c8 100644
--- a/drivers/staging/wilc1000/wilc_memory.h
+++ b/drivers/staging/wilc1000/wilc_memory.h
@@ -10,10 +10,6 @@
  *  @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
@@ -22,33 +18,9 @@
  *  @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
  *  @param[in]	strAttrs Optional attributes, NULL for default
@@ -145,69 +117,6 @@ 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
  */
 	#define WILC_MALLOC_EX(__size__, __attrs__) \
@@ -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
diff --git a/drivers/staging/wilc1000/wilc_osconfig.h b/drivers/staging/wilc1000/wilc_osconfig.h
index d89864c7697c..eec93b351f14 100644
--- a/drivers/staging/wilc1000/wilc_osconfig.h
+++ b/drivers/staging/wilc1000/wilc_osconfig.h
@@ -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 */
diff --git a/drivers/staging/wilc1000/wilc_oswrapper.h b/drivers/staging/wilc1000/wilc_oswrapper.h
index 8b4c3dced981..fd5dd3c6316e 100644
--- a/drivers/staging/wilc1000/wilc_oswrapper.h
+++ b/drivers/staging/wilc1000/wilc_oswrapper.h
@@ -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"
diff --git a/drivers/staging/wilc1000/wilc_platform.h b/drivers/staging/wilc1000/wilc_platform.h
index 2f6484989565..36e2e707354b 100644
--- a/drivers/staging/wilc1000/wilc_platform.h
+++ b/drivers/staging/wilc1000/wilc_platform.h
@@ -33,18 +33,6 @@
 
 /* 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
@@ -100,7 +88,6 @@
  *      OS specific types
  *******************************************************************/
 
-typedef void *WILC_MemoryPoolHandle;
 typedef struct semaphore WILC_SemaphoreHandle;
 
 typedef struct timer_list WILC_TimerHandle;
-- 
2.1.0.rc2


  parent reply	other threads:[~2015-05-29 20:53 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-29 20:52 [PATCH 00/16] wilc1000: dead code removal and other cleanup Arnd Bergmann
2015-05-29 20:52 ` [PATCH 01/16] staging: wilc1000: remove linux version checks Arnd Bergmann
2015-05-29 20:52 ` [PATCH 02/16] staging: wilc1000: remove platform " Arnd Bergmann
2015-05-29 20:52 ` [PATCH 03/16] staging: wilc1000: remove thread wrapper Arnd Bergmann
2015-05-29 20:52 ` [PATCH 04/16] staging: wilc1000: remove __DRIVER_VERSION__ macro Arnd Bergmann
2015-05-29 20:52 ` [PATCH 05/16] staging: wilc1000: remove time wrapper Arnd Bergmann
2015-05-30  6:39   ` Sudip Mukherjee
2015-05-30 23:58     ` Greg KH
2015-06-01 19:09       ` Arnd Bergmann
2015-05-29 20:52 ` [PATCH 06/16] staging: wilc1000: remove unused string functions Arnd Bergmann
2015-05-29 20:52 ` [PATCH 07/16] staging: wilc1000: simplify msgqueue code Arnd Bergmann
2015-05-29 20:52 ` Arnd Bergmann [this message]
2015-05-29 20:52 ` [PATCH 09/16] staging: wilc1000: simplify semaphore wrapper Arnd Bergmann
2015-05-29 20:52 ` [PATCH 10/16] staging: wilc1000: clean up sleep wrapper Arnd Bergmann
2015-05-29 20:52 ` [PATCH 11/16] staging: wilc1000: clean up timer feature Arnd Bergmann
2015-05-29 20:52 ` [PATCH 12/16] staging: wilc1000: remove unused OS abstraction features Arnd Bergmann
2015-05-29 20:52 ` [PATCH 13/16] staging: wilc1000: remove EXPORT_SYMTAB Arnd Bergmann
2015-05-29 20:52 ` [PATCH 14/16] staging: wilc1000: remove semaphore wrapper Arnd Bergmann
2015-05-30  6:46   ` Sudip Mukherjee
2015-05-29 20:52 ` [PATCH 15/16] staging: wilc1000: fix const cast warnings Arnd Bergmann
2015-05-29 20:52 ` [PATCH 16/16] staging: wilc1000: fix compiler warnings Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1432932747-3739705-9-git-send-email-arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=chris.park@atmel.com \
    --cc=dean.lee@atmel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=johnny.kim@atmel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicolas.ferre@atmel.com \
    --cc=rachel.kim@atmel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox