public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] Fix trailing whitespace in trace.h
@ 2012-10-02 11:53 YAMANE Toshiaki
  2012-10-02 11:54 ` [PATCH 2/3] Add parenthesis to macros with complex values " YAMANE Toshiaki
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: YAMANE Toshiaki @ 2012-10-02 11:53 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Andy Shevchenko; +Cc: devel, linux-kernel, YAMANE Toshiaki

fixed below checkpatch error.

-ERROR: trailing whitespace

Signed-off-by: Toshiaki Yamane <yamanetoshi@gmail.com>
---
 drivers/staging/rts_pstor/trace.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rts_pstor/trace.h b/drivers/staging/rts_pstor/trace.h
index cf60a1b..740999c 100644
--- a/drivers/staging/rts_pstor/trace.h
+++ b/drivers/staging/rts_pstor/trace.h
@@ -39,7 +39,7 @@ static inline char *filename(char *path)
 	while (*ptr != '\0') {
 		if ((*ptr == '\\') || (*ptr == '/'))
 			path = ptr + 1;
-		
+
 		ptr++;
 	}
 
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/3] Add parenthesis to macros with complex values in trace.h
  2012-10-02 11:53 [PATCH 1/3] Fix trailing whitespace in trace.h YAMANE Toshiaki
@ 2012-10-02 11:54 ` YAMANE Toshiaki
  2012-10-02 12:13   ` Andy Shevchenko
  2012-10-02 12:21   ` Dan Carpenter
  2012-10-02 11:54 ` [PATCH 3/3] Fix line over 80 character issue and space before tabs issue " YAMANE Toshiaki
  2012-10-02 12:12 ` [PATCH 1/3] Fix trailing whitespace " Andy Shevchenko
  2 siblings, 2 replies; 10+ messages in thread
From: YAMANE Toshiaki @ 2012-10-02 11:54 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Andy Shevchenko; +Cc: devel, linux-kernel, YAMANE Toshiaki

fixed some checkpatch below error.
-ERROR: Macros with complex values should be enclosed in parenthesis

Signed-off-by: Toshiaki Yamane <yamanetoshi@gmail.com>
---
 drivers/staging/rts_pstor/trace.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rts_pstor/trace.h b/drivers/staging/rts_pstor/trace.h
index 740999c..a34493c 100644
--- a/drivers/staging/rts_pstor/trace.h
+++ b/drivers/staging/rts_pstor/trace.h
@@ -78,8 +78,8 @@ do {													\
 	goto label; 											\
 } while (0)
 #else
-#define TRACE_RET(chip, ret)	return ret
-#define TRACE_GOTO(chip, label)	goto label
+#define TRACE_RET(chip, ret)	return(ret)
+#define TRACE_GOTO(chip, label)	goto(label)
 #endif
 
 #ifdef CONFIG_RTS_PSTOR_DEBUG
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/3] Fix line over 80 character issue and space before tabs issue in trace.h
  2012-10-02 11:53 [PATCH 1/3] Fix trailing whitespace in trace.h YAMANE Toshiaki
  2012-10-02 11:54 ` [PATCH 2/3] Add parenthesis to macros with complex values " YAMANE Toshiaki
@ 2012-10-02 11:54 ` YAMANE Toshiaki
  2012-10-02 12:23   ` Dan Carpenter
  2012-10-02 12:12 ` [PATCH 1/3] Fix trailing whitespace " Andy Shevchenko
  2 siblings, 1 reply; 10+ messages in thread
From: YAMANE Toshiaki @ 2012-10-02 11:54 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Andy Shevchenko; +Cc: devel, linux-kernel, YAMANE Toshiaki

fixed some checkpatch warnings.

-WARNING: line over 80 characters
-WARNING: please, no space before tabs

Signed-off-by: Toshiaki Yamane <yamanetoshi@gmail.com>
---
 drivers/staging/rts_pstor/trace.h |   62 ++++++++++++++++++++-----------------
 1 file changed, 34 insertions(+), 28 deletions(-)

