All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] staging: media: davinci_vpfe: Use __func__ instead of function name
@ 2018-10-06 20:54 Mamta Shukla
  2018-10-07 15:25 ` [Outreachy kernel] " Julia Lawall
  0 siblings, 1 reply; 3+ messages in thread
From: Mamta Shukla @ 2018-10-06 20:54 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: mchehab, gregkh, mamtashukla555

Access current function name using __func__.
Use %s and __func__ instead of function name.
Predefined identifier __func__ gives the name of current function name.
Thus, it gives better debug information in this case. 

Issue found with checkpatch.pl

Signed-off-by: Mamta Shukla <mamtashukla555@gmail.com>
---

change in v2:
-Put useful information above ---

 drivers/staging/media/davinci_vpfe/dm365_ipipe.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/media/davinci_vpfe/dm365_ipipe.c b/drivers/staging/media/davinci_vpfe/dm365_ipipe.c
index 9594276..4d09e81 100644
--- a/drivers/staging/media/davinci_vpfe/dm365_ipipe.c
+++ b/drivers/staging/media/davinci_vpfe/dm365_ipipe.c
@@ -695,21 +695,21 @@ static int ipipe_get_gamma_params(struct vpfe_ipipe_device *ipipe, void *param)
 
 	if (!gamma->bypass_r) {
 		dev_err(dev,
-			"ipipe_get_gamma_params: table ptr empty for R\n");
+			"%s: table ptr empty for R\n", __func__);
 		return -EINVAL;
 	}
 	memcpy(gamma_param->table_r, gamma->table_r,
 	       (table_size * sizeof(struct vpfe_ipipe_gamma_entry)));
 
 	if (!gamma->bypass_g) {
-		dev_err(dev, "ipipe_get_gamma_params: table ptr empty for G\n");
+		dev_err(dev, "%s: table ptr empty for G\n", __func__);
 		return -EINVAL;
 	}
 	memcpy(gamma_param->table_g, gamma->table_g,
 	       (table_size * sizeof(struct vpfe_ipipe_gamma_entry)));
 
 	if (!gamma->bypass_b) {
-		dev_err(dev, "ipipe_get_gamma_params: table ptr empty for B\n");
+		dev_err(dev, "%s: table ptr empty for B\n", __func__);
 		return -EINVAL;
 	}
 	memcpy(gamma_param->table_b, gamma->table_b,
-- 
1.9.1



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

* Re: [Outreachy kernel] [PATCH v2] staging: media: davinci_vpfe: Use __func__ instead of function name
  2018-10-07 15:25 ` [Outreachy kernel] " Julia Lawall
