[PATCH 1/4] staging: wilc1000: delete wilc_log.h

Subsystems: staging subsystem, the rest

STALE4004d

8 messages, 3 authors, 2015-08-17 · open the first message on its own page

[PATCH 1/4] staging: wilc1000: delete wilc_log.h

From: Chaehyun Lim <hidden>
Date: 2015-08-17 13:44:40

The macros in wilc_log.h are not referenced anywhere, so just delete it.

Signed-off-by: Chaehyun Lim <redacted>
---
 drivers/staging/wilc1000/wilc_log.h       | 47 -------------------------------
 drivers/staging/wilc1000/wilc_oswrapper.h |  2 --
 2 files changed, 49 deletions(-)
 delete mode 100644 drivers/staging/wilc1000/wilc_log.h
diff --git a/drivers/staging/wilc1000/wilc_log.h b/drivers/staging/wilc1000/wilc_log.h
deleted file mode 100644
index 2269ebd..0000000
--- a/drivers/staging/wilc1000/wilc_log.h
+++ /dev/null
@@ -1,47 +0,0 @@
-#ifndef __WILC_LOG_H__
-#define __WILC_LOG_H__
-
-/* Errors will always get printed */
-#define WILC_ERROR(...) do {  WILC_PRINTF("(ERR)(%s:%d) ", __WILC_FUNCTION__, __WILC_LINE__); \
-			      WILC_PRINTF(__VA_ARGS__); \
-				} while (0)
-
-/* Wraning only printed if verbosity is 1 or more */
-#if (WILC_LOG_VERBOSITY_LEVEL > 0)
-#define WILC_WARN(...) do { WILC_PRINTF("(WRN)"); \
-			    WILC_PRINTF(__VA_ARGS__); \
-				} while (0)
-#else
-#define WILC_WARN(...) (0)
-#endif
-
-/* Info only printed if verbosity is 2 or more */
-#if (WILC_LOG_VERBOSITY_LEVEL > 1)
-#define WILC_INFO(...) do {  WILC_PRINTF("(INF)"); \
-			     WILC_PRINTF(__VA_ARGS__); \
-				} while (0)
-#else
-#define WILC_INFO(...) (0)
-#endif
-
-/* Debug is only printed if verbosity is 3 or more */
-#if (WILC_LOG_VERBOSITY_LEVEL > 2)
-#define WILC_DBG(...) do { WILC_PRINTF("(DBG)(%s:%d) ", __WILC_FUNCTION__, __WILC_LINE__); \
-			   WILC_PRINTF(__VA_ARGS__); \
-			} while (0)
-
-#else
-#define WILC_DBG(...) (0)
-#endif
-
-/* Function In/Out is only printed if verbosity is 4 or more */
-#if (WILC_LOG_VERBOSITY_LEVEL > 3)
-#define WILC_FN_IN do { WILC_PRINTF("(FIN) (%s:%d) \n", __WILC_FUNCTION__, __WILC_LINE__);  } while (0)
-#define WILC_FN_OUT(ret) do { WILC_PRINTF("(FOUT) (%s:%d) %d.\n", __WILC_FUNCTION__, __WILC_LINE__, (ret));  } while (0)
-#else
-#define WILC_FN_IN (0)
-#define WILC_FN_OUT(ret) (0)
-#endif
-
-
-#endif
\ No newline at end of file
diff --git a/drivers/staging/wilc1000/wilc_oswrapper.h b/drivers/staging/wilc1000/wilc_oswrapper.h
index 374e33b..68e091f 100644
--- a/drivers/staging/wilc1000/wilc_oswrapper.h
+++ b/drivers/staging/wilc1000/wilc_oswrapper.h
@@ -17,8 +17,6 @@
 #include "wilc_osconfig.h"
 #include "wilc_platform.h"
 
-/* Logging Functions */
-#include "wilc_log.h"
 
 /* Error reporting and handling support */
 #include "wilc_errorsupport.h"
-- 
1.9.1

[PATCH 2/4] staging: wilc1000: delete wilc_osconfig.h

From: Chaehyun Lim <hidden>
Date: 2015-08-17 13:44:42

The macros inside wilc_osconfig.h are not referenced anywhere,
so just delete it.

Signed-off-by: Chaehyun Lim <redacted>
---
 drivers/staging/wilc1000/wilc_osconfig.h  | 9 ---------
 drivers/staging/wilc1000/wilc_oswrapper.h | 1 -
 2 files changed, 10 deletions(-)
 delete mode 100644 drivers/staging/wilc1000/wilc_osconfig.h