diff --git a/drivers/staging/rts_pstor/trace.h b/drivers/staging/rts_pstor/trace.h
index a34493c..fdc48cc 100644
--- a/drivers/staging/rts_pstor/trace.h
+++ b/drivers/staging/rts_pstor/trace.h
@@ -46,36 +46,42 @@ static inline char *filename(char *path)
 	return path;
 }
 
-#define TRACE_RET(chip, ret)   										\
-do {													\
-	char *_file = filename(__FILE__);								\
-	RTSX_DEBUGP("[%s][%s]:[%d]\n", _file, __func__, __LINE__);					\
-	(chip)->trace_msg[(chip)->msg_idx].line = (u16)(__LINE__);					\
-	strncpy((chip)->trace_msg[(chip)->msg_idx].func, __func__, MSG_FUNC_LEN-1);			\
-	strncpy((chip)->trace_msg[(chip)->msg_idx].file, _file, MSG_FILE_LEN-1); 			\
-	get_current_time((chip)->trace_msg[(chip)->msg_idx].timeval_buf, TIME_VAL_LEN);			\
-	(chip)->trace_msg[(chip)->msg_idx].valid = 1;							\
-	(chip)->msg_idx++; 										\
-	if ((chip)->msg_idx >= TRACE_ITEM_CNT) { 							\
-		(chip)->msg_idx = 0;									\
-	}												\
-	return ret; 											\
+#define TRACE_RET(chip, ret) \
+do { \
+	char *_file = filename(__FILE__); \
+	RTSX_DEBUGP("[%s][%s]:[%d]\n", _file, __func__, __LINE__); \
+	(chip)->trace_msg[(chip)->msg_idx].line = (u16)(__LINE__); \
+	strncpy((chip)->trace_msg[(chip)->msg_idx].func, \
+		__func__, MSG_FUNC_LEN-1); \
+	strncpy((chip)->trace_msg[(chip)->msg_idx].file, \
+		_file, MSG_FILE_LEN-1); \
+	get_current_time((chip)->trace_msg[(chip)->msg_idx].timeval_buf, \
+			 TIME_VAL_LEN); \
+	(chip)->trace_msg[(chip)->msg_idx].valid = 1; \
+	(chip)->msg_idx++; \
+	if ((chip)->msg_idx >= TRACE_ITEM_CNT) { \
+		(chip)->msg_idx = 0; \
+	} \
+	return ret; \
 } while (0)
 
-#define TRACE_GOTO(chip, label)   									\
-do {													\
-	char *_file = filename(__FILE__);								\
-	RTSX_DEBUGP("[%s][%s]:[%d]\n", _file, __func__, __LINE__);					\
-	(chip)->trace_msg[(chip)->msg_idx].line = (u16)(__LINE__);					\
-	strncpy((chip)->trace_msg[(chip)->msg_idx].func, __func__, MSG_FUNC_LEN-1);			\
-	strncpy((chip)->trace_msg[(chip)->msg_idx].file, _file, MSG_FILE_LEN-1); 			\
-	get_current_time((chip)->trace_msg[(chip)->msg_idx].timeval_buf, TIME_VAL_LEN);			\
-	(chip)->trace_msg[(chip)->msg_idx].valid = 1;							\
-	(chip)->msg_idx++; 										\
-	if ((chip)->msg_idx >= TRACE_ITEM_CNT) { 							\
-		(chip)->msg_idx = 0;									\
-	}												\
-	goto label; 											\
+#define TRACE_GOTO(chip, label) \
+do { \
+	char *_file = filename(__FILE__); \
+	RTSX_DEBUGP("[%s][%s]:[%d]\n", _file, __func__, __LINE__); \
+	(chip)->trace_msg[(chip)->msg_idx].line = (u16)(__LINE__); \
+	strncpy((chip)->trace_msg[(chip)->msg_idx].func, \
+		__func__, MSG_FUNC_LEN-1); \
+	strncpy((chip)->trace_msg[(chip)->msg_idx].file, \
+		_file, MSG_FILE_LEN-1); \
+	get_current_time((chip)->trace_msg[(chip)->msg_idx].timeval_buf, \
+			 TIME_VAL_LEN); \
+	(chip)->trace_msg[(chip)->msg_idx].valid = 1; \
+	(chip)->msg_idx++; \
+	if ((chip)->msg_idx >= TRACE_ITEM_CNT) { \
+		(chip)->msg_idx = 0; \
+	} \
+	goto label; \
 } while (0)
 #else
 #define TRACE_RET(chip, ret)	return(ret)
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/3] Fix trailing whitespace in trace.h
  2012-10-02 11:53 [PATCH 1/3] Fix trailing whitespace in trace.h YAMANE Toshiaki
  2012-10-02 11:54 ` [PATCH 2/3] Add parenthesis to macros with complex values " YAMANE Toshiaki
  2012-10-02 11:54 ` [PATCH 3/3] Fix line over 80 character issue and space before tabs issue " YAMANE Toshiaki
@ 2012-10-02 12:12 ` Andy Shevchenko
  2012-10-03  0:18   ` Toshiaki Yamane
  2 siblings, 1 reply; 10+ messages in thread
From: Andy Shevchenko @ 2012-10-02 12:12 UTC (permalink / raw)
  To: YAMANE Toshiaki; +Cc: Greg Kroah-Hartman, devel, linux-kernel

On Tue, 2012-10-02 at 20:53 +0900, YAMANE Toshiaki wrote: 
> fixed below checkpatch error.
> 
> -ERROR: trailing whitespace
> 
> Signed-off-by: Toshiaki Yamane <yamanetoshi@gmail.com>
> ---
>  drivers/staging/rts_pstor/trace.h |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/rts_pstor/trace.h b/drivers/staging/rts_pstor/trace.h
> index cf60a1b..740999c 100644
> --- a/drivers/staging/rts_pstor/trace.h
> +++ b/drivers/staging/rts_pstor/trace.h
> @@ -39,7 +39,7 @@ static inline char *filename(char *path)
>  	while (*ptr != '\0') {
>  		if ((*ptr == '\\') || (*ptr == '/'))
>  			path = ptr + 1;
> -		
> +
>  		ptr++;
>  	}

For me it seems total filename() function could be squeezed to just strrchr(path, '/') + 1;
Moreover there is already basename() in the lib/dynamic_debug.c you
could rename, export and reuse.


-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/3] Add parenthesis to macros with complex values in trace.h
  2012-10-02 11:54 ` [PATCH 2/3] Add parenthesis to macros with complex values " YAMANE Toshiaki
@ 2012-10-02 12:13   ` Andy Shevchenko
  2012-10-02 12:21   ` Dan Carpenter
  1 sibling, 0 replies; 10+ messages in thread
From: Andy Shevchenko @ 2012-10-02 12:13 UTC (permalink / raw)
  To: YAMANE Toshiaki; +Cc: Greg Kroah-Hartman, devel, linux-kernel

On Tue, 2012-10-02 at 20:54 +0900, YAMANE Toshiaki wrote: 
> fixed some checkpatch below error.
> -ERROR: Macros with complex values should be enclosed in parenthesis
> 
> Signed-off-by: Toshiaki Yamane <yamanetoshi@gmail.com>
> ---
>  drivers/staging/rts_pstor/trace.h |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/rts_pstor/trace.h b/drivers/staging/rts_pstor/trace.h
> index 740999c..a34493c 100644
> --- a/drivers/staging/rts_pstor/trace.h
> +++ b/drivers/staging/rts_pstor/trace.h
> @@ -78,8 +78,8 @@ do {													\
>  	goto label; 											\
>  } while (0)
>  #else
> -#define TRACE_RET(chip, ret)	return ret
> -#define TRACE_GOTO(chip, label)	goto label
> +#define TRACE_RET(chip, ret)	return(ret)
> +#define TRACE_GOTO(chip, label)	goto(label)
>  #endif
In this specific case I think checkpatch.pl wants more than needed.


-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/3] Add parenthesis to macros with complex values in trace.h
  2012-10-02 11:54 ` [PATCH 2/3] Add parenthesis to macros with complex values " YAMANE Toshiaki
  2012-10-02 12:13   ` Andy Shevchenko
@ 2012-10-02 12:21   ` Dan Carpenter
  2012-10-03  0:19     ` Toshiaki Yamane
  1 sibling, 1 reply; 10+ messages in thread
From: Dan Carpenter @ 2012-10-02 12:21 UTC (permalink / raw)
  To: YAMANE Toshiaki; +Cc: Greg Kroah-Hartman, Andy Shevchenko, devel, linux-kernel

On Tue, Oct 02, 2012 at 08:54:28PM +0900, YAMANE Toshiaki wrote:
> fixed some checkpatch below error.
> -ERROR: Macros with complex values should be enclosed in parenthesis
> 
> Signed-off-by: Toshiaki Yamane <yamanetoshi@gmail.com>
> ---
>  drivers/staging/rts_pstor/trace.h |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/rts_pstor/trace.h b/drivers/staging/rts_pstor/trace.h
> index 740999c..a34493c 100644
> --- a/drivers/staging/rts_pstor/trace.h
> +++ b/drivers/staging/rts_pstor/trace.h
> @@ -78,8 +78,8 @@ do {													\
>  	goto label; 											\
>  } while (0)
>  #else
> -#define TRACE_RET(chip, ret)	return ret
> -#define TRACE_GOTO(chip, label)	goto label
> +#define TRACE_RET(chip, ret)	return(ret)
> +#define TRACE_GOTO(chip, label)	goto(label)

This will cause a compile error.

There is no need to do this, checkpatch.pl is wrong here.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 3/3] Fix line over 80 character issue and space before tabs issue in trace.h
  2012-10-02 11:54 ` [PATCH 3/3] Fix line over 80 character issue and space before tabs issue " YAMANE Toshiaki
