From: Shreeya Patel <shreeya.patel23498@gmail.com>
To: Julia Lawall <julia.lawall@lip6.fr>
Cc: boris.brezillon@free-electrons.com, richard@nod.at,
dwmw2@infradead.org, computersforpeace@gmail.com,
marek.vasut@gmail.com, cyrille.pitchen@wedev4u.fr,
outreachy-kernel@googlegroups.com,
ezequiel@vanguardiasur.com.ar
Subject: Re: [Outreachy kernel] [PATCH NAND 1/5] mtd/nand: Replace printk with pr_warn
Date: Fri, 16 Feb 2018 23:22:31 +0530 [thread overview]
Message-ID: <1518803551.4566.7.camel@gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1802161808120.4340@hadrien>
On Fri, 2018-02-16 at 18:08 +0100, Julia Lawall wrote:
>
> On Fri, 16 Feb 2018, Shreeya Patel wrote:
>
> >
> > pr_*macro is the preferred way to print messages, replace all
> > printk(KERN_WARN, ...) with pr_warn.
> It looks like it should be possible to use dev_warn?
Yes, I'll check this out.
Majority of the files in the Nand driver uses dev_warn
but also some files have pr_warn.
So I'll see what will be the best use and why to use.
Thanks
>
> julia
>
> >
> >
> >
> > Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
> > ---
> > drivers/mtd/nand/ams-delta.c | 2 +-
> > drivers/mtd/nand/cafe_nand.c | 4 ++--
> > drivers/mtd/nand/cs553x_nand.c | 2 +-
> > drivers/mtd/nand/diskonchip.c | 8 ++++----
> > drivers/mtd/nand/mxc_nand.c | 2 +-
> > drivers/mtd/nand/nand_bch.c | 10 +++++-----
> > drivers/mtd/nand/nandsim.c | 2 +-
> > 7 files changed, 15 insertions(+), 15 deletions(-)
> >
> > diff --git a/drivers/mtd/nand/ams-delta.c b/drivers/mtd/nand/ams-
> > delta.c
> > index dcec9cf..24b1c24 100644
> > --- a/drivers/mtd/nand/ams-delta.c
> > +++ b/drivers/mtd/nand/ams-delta.c
> > @@ -185,7 +185,7 @@ static int ams_delta_init(struct
> > platform_device *pdev)
> > /* Allocate memory for MTD device structure and private
> > data */
> > this = kzalloc(sizeof(struct nand_chip), GFP_KERNEL);
> > if (!this) {
> > - printk (KERN_WARNING "Unable to allocate E3 NAND
> > MTD device structure.\n");
> > + pr_warn("Unable to allocate E3 NAND MTD device
> > structure.\n");
> > err = -ENOMEM;
> > goto out;
> > }
> > diff --git a/drivers/mtd/nand/cafe_nand.c
> > b/drivers/mtd/nand/cafe_nand.c
> > index bc558c4..1e84a6e 100644
> > --- a/drivers/mtd/nand/cafe_nand.c
> > +++ b/drivers/mtd/nand/cafe_nand.c
> > @@ -773,8 +773,8 @@ static int cafe_nand_probe(struct pci_dev
> > *pdev,
> > cafe->nand.bbt_td = &cafe_bbt_main_descr_512;
> > cafe->nand.bbt_md = &cafe_bbt_mirror_descr_512;
> > } else {
> > - printk(KERN_WARNING "Unexpected NAND flash
> > writesize %d. Aborting\n",
> > - mtd->writesize);
> > + pr_warn("Unexpected NAND flash writesize %d.
> > Aborting\n",
> > + mtd->writesize);
> > goto out_free_dma;
> > }
> > cafe->nand.ecc.mode = NAND_ECC_HW_SYNDROME;
> > diff --git a/drivers/mtd/nand/cs553x_nand.c
> > b/drivers/mtd/nand/cs553x_nand.c
> > index d488775..d4269a4 100644
> > --- a/drivers/mtd/nand/cs553x_nand.c
> > +++ b/drivers/mtd/nand/cs553x_nand.c
> > @@ -211,7 +211,7 @@ static int __init cs553x_init_one(int cs, int
> > mmio, unsigned long adr)
> > /* map physical address */
> > this->IO_ADDR_R = this->IO_ADDR_W = ioremap(adr, 4096);
> > if (!this->IO_ADDR_R) {
> > - printk(KERN_WARNING "ioremap cs553x NAND @0x%08lx
> > failed\n", adr);
> > + pr_warn("ioremap cs553x NAND @0x%08lx failed\n",
> > adr);
> > err = -EIO;
> > goto out_mtd;
> > }
> > diff --git a/drivers/mtd/nand/diskonchip.c
> > b/drivers/mtd/nand/diskonchip.c
> > index c3aa53c..dac4aec 100644
> > --- a/drivers/mtd/nand/diskonchip.c
> > +++ b/drivers/mtd/nand/diskonchip.c
> > @@ -1015,7 +1015,7 @@ static int __init find_media_headers(struct
> > mtd_info *mtd, u_char *buf, const ch
> > if (retlen != mtd->writesize)
> > continue;
> > if (ret) {
> > - printk(KERN_WARNING "ECC error scanning
> > DOC at 0x%x\n", offs);
> > + pr_warn("ECC error scanning DOC at
> > 0x%x\n", offs);
> > }
> > if (memcmp(buf, id, 6))
> > continue;
> > @@ -1030,7 +1030,7 @@ static int __init find_media_headers(struct
> > mtd_info *mtd, u_char *buf, const ch
> > return 2;
> > }
> > if (doc->mh0_page == -1) {
> > - printk(KERN_WARNING "DiskOnChip %s Media Header
> > not found.\n", id);
> > + pr_warn("DiskOnChip %s Media Header not found.\n",
> > id);
> > return 0;
> > }
> > /* Only one mediaheader was found. We want buf to contain
> > a
> > @@ -1093,7 +1093,7 @@ static inline int __init nftl_partscan(struct
> > mtd_info *mtd, struct mtd_partitio
> > maxblocks = min(32768U, (maxblocks << 1) +
> > psize);
> > mh->UnitSizeFactor--;
> > }
> > - printk(KERN_WARNING "UnitSizeFactor=0x00
> > detected. Correct value is assumed to be 0x%02x.\n", mh-
> > >UnitSizeFactor);
> > + pr_warn("UnitSizeFactor=0x00 detected. Correct
> > value is assumed to be 0x%02x.\n", mh->UnitSizeFactor);
> > }
> >
> > /* NOTE: The lines below modify internal variables of the
> > NAND and MTD
> > @@ -1512,7 +1512,7 @@ static int __init doc_probe(unsigned long
> > physadr)
> > tmpb = ReadDOC_(virtadr, reg) & DOC_TOGGLE_BIT;
> > tmpc = ReadDOC_(virtadr, reg) & DOC_TOGGLE_BIT;
> > if ((tmp == tmpb) || (tmp != tmpc)) {
> > - printk(KERN_WARNING "Possible DiskOnChip at 0x%lx
> > failed TOGGLE test, dropping.\n", physadr);
> > + pr_warn("Possible DiskOnChip at 0x%lx failed
> > TOGGLE test, dropping.\n", physadr);
> > ret = -ENODEV;
> > goto notfound;
> > }
> > diff --git a/drivers/mtd/nand/mxc_nand.c
> > b/drivers/mtd/nand/mxc_nand.c
> > index 53e5e03..e99c272 100644
> > --- a/drivers/mtd/nand/mxc_nand.c
> > +++ b/drivers/mtd/nand/mxc_nand.c
> > @@ -634,7 +634,7 @@ static int mxc_nand_correct_data_v2_v3(struct
> > mtd_info *mtd, u_char *dat,
> > do {
> > err = ecc_stat & ecc_bit_mask;
> > if (err > err_limit) {
> > - printk(KERN_WARNING "UnCorrectable RS-ECC
> > Error\n");
> > + pr_warn("UnCorrectable RS-ECC Error\n");
> > return -EBADMSG;
> > } else {
> > ret += err;
> > diff --git a/drivers/mtd/nand/nand_bch.c
> > b/drivers/mtd/nand/nand_bch.c
> > index 505441c..366c04a 100644
> > --- a/drivers/mtd/nand/nand_bch.c
> > +++ b/drivers/mtd/nand/nand_bch.c
> > @@ -134,7 +134,7 @@ struct nand_bch_control *nand_bch_init(struct
> > mtd_info *mtd)
> > }
> >
> > if (!eccsize || !eccbytes) {
> > - printk(KERN_WARNING "ecc parameters not
> > supplied\n");
> > + pr_warn("ecc parameters not supplied\n");
> > goto fail;
> > }
> >
> > @@ -151,8 +151,8 @@ struct nand_bch_control *nand_bch_init(struct
> > mtd_info *mtd)
> >
> > /* verify that eccbytes has the expected value */
> > if (nbc->bch->ecc_bytes != eccbytes) {
> > - printk(KERN_WARNING "invalid eccbytes %u, should
> > be %u\n",
> > - eccbytes, nbc->bch->ecc_bytes);
> > + pr_warn("invalid eccbytes %u, should be %u\n",
> > + eccbytes, nbc->bch->ecc_bytes);
> > goto fail;
> > }
> >
> > @@ -166,7 +166,7 @@ struct nand_bch_control *nand_bch_init(struct
> > mtd_info *mtd)
> >
> > /* sanity checks */
> > if (8*(eccsize+eccbytes) >= (1 << m)) {
> > - printk(KERN_WARNING "eccsize %u is too large\n",
> > eccsize);
> > + pr_warn("eccsize %u is too large\n", eccsize);
> > goto fail;
> > }
> >
> > @@ -181,7 +181,7 @@ struct nand_bch_control *nand_bch_init(struct
> > mtd_info *mtd)
> > nand->ecc.steps = eccsteps;
> > nand->ecc.total = eccsteps * eccbytes;
> > if (mtd_ooblayout_count_eccbytes(mtd) !=
> > (eccsteps*eccbytes)) {
> > - printk(KERN_WARNING "invalid ecc layout\n");
> > + pr_warn("invalid ecc layout\n");
> > goto fail;
> > }
> >
> > diff --git a/drivers/mtd/nand/nandsim.c
> > b/drivers/mtd/nand/nandsim.c
> > index 246b439..b2436ea 100644
> > --- a/drivers/mtd/nand/nandsim.c
> > +++ b/drivers/mtd/nand/nandsim.c
> > @@ -188,7 +188,7 @@ MODULE_PARM_DESC(bch, "Enable
> > BCH ecc and set how many bits should "
> > #define NS_DBG(args...) \
> > do { if (dbg) printk(KERN_DEBUG NS_OUTPUT_PREFIX " debug:
> > " args); } while(0)
> > #define NS_WARN(args...) \
> > - do { printk(KERN_WARNING NS_OUTPUT_PREFIX " warning: "
> > args); } while(0)
> > + do { pr_warn(NS_OUTPUT_PREFIX " warning: " args); }
> > while(0)
> > #define NS_ERR(args...) \
> > do { printk(KERN_ERR NS_OUTPUT_PREFIX " error: " args); }
> > while(0)
> > #define NS_INFO(args...) \
> > --
> > 2.7.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/49b0ddeaf74e473b0a5cd2a9fe2a3d0351349912.1518797480.git.shre
> > eya.patel23498%40gmail.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
next prev parent reply other threads:[~2018-02-16 17:52 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-16 16:50 [PATCH NAND 0/5] Replace printk statements with pr_*macros Shreeya Patel
2018-02-16 16:55 ` [PATCH NAND 1/5] mtd/nand: Replace printk with pr_warn Shreeya Patel
2018-02-16 17:08 ` [Outreachy kernel] " Julia Lawall
2018-02-16 17:52 ` Shreeya Patel [this message]
2018-02-16 16:57 ` [PATCH NAND 2/5] mtd/nand: Replace printk with pr_notice Shreeya Patel
2018-02-16 17:00 ` [PATCH NAND 3/5] mtd/nand: Replace printk with pr_err Shreeya Patel
2018-02-16 17:03 ` [PATCH NAND 4/5] mtd/nand: Replace printk with pr_info Shreeya Patel
2018-02-16 17:08 ` [PATCH NAND 5/5] mtd/nand: Replace printk with pr_debug Shreeya Patel
2018-02-16 17:19 ` [PATCH NAND 0/5] Replace printk statements with pr_*macros Richard Weinberger
2018-02-16 17:24 ` Ezequiel Garcia
2018-02-16 17:25 ` Ezequiel Garcia
2018-02-16 17:58 ` Richard Weinberger
2018-02-16 18:15 ` Boris Brezillon
2018-02-16 18:48 ` [Outreachy kernel] " Greg KH
2018-02-16 18:54 ` Julia Lawall
2018-02-16 18:00 ` Boris Brezillon
2018-02-16 17:19 ` Ezequiel Garcia
2018-02-16 17:23 ` [Outreachy kernel] " Julia Lawall
2018-02-16 17:26 ` Ezequiel Garcia
2018-02-16 17:48 ` Boris Brezillon
2018-02-16 17:59 ` Shreeya Patel
[not found] ` <1518976870.2784.4.camel@gmail.com>
[not found] ` <20180218191347.76f4a287@bbrezillon>
[not found] ` <1518978365.2969.6.camel@gmail.com>
2018-02-18 20:09 ` Boris Brezillon
2018-02-18 20:20 ` Shreeya Patel
2018-02-18 20:30 ` Shreeya Patel
2018-02-16 17:35 ` Shreeya Patel
2018-02-16 17:45 ` Boris Brezillon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1518803551.4566.7.camel@gmail.com \
--to=shreeya.patel23498@gmail.com \
--cc=boris.brezillon@free-electrons.com \
--cc=computersforpeace@gmail.com \
--cc=cyrille.pitchen@wedev4u.fr \
--cc=dwmw2@infradead.org \
--cc=ezequiel@vanguardiasur.com.ar \
--cc=julia.lawall@lip6.fr \
--cc=marek.vasut@gmail.com \
--cc=outreachy-kernel@googlegroups.com \
--cc=richard@nod.at \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.