* [PATCH] staging: mt29f_spinand: Replacing pr_info with dev_info after the call to devm_kzalloc @ 2016-03-03 17:07 pooja.shamili 2016-03-05 8:00 ` [Outreachy kernel] " Eva Rachel Retuya 0 siblings, 1 reply; 3+ messages in thread From: pooja.shamili @ 2016-03-03 17:07 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: pooja.shamili <poojashamili@gmail.com> --- 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] 3+ messages in thread
* Re: [Outreachy kernel] [PATCH] staging: mt29f_spinand: Replacing pr_info with dev_info after the call to devm_kzalloc 2016-03-03 17:07 [PATCH] staging: mt29f_spinand: Replacing pr_info with dev_info after the call to devm_kzalloc pooja.shamili @ 2016-03-05 8:00 ` Eva Rachel Retuya 2016-03-05 8:27 ` Julia Lawall 0 siblings, 1 reply; 3+ messages in thread From: Eva Rachel Retuya @ 2016-03-05 8:00 UTC (permalink / raw) To: pooja.shamili; +Cc: outreachy-kernel On Thu, Mar 03, 2016 at 10:37:35PM +0530, 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. > > 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: pooja.shamili <poojashamili@gmail.com> > --- > 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 > > -- > 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/20160303170735.GA3773%40localhost. > For more options, visit https://groups.google.com/d/optout. Hello Pooja, I'm also working on the semantic patch you presented here but I'm aiming for the "extended" one. I'm using this driver to test my patch -- other than what you have changed, I suggest you also convert the other pr_ calls on this driver even if it's by hand and add that to your commit message. I think there are only 2 left, for consistency purposes. Eva ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Outreachy kernel] [PATCH] staging: mt29f_spinand: Replacing pr_info with dev_info after the call to devm_kzalloc 2016-03-05 8:00 ` [Outreachy kernel] " Eva Rachel Retuya @ 2016-03-05 8:27 ` Julia Lawall 0 siblings, 0 replies; 3+ messages in thread From: Julia Lawall @ 2016-03-05 8:27 UTC (permalink / raw) To: Eva Rachel Retuya; +Cc: pooja.shamili, outreachy-kernel On Sat, 5 Mar 2016, Eva Rachel Retuya wrote: > On Thu, Mar 03, 2016 at 10:37:35PM +0530, 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. > > > > 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: pooja.shamili <poojashamili@gmail.com> > > --- > > 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 > > > > -- > > 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/20160303170735.GA3773%40localhost. > > For more options, visit https://groups.google.com/d/optout. > > Hello Pooja, > > I'm also working on the semantic patch you presented here but I'm aiming > for the "extended" one. I'm using this driver to test my patch -- other > than what you have changed, I suggest you also convert the other pr_ > calls on this driver even if it's by hand and add that to your commit > message. I think there are only 2 left, for consistency purposes. If you do something partly by hand and partly with Coccinelle, please carefully indicate everything that you do by hand so that the reviewer will know to look for more than what is described by the semantic patch. julia > > Eva > > -- > 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/20160305080019.GA28126%40Socrates-Mint. > For more options, visit https://groups.google.com/d/optout. > ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-03-05 8:28 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-03-03 17:07 [PATCH] staging: mt29f_spinand: Replacing pr_info with dev_info after the call to devm_kzalloc pooja.shamili 2016-03-05 8:00 ` [Outreachy kernel] " Eva Rachel Retuya 2016-03-05 8:27 ` Julia Lawall
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.