@ 2012-10-02 12:23   ` Dan Carpenter
  2012-10-03  0:19     ` Toshiaki Yamane
  0 siblings, 1 reply; 10+ messages in thread
From: Dan Carpenter @ 2012-10-02 12:23 UTC (permalink / raw)
  To: YAMANE Toshiaki; +Cc: Greg Kroah-Hartman, Andy Shevchenko, devel, linux-kernel

On Tue, Oct 02, 2012 at 08:54:48PM +0900, YAMANE Toshiaki wrote:
> fixed some checkpatch warnings.
> 
> -WARNING: line over 80 characters
> -WARNING: please, no space before tabs
> 

These looked nicer in the original, sorry.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/3] Fix trailing whitespace in trace.h
  2012-10-02 12:12 ` [PATCH 1/3] Fix trailing whitespace " Andy Shevchenko
@ 2012-10-03  0:18   ` Toshiaki Yamane
  0 siblings, 0 replies; 10+ messages in thread
From: Toshiaki Yamane @ 2012-10-03  0:18 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: Greg Kroah-Hartman, devel, linux-kernel

On Tue, Oct 2, 2012 at 9:12 PM, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> On Tue, 2012-10-02 at 20:53 +0900, YAMANE Toshiaki wrote:
>> fixed below checkpatch error.
>>
>> -ERROR: trailing whitespace
>>
>> Signed-off-by: Toshiaki Yamane <yamanetoshi@gmail.com>
>> ---
>>  drivers/staging/rts_pstor/trace.h |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/staging/rts_pstor/trace.h b/drivers/staging/rts_pstor/trace.h
>> index cf60a1b..740999c 100644
>> --- a/drivers/staging/rts_pstor/trace.h
>> +++ b/drivers/staging/rts_pstor/trace.h
>> @@ -39,7 +39,7 @@ static inline char *filename(char *path)
>>       while (*ptr != '\0') {
>>               if ((*ptr == '\\') || (*ptr == '/'))
>>                       path = ptr + 1;
>> -
>> +
>>               ptr++;
>>       }
>
> For me it seems total filename() function could be squeezed to just strrchr(path, '/') + 1;
> Moreover there is already basename() in the lib/dynamic_debug.c you
> could rename, export and reuse.

