staging: mt7621-mmc: Use __func__ instead of __FUNCTION__ in dbg.h
Subsystems (2)
PATCH 1/1 staging: mt7621-mmc: Use __func__ instead of __FUNCTION__ in dbg.h
Use the identifier __func__ instead of gcc specific __FUNCTION__ in dbg.h. Limit these lines to 80 characters. Issues found by checkpatch.
--- drivers/staging/mt7621-mmc/dbg.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/staging/mt7621-mmc/dbg.h +5 -3
@@ -115,7 +115,8 @@ do { \ #define ERR_MSG(fmt, args...) \ do { \ printk(KERN_ERR TAG"%d -> "fmt" <- %s() : L<%d> PID<%s><0x%x>\n", \ - host->id, ##args, __FUNCTION__, __LINE__, current->comm, current->pid); \ + host->id, ##args, __func__, __LINE__, current->comm, \ + current->pid); \ } while (0);#if 1
@@ -126,14 +127,15 @@ do { \ #define INIT_MSG(fmt, args...) \ do { \ printk(KERN_ERR TAG"%d -> "fmt" <- %s() : L<%d> PID<%s><0x%x>\n", \ - host->id, ##args, __FUNCTION__, __LINE__, current->comm, current->pid); \ + host->id, ##args, __func__, __LINE__, current->comm, \ + current->pid); \ } while (0);/* PID in ISR in not corrent */ #define IRQ_MSG(fmt, args...) \ do { \ printk(KERN_ERR TAG"%d -> "fmt" <- %s() : L<%d>\n", \ - host->id, ##args, __FUNCTION__, __LINE__); \ + host->id, ##args, __func__, __LINE__); \ } while (0);#endif
Signature · 1 line
2.17.1
Quoted 3 lines · Nishad Kamdar
Use the identifier
__func__instead of gcc specific__FUNCTION__indbg.h. Limit these lines to 80 characters. Issues found by checkpatch.
It looks like there are 4 uses in -next
drivers/staging/mt7621-mmc/dbg.h:110: host->id, ##args , __FUNCTION__, __LINE__, current->comm, current->pid); \
drivers/staging/mt7621-mmc/dbg.h:118: host->id, ##args, __FUNCTION__, __LINE__, current->comm, current->pid); \ drivers/staging/mt7621-mmc/dbg.h:129: host->id, ##args, __FUNCTION__, __LINE__, current->comm, current->pid); \ drivers/staging/mt7621-mmc/dbg.h:136: host->id, ##args, __FUNCTION__, __LINE__); \
If you are going to fix this by substitution, please fix all of them, even if commented out.
And likely, all these uses should all be converted to dev_<level> instead without __func__ or __LINE__ or current->comm and current->pid.
And relatedly, these are single statement macros and don't need do while (0);
And the ; after while (0) is unnecessary.
Quoted 37 lines
Signed-off-by Nishad Kamdar <[email protected]>--- drivers/staging/mt7621-mmc/dbg.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)drivers/staging/mt7621-mmc/dbg.h +5
-3@@ -115,7 +115,8 @@ do { \ #define ERR_MSG(fmt, args...) \ do { \ printk(KERN_ERR TAG"%d -> "fmt" <- %s() : L<%d> PID<%s><0x%x>\n", \ - host->id, ##args, __FUNCTION__, __LINE__, current->comm, current->pid); \ + host->id, ##args, __func__, __LINE__, current->comm, \ + current->pid); \ } while (0);#if 1 @@ -126,14 +127,15 @@ do { \ #define INIT_MSG(fmt, args...) \ do { \ printk(KERN_ERR TAG"%d -> "fmt" <- %s() : L<%d> PID<%s><0x%x>\n", \ - host->id, ##args, __FUNCTION__, __LINE__, current->comm, current->pid); \ + host->id, ##args, __func__, __LINE__, current->comm, \ + current->pid); \ } while (0);/* PID in ISR in not corrent */ #define IRQ_MSG(fmt, args...) \ do { \ printk(KERN_ERR TAG"%d -> "fmt" <- %s() : L<%d>\n", \ - host->id, ##args, __FUNCTION__, __LINE__); \ + host->id, ##args, __func__, __LINE__); \ } while (0);#endif
Quoted 52 lines · Joe Perches
Quoted 3 lines · Nishad Kamdar
Use the identifier
__func__instead of gcc specific__FUNCTION__indbg.h. Limit these lines to 80 characters. Issues found by checkpatch.It looks like there are 4 uses in -next
drivers/staging/mt7621-mmc/dbg.h:110:host->id, ##args ,__FUNCTION__,__LINE__,current->comm,current->pid); \drivers/staging/mt7621-mmc/dbg.h:118: host->id, ##args, __FUNCTION__, __LINE__, current->comm, current->pid); \ drivers/staging/mt7621-mmc/dbg.h:129: host->id, ##args, __FUNCTION__, __LINE__, current->comm, current->pid); \ drivers/staging/mt7621-mmc/dbg.h:136: host->id, ##args, __FUNCTION__, __LINE__); \If you are going to fix this by substitution, please fix all of them, even if commented out.
And likely, all these uses should all be converted to dev_<level> instead without
__func__or__LINE__orcurrent->commandcurrent->pid.And relatedly, these are single statement macros and don't need do while (0);
And the ; after while (0) is unnecessary.
Quoted 28 lines
Signed-off-by Nishad Kamdar <[email protected]>--- drivers/staging/mt7621-mmc/dbg.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)drivers/staging/mt7621-mmc/dbg.h +4
-2@@ -115,7 +115,8 @@ do { \ #define ERR_MSG(fmt, args...) \ do { \ printk(KERN_ERR TAG"%d -> "fmt" <- %s() : L<%d> PID<%s><0x%x>\n", \ - host->id, ##args, __FUNCTION__, __LINE__, current->comm, current->pid); \ + host->id, ##args, __func__, __LINE__, current->comm, \ + current->pid); \ } while (0);#if 1 @@ -126,14 +127,15 @@ do { \ #define INIT_MSG(fmt, args...) \ do { \ printk(KERN_ERR TAG"%d -> "fmt" <- %s() : L<%d> PID<%s><0x%x>\n", \ - host->id, ##args, __FUNCTION__, __LINE__, current->comm, current->pid); \ + host->id, ##args, __func__, __LINE__, current->comm, \ + current->pid); \ } while (0);
Quoted 9 lines
drivers/staging/mt7621-mmc/dbg.h do { \ · line 141
Quoted 9 lines
drivers/staging/mt7621-mmc/dbg.h +1
-1/* PID in ISR in not corrent */ #define IRQ_MSG(fmt, args...) \ do { \ printk(KERN_ERR TAG"%d -> "fmt" <- %s() : L<%d>\n", \ - host->id, ##args, __FUNCTION__, __LINE__); \ + host->id, ##args, __func__, __LINE__); \ } while (0);#endif
Ok, I'll include the changes in the next version.
Thanks for the review.
regards,
nishad