diff --git a/drivers/staging/wilc1000/wilc_osconfig.h b/drivers/staging/wilc1000/wilc_osconfig.h
deleted file mode 100644
index f9c2514..0000000
--- a/drivers/staging/wilc1000/wilc_osconfig.h
+++ /dev/null
@@ -1,9 +0,0 @@
-/* Logs options */
-#define WILC_LOGS_NOTHING          0
-#define WILC_LOGS_WARN             1
-#define WILC_LOGS_WARN_INFO        2
-#define WILC_LOGS_WARN_INFO_DBG    3
-#define WILC_LOGS_WARN_INFO_DBG_FN 4
-#define WILC_LOGS_ALL              5
-
-#define WILC_LOG_VERBOSITY_LEVEL WILC_LOGS_ALL
diff --git a/drivers/staging/wilc1000/wilc_oswrapper.h b/drivers/staging/wilc1000/wilc_oswrapper.h
index 68e091f..45df626 100644
--- a/drivers/staging/wilc1000/wilc_oswrapper.h
+++ b/drivers/staging/wilc1000/wilc_oswrapper.h
@@ -14,7 +14,6 @@
 #define WILC_OSW_INTERFACE_VER 2
 
 /* Os Configuration File */
-#include "wilc_osconfig.h"
 #include "wilc_platform.h"
 
 
-- 
1.9.1

[PATCH 3/4] staging: wilc1000: remove WILC_ErrNo

From: Chaehyun Lim <hidden>
Date: 2015-08-17 13:44:45

WILC_ErrNo is replaced by s32, then WILC_ErrNo typedef is removed.

Signed-off-by: Chaehyun Lim <redacted>
---
 drivers/staging/wilc1000/wilc_errorsupport.h |  2 --
 drivers/staging/wilc1000/wilc_msgqueue.c     | 12 ++++++------
 drivers/staging/wilc1000/wilc_msgqueue.h     |  8 ++++----
 drivers/staging/wilc1000/wilc_timer.c        |  4 ++--
 drivers/staging/wilc1000/wilc_timer.h        |  4 ++--
 5 files changed, 14 insertions(+), 16 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_errorsupport.h b/drivers/staging/wilc1000/wilc_errorsupport.h
index b9517dc..6012ec4 100644
--- a/drivers/staging/wilc1000/wilc_errorsupport.h
+++ b/drivers/staging/wilc1000/wilc_errorsupport.h
@@ -36,8 +36,6 @@
 #define WILC_FILE_EOF			-116
 
 
-/* Error type */
-typedef s32 WILC_ErrNo;
 
 #define WILC_IS_ERR(__status__) (__status__ < WILC_SUCCESS)
 
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c
index 9783c15..dd87448 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -8,7 +8,7 @@
  *  @note		copied from FLO glue implementatuion
  *  @version		1.0
  */