I will destroy this patch series.
thanks.


YAMANE Toshiaki

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/3] Add parenthesis to macros with complex values in trace.h
  2012-10-02 12:21   ` Dan Carpenter
@ 2012-10-03  0:19     ` Toshiaki Yamane
  0 siblings, 0 replies; 10+ messages in thread
From: Toshiaki Yamane @ 2012-10-03  0:19 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Greg Kroah-Hartman, Andy Shevchenko, devel, linux-kernel

On Tue, Oct 2, 2012 at 9:21 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> On Tue, Oct 02, 2012 at 08:54:28PM +0900, YAMANE Toshiaki wrote:
>> fixed some checkpatch below error.
>> -ERROR: Macros with complex values should be enclosed in parenthesis
>>
>> Signed-off-by: Toshiaki Yamane <yamanetoshi@gmail.com>
>> ---
>>  drivers/staging/rts_pstor/trace.h |    4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/staging/rts_pstor/trace.h b/drivers/staging/rts_pstor/trace.h
>> index 740999c..a34493c 100644
>> --- a/drivers/staging/rts_pstor/trace.h
>> +++ b/drivers/staging/rts_pstor/trace.h
>> @@ -78,8 +78,8 @@ do {                                                                                                        \
>>       goto label;                                                                                     \
>>  } while (0)
>>  #else
>> -#define TRACE_RET(chip, ret) return ret
>> -#define TRACE_GOTO(chip, label)      goto label
>> +#define TRACE_RET(chip, ret) return(ret)
>> +#define TRACE_GOTO(chip, label)      goto(label)
>
> This will cause a compile error.
>
> There is no need to do this, checkpatch.pl is wrong here.