@ 2018-10-06 21:50   ` Mamta Shukla
  0 siblings, 0 replies; 3+ messages in thread
From: Mamta Shukla @ 2018-10-06 21:50 UTC (permalink / raw)
  To: Julia Lawall; +Cc: outreachy-kernel, mchehab, gregkh

[-- Attachment #1: Type: text/plain, Size: 3000 bytes --]

On Sun, Oct 7, 2018 at 8:58 PM Julia Lawall <julia.lawall@lip6.fr> wrote:

>
>
> On Sun, 7 Oct 2018, Mamta Shukla wrote:
>
> > Access current function name using __func__.
> > Use %s and __func__ instead of function name.
> > Predefined identifier __func__ gives the name of current function name.
> > Thus, it gives better debug information in this case.
>
> >Actually, the debug information produced is the same as before.  Now,
> >however, the code is more concise and it is more robust, in case the name
> >of the function changes.
>
> >julia
>
> Ok, I will edit the commit message and will revise the patch.

> >
> > Issue found with checkpatch.pl
> >
> > Signed-off-by: Mamta Shukla <mamtashukla555@gmail.com>
> > ---
> >
> > change in v2:
> > -Put useful information above ---
> >
> >  drivers/staging/media/davinci_vpfe/dm365_ipipe.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/staging/media/davinci_vpfe/dm365_ipipe.c
> b/drivers/staging/media/davinci_vpfe/dm365_ipipe.c
> > index 9594276..4d09e81 100644
> > --- a/drivers/staging/media/davinci_vpfe/dm365_ipipe.c
> > +++ b/drivers/staging/media/davinci_vpfe/dm365_ipipe.c
> > @@ -695,21 +695,21 @@ static int ipipe_get_gamma_params(struct
> vpfe_ipipe_device *ipipe, void *param)
> >
> >       if (!gamma->bypass_r) {
> >               dev_err(dev,
> > -                     "ipipe_get_gamma_params: table ptr empty for R\n");
> > +                     "%s: table ptr empty for R\n", __func__);
> >               return -EINVAL;
> >       }
> >       memcpy(gamma_param->table_r, gamma->table_r,
> >              (table_size * sizeof(struct vpfe_ipipe_gamma_entry)));
> >
> >       if (!gamma->bypass_g) {
> > -             dev_err(dev, "ipipe_get_gamma_params: table ptr empty for
> G\n");
> > +             dev_err(dev, "%s: table ptr empty for G\n", __func__);
> >               return -EINVAL;
> >       }
> >       memcpy(gamma_param->table_g, gamma->table_g,
> >              (table_size * sizeof(struct vpfe_ipipe_gamma_entry)));
> >
> >       if (!gamma->bypass_b) {
> > -             dev_err(dev, "ipipe_get_gamma_params: table ptr empty for
> B\n");
> > +             dev_err(dev, "%s: table ptr empty for B\n", __func__);
> >               return -EINVAL;
> >       }
> >       memcpy(gamma_param->table_b, gamma->table_b,
> > --
> > 1.9.1
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "outreachy-kernel" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/outreachy-kernel/20181006205400.GA12894%40armorer
> .
> > For more options, visit https://groups.google.com/d/optout.
> >
>


-- 
Mamta Shukla
Pune Institute  of Computer Technology
Pune
m: 9158516957
e : mamtashukla555@gmail.com

[-- Attachment #2: Type: text/html, Size: 4941 bytes --]

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

* Re: [Outreachy kernel] [PATCH v2] staging: media: davinci_vpfe: Use __func__ instead of function name
  2018-10-06 20:54 [PATCH v2] staging: media: davinci_vpfe: Use __func__ instead of function name Mamta Shukla
@ 2018-10-07 15:25 ` Julia Lawall
  2018-10-06 21:50   ` Mamta Shukla
  0 siblings, 1 reply; 3+ messages in thread
From: Julia Lawall @ 2018-10-07 15:25 UTC (permalink / raw)
  To: Mamta Shukla; +Cc: outreachy-kernel, mchehab, gregkh



On Sun, 7 Oct 2018, Mamta Shukla wrote:

> Access current function name using __func__.
> Use %s and __func__ instead of function name.
> Predefined identifier __func__ gives the name of current function name.
> Thus, it gives better debug information in this case.

Actually, the debug information produced is the same as before.  Now,
however, the code is more concise and it is more robust, in case the name
of the function changes.

julia

>
> Issue found with checkpatch.pl
>
> Signed-off-by: Mamta Shukla <mamtashukla555@gmail.com>
> ---
>
> change in v2:
> -Put useful information above ---
>
>  drivers/staging/media/davinci_vpfe/dm365_ipipe.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/media/davinci_vpfe/dm365_ipipe.c b/drivers/staging/media/davinci_vpfe/dm365_ipipe.c
> index 9594276..4d09e81 100644
> --- a/drivers/staging/media/davinci_vpfe/dm365_ipipe.c
> +++ b/drivers/staging/media/davinci_vpfe/dm365_ipipe.c
> @@ -695,21 +695,21 @@ static int ipipe_get_gamma_params(struct vpfe_ipipe_device *ipipe, void *param)
>
>  	if (!gamma->bypass_r) {
>  		dev_err(dev,
> -			"ipipe_get_gamma_params: table ptr empty for R\n");
> +			"%s: table ptr empty for R\n", __func__);
>  		return -EINVAL;
>  	}
>  	memcpy(gamma_param->table_r, gamma->table_r,
>  	       (table_size * sizeof(struct vpfe_ipipe_gamma_entry)));
>
>  	if (!gamma->bypass_g) {
> -		dev_err(dev, "ipipe_get_gamma_params: table ptr empty for G\n");
> +		dev_err(dev, "%s: table ptr empty for G\n", __func__);
>  		return -EINVAL;
>  	}
>  	memcpy(gamma_param->table_g, gamma->table_g,
>  	       (table_size * sizeof(struct vpfe_ipipe_gamma_entry)));
>
>  	if (!gamma->bypass_b) {
> -		dev_err(dev, "ipipe_get_gamma_params: table ptr empty for B\n");
> +		dev_err(dev, "%s: table ptr empty for B\n", __func__);
>  		return -EINVAL;
>  	}
>  	memcpy(gamma_param->table_b, gamma->table_b,
> --
> 1.9.1
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20181006205400.GA12894%40armorer.
> For more options, visit https://groups.google.com/d/optout.
>


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

end of thread, other threads:[~2018-10-07 15:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-06 20:54 [PATCH v2] staging: media: davinci_vpfe: Use __func__ instead of function name Mamta Shukla
2018-10-07 15:25 ` [Outreachy kernel] " Julia Lawall
2018-10-06 21:50   ` Mamta Shukla

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.