linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: mt7621-mmc: Use __func__ instead of __FUNCTION__ in dbg.h
@ 2018-08-16 19:49 Nishad Kamdar
  2018-08-16 20:07 ` Joe Perches
  0 siblings, 1 reply; 3+ messages in thread
From: Nishad Kamdar @ 2018-08-16 19:49 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Christian Lütke-Stetzkamp, NeilBrown, John Crispin, devel,
	linux-kernel

Use the identifier __func__ instead of gcc specific __FUNCTION__
in dbg.h. Limit these lines to 80 characters. Issues found by
checkpatch.

Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com>
---
 drivers/staging/mt7621-mmc/dbg.h | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/mt7621-mmc/dbg.h b/drivers/staging/mt7621-mmc/dbg.h
index 2f2c56b73987..5da275239d7c 100644
--- a/drivers/staging/mt7621-mmc/dbg.h
+++ b/drivers/staging/mt7621-mmc/dbg.h
@@ -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
 
-- 
2.17.1


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

* Re: [PATCH] staging: mt7621-mmc: Use __func__ instead of __FUNCTION__ in dbg.h
  2018-08-16 19:49 [PATCH] staging: mt7621-mmc: Use __func__ instead of __FUNCTION__ in dbg.h Nishad Kamdar
@ 2018-08-16 20:07 ` Joe Perches
  2018-08-18 11:29   ` Nishad Kamdar
  0 siblings, 1 reply; 3+ messages in thread
From: Joe Perches @ 2018-08-16 20:07 UTC (permalink / raw)
  To: Nishad Kamdar, Greg Kroah-Hartman
  Cc: Christian Lütke-Stetzkamp, NeilBrown, John Crispin, devel,
	linux-kernel

On Fri, 2018-08-17 at 01:19 +0530, Nishad Kamdar wrote:
> Use the identifier __func__ instead of gcc specific __FUNCTION__
> in dbg.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.

> Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com>
> ---
>  drivers/staging/mt7621-mmc/dbg.h | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/mt7621-mmc/dbg.h b/drivers/staging/mt7621-mmc/dbg.h
> index 2f2c56b73987..5da275239d7c 100644
> --- a/drivers/staging/mt7621-mmc/dbg.h
> +++ b/drivers/staging/mt7621-mmc/dbg.h
> @@ -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
>  

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

* Re: [PATCH] staging: mt7621-mmc: Use __func__ instead of __FUNCTION__ in dbg.h
  2018-08-16 20:07 ` Joe Perches
@ 2018-08-18 11:29   ` Nishad Kamdar
  0 siblings, 0 replies; 3+ messages in thread
From: Nishad Kamdar @ 2018-08-18 11:29 UTC (permalink / raw)
  To: Joe Perches, Greg Kroah-Hartman
  Cc: Christian Lütke-Stetzkamp, NeilBrown, John Crispin, devel,
	linux-kernel

On Thu, Aug 16, 2018 at 01:07:41PM -0700, Joe Perches wrote:
> On Fri, 2018-08-17 at 01:19 +0530, Nishad Kamdar wrote:
> > Use the identifier __func__ instead of gcc specific __FUNCTION__
> > in dbg.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.
> 
> > Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com>
> > ---
> >  drivers/staging/mt7621-mmc/dbg.h | 8 +++++---
> >  1 file changed, 5 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/staging/mt7621-mmc/dbg.h b/drivers/staging/mt7621-mmc/dbg.h
> > index 2f2c56b73987..5da275239d7c 100644
> > --- a/drivers/staging/mt7621-mmc/dbg.h
> > +++ b/drivers/staging/mt7621-mmc/dbg.h
> > @@ -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
> >  

Ok, I'll include the changes in the next version.

Thanks for the review.

regards,
nishad

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

end of thread, other threads:[~2018-08-18 11:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-16 19:49 [PATCH] staging: mt7621-mmc: Use __func__ instead of __FUNCTION__ in dbg.h Nishad Kamdar
2018-08-16 20:07 ` Joe Perches
2018-08-18 11:29   ` Nishad Kamdar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).