I will destroy this patch series.
thanks.


YAMANE Toshiaki

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 3/3] Fix line over 80 character issue and space before tabs issue in trace.h
  2012-10-02 12:23   ` Dan Carpenter
@ 2012-10-03  0:19     ` Toshiaki Yamane
  0 siblings, 0 replies; 10+ messages in thread
From: Toshiaki Yamane @ 2012-10-03  0:19 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Greg Kroah-Hartman, Andy Shevchenko, devel, linux-kernel

On Tue, Oct 2, 2012 at 9:23 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> On Tue, Oct 02, 2012 at 08:54:48PM +0900, YAMANE Toshiaki wrote:
>> fixed some checkpatch warnings.
>>
>> -WARNING: line over 80 characters
>> -WARNING: please, no space before tabs
>>
>
> These looked nicer in the original, sorry.

I will destroy this patch series.
thanks.


YAMANE Toshiaki

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-10-03  0:19 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-02 11:53 [PATCH 1/3] Fix trailing whitespace in trace.h YAMANE Toshiaki
2012-10-02 11:54 ` [PATCH 2/3] Add parenthesis to macros with complex values " YAMANE Toshiaki
2012-10-02 12:13   ` Andy Shevchenko
2012-10-02 12:21   ` Dan Carpenter
2012-10-03  0:19     ` Toshiaki Yamane
2012-10-02 11:54 ` [PATCH 3/3] Fix line over 80 character issue and space before tabs issue " YAMANE Toshiaki
2012-10-02 12:23   ` Dan Carpenter
2012-10-03  0:19     ` Toshiaki Yamane
2012-10-02 12:12 ` [PATCH 1/3] Fix trailing whitespace " Andy Shevchenko
2012-10-03  0:18   ` Toshiaki Yamane

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox