All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] staging: mt29f_spinand: Replacing pr_err with dev_err after the call to devm_kzalloc
@ 2016-03-06 14:44 G Pooja Shamili
  2016-03-11 22:29 ` [Outreachy kernel] " Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: G Pooja Shamili @ 2016-03-06 14:44 UTC (permalink / raw)
  To: outreachy-kernel

The function devm_kzalloc has a first argument of type struct device *.
This is the type of argument required by printing functions such as
dev_info, dev_err, etc. Thus, functions like pr_info should not normally
be used after a call to devm_kzalloc. Thus, all pr_info occurances are
replaced with dev_info function calls.

This was done using Coccinelle, the patch being:
@@
expression E1,E2;
expression list args;
@@

E1 = devm_kzalloc(E2, ...);
<...
- pr_info(
+ dev_info(E2,
args);
...>

Signed-off-by: G Pooja Shamili <poojashamili@gmail.com>
---
Changes from Version 1:
	    * Changed the name in the From: and Signed-off-by: to full
	    name.

 drivers/staging/mt29f_spinand/mt29f_spinand.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/mt29f_spinand/mt29f_spinand.c b/drivers/staging/mt29f_spinand/mt29f_spinand.c
index 75fe61c..791e36f 100644
--- a/drivers/staging/mt29f_spinand/mt29f_spinand.c
+++ b/drivers/staging/mt29f_spinand/mt29f_spinand.c
@@ -893,7 +893,8 @@ static int spinand_probe(struct spi_device *spi_nand)
 #else
 	chip->ecc.mode	= NAND_ECC_SOFT;
 	if (spinand_disable_ecc(spi_nand) < 0)
-		pr_info("%s: disable ecc failed!\n", __func__);
+		dev_info(&spi_nand->dev, "%s: disable ecc failed!\n",
+			 __func__);
 #endif
 
 	nand_set_flash_node(chip, spi_nand->dev.of_node);
-- 
2.1.4



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

* Re: [Outreachy kernel] [PATCH v2] staging: mt29f_spinand: Replacing pr_err with dev_err after the call to devm_kzalloc
  2016-03-06 14:44 [PATCH v2] staging: mt29f_spinand: Replacing pr_err with dev_err after the call to devm_kzalloc G Pooja Shamili
@ 2016-03-11 22:29 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2016-03-11 22:29 UTC (permalink / raw)
  To: G Pooja Shamili; +Cc: outreachy-kernel

On Sun, Mar 06, 2016 at 08:14:36PM +0530, G Pooja Shamili wrote:
> The function devm_kzalloc has a first argument of type struct device *.
> This is the type of argument required by printing functions such as
> dev_info, dev_err, etc. Thus, functions like pr_info should not normally
> be used after a call to devm_kzalloc. Thus, all pr_info occurances are
> replaced with dev_info function calls.

Your subject says "_err", not "_info" :(



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

end of thread, other threads:[~2016-03-11 22:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-06 14:44 [PATCH v2] staging: mt29f_spinand: Replacing pr_err with dev_err after the call to devm_kzalloc G Pooja Shamili
2016-03-11 22:29 ` [Outreachy kernel] " Greg KH

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.