-WILC_ErrNo WILC_MsgQueueCreate(WILC_MsgQueueHandle *pHandle,
+s32 WILC_MsgQueueCreate(WILC_MsgQueueHandle *pHandle,
 			       tstrWILC_MsgQueueAttrs *pstrAttrs)
 {
 	spin_lock_init(&pHandle->strCriticalSection);
@@ -25,7 +25,7 @@ WILC_ErrNo WILC_MsgQueueCreate(WILC_MsgQueueHandle *pHandle,
  *  @note		copied from FLO glue implementatuion
  *  @version		1.0
  */
-WILC_ErrNo WILC_MsgQueueDestroy(WILC_MsgQueueHandle *pHandle,
+s32 WILC_MsgQueueDestroy(WILC_MsgQueueHandle *pHandle,
 				tstrWILC_MsgQueueAttrs *pstrAttrs)
 {
 
@@ -52,11 +52,11 @@ WILC_ErrNo WILC_MsgQueueDestroy(WILC_MsgQueueHandle *pHandle,
  *  @note		copied from FLO glue implementatuion
  *  @version		1.0
  */
-WILC_ErrNo WILC_MsgQueueSend(WILC_MsgQueueHandle *pHandle,
+s32 WILC_MsgQueueSend(WILC_MsgQueueHandle *pHandle,
 			     const void *pvSendBuffer, u32 u32SendBufferSize,
 			     tstrWILC_MsgQueueAttrs *pstrAttrs)
 {
-	WILC_ErrNo s32RetStatus = WILC_SUCCESS;
+	s32 s32RetStatus = WILC_SUCCESS;
 	unsigned long flags;
 	Message *pstrMessage = NULL;
 
@@ -117,14 +117,14 @@ WILC_ErrNo WILC_MsgQueueSend(WILC_MsgQueueHandle *pHandle,
  *  @note		copied from FLO glue implementatuion
  *  @version		1.0
  */
-WILC_ErrNo WILC_MsgQueueRecv(WILC_MsgQueueHandle *pHandle,
+s32 WILC_MsgQueueRecv(WILC_MsgQueueHandle *pHandle,
 			     void *pvRecvBuffer, u32 u32RecvBufferSize,
 			     u32 *pu32ReceivedLength,
 			     tstrWILC_MsgQueueAttrs *pstrAttrs)
 {
 
 	Message *pstrMessage;
-	WILC_ErrNo s32RetStatus = WILC_SUCCESS;
+	s32 s32RetStatus = WILC_SUCCESS;
 	unsigned long flags;
 	if ((pHandle == NULL) || (u32RecvBufferSize == 0)
 	    || (pvRecvBuffer == NULL) || (pu32ReceivedLength == NULL)) {
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h b/drivers/staging/wilc1000/wilc_msgqueue.h
index de374ac..70c1148 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.h
+++ b/drivers/staging/wilc1000/wilc_msgqueue.h
@@ -41,7 +41,7 @@ typedef struct {
  *  @date		30 Aug 2010
  *  @version		1.0
  */
-WILC_ErrNo WILC_MsgQueueCreate(WILC_MsgQueueHandle *pHandle,
+s32 WILC_MsgQueueCreate(WILC_MsgQueueHandle *pHandle,
 			       tstrWILC_MsgQueueAttrs *pstrAttrs);
 
 
@@ -61,7 +61,7 @@ WILC_ErrNo WILC_MsgQueueCreate(WILC_MsgQueueHandle *pHandle,
  *  @date		30 Aug 2010
  *  @version		1.0
  */
-WILC_ErrNo WILC_MsgQueueSend(WILC_MsgQueueHandle *pHandle,
+s32 WILC_MsgQueueSend(WILC_MsgQueueHandle *pHandle,
 			     const void *pvSendBuffer, u32 u32SendBufferSize,
 			     tstrWILC_MsgQueueAttrs *pstrAttrs);
 
@@ -83,7 +83,7 @@ WILC_ErrNo WILC_MsgQueueSend(WILC_MsgQueueHandle *pHandle,
  *  @date		30 Aug 2010
  *  @version		1.0
  */
-WILC_ErrNo WILC_MsgQueueRecv(WILC_MsgQueueHandle *pHandle,
+s32 WILC_MsgQueueRecv(WILC_MsgQueueHandle *pHandle,
 			     void *pvRecvBuffer, u32 u32RecvBufferSize,
 			     u32 *pu32ReceivedLength,
 			     tstrWILC_MsgQueueAttrs *pstrAttrs);
@@ -99,7 +99,7 @@ WILC_ErrNo WILC_MsgQueueRecv(WILC_MsgQueueHandle *pHandle,
  *  @date		30 Aug 2010
  *  @version		1.0
  */
-WILC_ErrNo WILC_MsgQueueDestroy(WILC_MsgQueueHandle *pHandle,
+s32 WILC_MsgQueueDestroy(WILC_MsgQueueHandle *pHandle,
 				tstrWILC_MsgQueueAttrs *pstrAttrs);
 
 
diff --git a/drivers/staging/wilc1000/wilc_timer.c b/drivers/staging/wilc1000/wilc_timer.c
index 775e38b..447c8bd 100644
--- a/drivers/staging/wilc1000/wilc_timer.c
+++ b/drivers/staging/wilc1000/wilc_timer.c
@@ -1,10 +1,10 @@
 
 #include "wilc_timer.h"
 
-WILC_ErrNo WILC_TimerStart(struct timer_list *pHandle, u32 u32Timeout,
+s32 WILC_TimerStart(struct timer_list *pHandle, u32 u32Timeout,
 	void *pvArg)
 {
-	WILC_ErrNo s32RetStatus = WILC_FAIL;
+	s32 s32RetStatus = WILC_FAIL;
 	if (pHandle != NULL) {
 		pHandle->data = (unsigned long)pvArg;
 		s32RetStatus = mod_timer(pHandle, (jiffies + msecs_to_jiffies(u32Timeout)));
diff --git a/drivers/staging/wilc1000/wilc_timer.h b/drivers/staging/wilc1000/wilc_timer.h
index 925c613..017206b 100644
--- a/drivers/staging/wilc1000/wilc_timer.h
+++ b/drivers/staging/wilc1000/wilc_timer.h
@@ -45,7 +45,7 @@ typedef void (*tpfWILC_TimerFunction)(void *);
  *  @date	16 Aug 2010
  *  @version	1.0
  */
-WILC_ErrNo WILC_TimerCreate(struct timer_list *pHandle,
+s32 WILC_TimerCreate(struct timer_list *pHandle,
 			    tpfWILC_TimerFunction pfCallback);
 
 /*!
@@ -65,6 +65,6 @@ WILC_ErrNo WILC_TimerCreate(struct timer_list *pHandle,
  *  @date	16 Aug 2010
  *  @version	1.0
  */
-WILC_ErrNo WILC_TimerStart(struct timer_list *pHandle, u32 u32Timeout, void *pvArg);
+s32 WILC_TimerStart(struct timer_list *pHandle, u32 u32Timeout, void *pvArg);
 
 #endif
-- 
1.9.1

[PATCH 4/4] staging: wilc1000: return -EINVAL for invalid argument checking

From: Chaehyun Lim <hidden>
Date: 2015-08-17 13:44:47

This patch uses -EINVAL for invalid argument checking instead of using
WILC_ERRORREPORT with WILC_INVALID_ARGUMENT.

Signed-off-by: Chaehyun Lim <redacted>
---
 drivers/staging/wilc1000/wilc_msgqueue.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c
index dd87448..561ff88 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -61,7 +61,7 @@ s32 WILC_MsgQueueSend(WILC_MsgQueueHandle *pHandle,
 	Message *pstrMessage = NULL;
 
 	if ((pHandle == NULL) || (u32SendBufferSize == 0) || (pvSendBuffer == NULL)) {
-		WILC_ERRORREPORT(s32RetStatus, WILC_INVALID_ARGUMENT);
+		return -EINVAL;
 	}
 
 	if (pHandle->bExiting == true) {
@@ -128,7 +128,7 @@ s32 WILC_MsgQueueRecv(WILC_MsgQueueHandle *pHandle,
 	unsigned long flags;
 	if ((pHandle == NULL) || (u32RecvBufferSize == 0)
 	    || (pvRecvBuffer == NULL) || (pu32ReceivedLength == NULL)) {
-		WILC_ERRORREPORT(s32RetStatus, WILC_INVALID_ARGUMENT);
+		return -EINVAL;
 	}
 
 	if (pHandle->bExiting == true) {
-- 
1.9.1

Re: [PATCH 3/4] staging: wilc1000: remove WILC_ErrNo

From: Dan Carpenter <hidden>
Date: 2015-08-17 14:23:46

On Mon, Aug 17, 2015 at 10:44:30PM +0900, Chaehyun Lim wrote:
WILC_ErrNo is replaced by s32, then WILC_ErrNo typedef is removed.
s32 is a weirdo type.  You should only specify the number of bit when it
is something required by the hardware.  Just use int.

regards,
dan carpenter

Re: [PATCH 1/4] staging: wilc1000: delete wilc_log.h

From: Greg KH <gregkh@linuxfoundation.org>
Date: 2015-08-17 19:51:40

On Mon, Aug 17, 2015 at 10:44:28PM +0900, Chaehyun Lim wrote:
The macros in wilc_log.h are not referenced anywhere, so just delete it.
Oops, I just did this same thing before I saw your email, sorry about
that.

greg k-h

Re: [PATCH 2/4] staging: wilc1000: delete wilc_osconfig.h

From: Greg KH <gregkh@linuxfoundation.org>
Date: 2015-08-17 19:52:06

On Mon, Aug 17, 2015 at 10:44:29PM +0900, Chaehyun Lim wrote:
The macros inside wilc_osconfig.h are not referenced anywhere,
so just delete it.

Signed-off-by: Chaehyun Lim <redacted>
And I did this one also, again, sorry, I hadn't seen your email yet.

greg k-h

Re: [PATCH 4/4] staging: wilc1000: return -EINVAL for invalid argument checking

From: Greg KH <gregkh@linuxfoundation.org>
Date: 2015-08-17 19:53:13

On Mon, Aug 17, 2015 at 10:44:31PM +0900, Chaehyun Lim wrote:
quoted hunk
This patch uses -EINVAL for invalid argument checking instead of using
WILC_ERRORREPORT with WILC_INVALID_ARGUMENT.

Signed-off-by: Chaehyun Lim <redacted>
---
 drivers/staging/wilc1000/wilc_msgqueue.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c
index dd87448..561ff88 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -61,7 +61,7 @@ s32 WILC_MsgQueueSend(WILC_MsgQueueHandle *pHandle,
 	Message *pstrMessage = NULL;
 
 	if ((pHandle == NULL) || (u32SendBufferSize == 0) || (pvSendBuffer == NULL)) {
-		WILC_ERRORREPORT(s32RetStatus, WILC_INVALID_ARGUMENT);
+		return -EINVAL;
Watch out, WILC_ERRORREPORT has a goto in it, so I don't know if you can
always just do a "simple" return like this.

greg k-h
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help