Skip to contentSkip to conversation

staging: media: davinci_vpfe: Use __func__ instead of function name

PATCH Superseded Mamta Shukla 2 participants 3 messages Oct 7, 2018

Subsystems (2)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: media: davinci_vpfe: Use __func__ instead of function name

Access current function name using __func__.
Use %s and __func__ instead of function name.

Issue found with checkpatch.pl

---

Predefined identifier __func__ gives the name of current function name. Thus, it gives better debug information in this case.

 drivers/staging/media/davinci_vpfe/dm365_ipipe.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/media/davinci_vpfe/dm365_ipipe.c +3 -3
index 9594276..4d09e81 100644
@@ -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,
Signature · 1 line
1.9.1
#1 lore raw
Quoted 10 lines · Mamta Shukla

Access current function name using __func__.
Use %s and __func__ instead of function name.

Issue found with checkpatch.pl

---

Predefined identifier __func__ gives the name of current function name. Thus, it gives better debug information in this case.

If this information is useful for someone reading the submitted patch, it will be useful for other people in the future when looking through the commit history. Thus it should be above the ---. Below the --- you should put version information, or maybe any questions you have about the validity of the patch, ie things that people don't need to know about after tha patch is accepted.

julia

Quoted 43 lines
 drivers/staging/media/davinci_vpfe/dm365_ipipe.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/media/davinci_vpfe/dm365_ipipe.c +3 -4
index 9594276..4d09e81 100644
@@ -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 [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20181006202414.GA12019%40armorer.
For more options, visit https://groups.google.com/d/optout.

#2 lore raw
Quoted 16 lines · Julia Lawall
Quoted 10 lines · Mamta Shukla

Access current function name using __func__.
Use %s and __func__ instead of function name.

Issue found with checkpatch.pl

---

Predefined identifier __func__ gives the name of current function name. Thus, it gives better debug information in this case.

Quoted 9 lines
Quoted 8 lines

If this information is useful for someone reading the submitted patch, it will be useful for other people in the future when looking through the commit history. Thus it should be above the ---. Below the --- you should put version information, or maybe any questions you have about the validity of the patch, ie things that people don't need to know about after tha patch is accepted.

julia

Ok. I will add the information above -- so that it will be helpful and useful for other people.
I will send revised version of this patch.

Quoted 53 lines

Review

Quoted 6 lines

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

b/drivers/staging/media/davinci_vpfe/dm365_ipipe.c

drivers/staging/media/davinci_vpfe/dm365_ipipe.c static int ipipe_get_gamma_params(struct

Quoted 4 lines

index 9594276..4d09e81 100644

drivers/staging/media/davinci_vpfe/dm365_ipipe.c +0 -0
@@ -695,21 +695,21 @@ static int ipipe_get_gamma_params(struct

vpfe_ipipe_device *ipipe, void *param)

drivers/staging/media/davinci_vpfe/dm365_ipipe.c static int ipipe_get_gamma_params(struct vpfe_ipipe_device *ipipe, void *param)

Quoted 12 lines
drivers/staging/media/davinci_vpfe/dm365_ipipe.c +1 -2
      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");

drivers/staging/media/davinci_vpfe/dm365_ipipe.c static int ipipe_get_gamma_params(struct vpfe_ipipe_device *ipipe, void *param)

Quoted 8 lines
drivers/staging/media/davinci_vpfe/dm365_ipipe.c +1 -1
+             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");

Quoted 9 lines
drivers/staging/media/davinci_vpfe/dm365_ipipe.c +1 -1
+             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.

Quoted 1 line

To unsubscribe from this group and stop receiving emails from it, send

an email to [email protected].

Quoted 2 lines

To post to this group, send email to [email protected]. To view this discussion on the web visit

https://groups.google.com/d/msgid/outreachy-kernel/20181006202414.GA12019%40armorer
.

Quoted 2 lines

For more options, visit https://groups.google.com/d/optout.

Signature · 3 lines
Mamta Shukla
Pune Institute  of Computer Technology
Pune