fixed below checkpatch error.
-ERROR: trailing whitespace
Signed-off-by: Toshiaki Yamane <[email protected]>
---
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
fixed some checkpatch below error.
-ERROR: Macros with complex values should be enclosed in parenthesis
Signed-off-by: Toshiaki Yamane <[email protected]>
---
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
fixed some checkpatch warnings.
-WARNING: line over 80 characters
-WARNING: please, no space before tabs
Signed-off-by: Toshiaki Yamane <[email protected]>
---
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
On Tue, 2012-10-02 at 20:53 +0900, YAMANE Toshiaki wrote:
> fixed below checkpatch error.
>
> -ERROR: trailing whitespace
>
> Signed-off-by: Toshiaki Yamane <[email protected]>
> ---
> 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 <[email protected]>
Intel Finland Oy
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 <[email protected]>
> ---
> 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 <[email protected]>
Intel Finland Oy
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 <[email protected]>
> ---
> 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
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
On Tue, Oct 2, 2012 at 9:12 PM, Andy Shevchenko
<[email protected]> 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 <[email protected]>
>> ---
>> 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
On Tue, Oct 2, 2012 at 9:21 PM, Dan Carpenter <[email protected]> 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 <[email protected]>
>> ---
>> 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
On Tue, Oct 2, 2012 at 9:23 PM, Dan Carpenter <[email protected]> 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