Re: [PATCH NAND v3] mtd: nand: Replace printk() with appropriate pr_*() macro

From: Shreeya Patel
Date: Thu Feb 22 2018 - 08:13:48 EST


On Thu, 2018-02-22 at 18:40 +0530, Shreeya Patel wrote:
> The log levels embedded with the name are more concise than
> printk.
> Replace printks having a log level with the appropriate
> pr_*macro.
> Define pr_fmt() and remove other additional macros from
> some of the replaced printks.
>
> Signed-off-by: Shreeya Patel <shreeya.patel23498@xxxxxxxxx>
> ---
>
> Changes in v2
> Â -Merge previous patches of the patchset regarding replacement
> of printk with pr_*macro, into single patch.
>
> Changes in v3
> Â -Define pr_fmt() and remove other additional macros from
> some of the replaced printks. Also add some more changed printks
> to pr_*() macro into the patch.
>
> Âdrivers/mtd/nand/ams-delta.cÂÂÂÂÂ|ÂÂ4 +--
> Âdrivers/mtd/nand/cafe_nand.cÂÂÂÂÂ|ÂÂ4 +--
> Âdrivers/mtd/nand/cs553x_nand.cÂÂÂ|ÂÂ9 ++---
> Âdrivers/mtd/nand/diskonchip.cÂÂÂÂ| 76 +++++++++++++++++++++---------
> ----------
> Âdrivers/mtd/nand/fsl_elbc_nand.c |ÂÂ4 +--
> Âdrivers/mtd/nand/fsl_ifc_nand.cÂÂ|ÂÂ2 +-
> Âdrivers/mtd/nand/mxc_nand.cÂÂÂÂÂÂ|ÂÂ2 +-
> Âdrivers/mtd/nand/nand_bch.cÂÂÂÂÂÂ| 12 +++----
> Âdrivers/mtd/nand/nandsim.cÂÂÂÂÂÂÂ| 15 ++++----
> Âdrivers/mtd/nand/r852.cÂÂÂÂÂÂÂÂÂÂ|ÂÂ5 ++-
> Âdrivers/mtd/nand/r852.hÂÂÂÂÂÂÂÂÂÂ|ÂÂ8 ++---
> Âdrivers/mtd/nand/sh_flctl.cÂÂÂÂÂÂ|ÂÂ2 +-
> Âdrivers/mtd/nand/sm_common.cÂÂÂÂÂ|ÂÂ5 ++-
> Â13 files changed, 77 insertions(+), 71 deletions(-)
>
> diff --git a/drivers/mtd/nand/ams-delta.c b/drivers/mtd/nand/ams-
> delta.c
> index dcec9cf..e120ce9 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;
> Â }
> @@ -219,7 +219,7 @@ static int ams_delta_init(struct platform_device
> *pdev)
> Â this->dev_ready = ams_delta_nand_ready;
> Â } else {
> Â this->dev_ready = NULL;
> - printk(KERN_NOTICE "Couldn't request gpio for Delta
> NAND ready.\n");
> + pr_notice("Couldn't request gpio for Delta NAND
> ready.\n");
> Â }
> Â /* 25 us command delay time */
> Â this->chip_delay = 30;
> 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..1fe3c8a 100644
> --- a/drivers/mtd/nand/cs553x_nand.c
> +++ b/drivers/mtd/nand/cs553x_nand.c
> @@ -189,10 +189,11 @@ static int __init cs553x_init_one(int cs, int
> mmio, unsigned long adr)
> Â struct nand_chip *this;
> Â struct mtd_info *new_mtd;
> Â
> - printk(KERN_NOTICE "Probing CS553x NAND controller CS#%d at
> %sIO 0x%08lx\n", cs, mmio?"MM":"P", adr);
> + pr_notice("Probing CS553x NAND controller CS#%d at %sIO
> 0x%08lx\n",
> + ÂÂcs, mmio?"MM":"P", adr);
> Â
> Â if (!mmio) {
> - printk(KERN_NOTICE "PIO mode not yet implemented for
> CS553X NAND controller\n");
> + pr_notice("PIO mode not yet implemented for CS553X
> NAND controller\n");
> Â return -ENXIO;
> Â }
> Â
> @@ -211,7 +212,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;
> Â }
> @@ -295,7 +296,7 @@ static int __init cs553x_init(void)
> Â /* If it doesn't have the NAND controller enabled, abort */
> Â rdmsrl(MSR_DIVIL_BALL_OPTS, val);
> Â if (val & PIN_OPT_IDE) {
> - printk(KERN_INFO "CS553x NAND controller: Flash I/O
> not enabled in MSR_DIVIL_BALL_OPTS.\n");
> + pr_info("CS553x NAND controller: Flash I/O not
> enabled in MSR_DIVIL_BALL_OPTS.\n");
> Â return -ENXIO;
> Â }
> Â
> diff --git a/drivers/mtd/nand/diskonchip.c
> b/drivers/mtd/nand/diskonchip.c
> index c3aa53c..8643512 100644
> --- a/drivers/mtd/nand/diskonchip.c
> +++ b/drivers/mtd/nand/diskonchip.c
> @@ -411,7 +411,7 @@ static uint16_t __init doc200x_ident_chip(struct
> mtd_info *mtd, int nr)
> Â
> Â ident.dword = readl(docptr + DoC_2k_CDSN_IO);
> Â if (((ident.byte[0] << 8) | ident.byte[1]) == ret) {
> - printk(KERN_INFO "DiskOnChip 2000 responds
> to DWORD access\n");
> + pr_info("DiskOnChip 2000 responds to DWORD
> access\n");
> Â this->read_buf = &doc2000_readbuf_dword;
> Â }
> Â }
> @@ -438,7 +438,7 @@ static void __init doc2000_count_chips(struct
> mtd_info *mtd)
> Â break;
> Â }
> Â doc->chips_per_floor = i;
> - printk(KERN_DEBUG "Detected %d chips per floor.\n", i);
> + pr_debug("Detected %d chips per floor.\n", i);
> Â}
> Â
> Âstatic int doc200x_wait(struct mtd_info *mtd, struct nand_chip
> *this)
> @@ -935,14 +935,15 @@ static int doc200x_correct_data(struct mtd_info
> *mtd, u_char *dat,
> Â
> Â ret = doc_ecc_decode(rs_decoder, dat, calc_ecc);
> Â if (ret > 0)
> - printk(KERN_ERR "doc200x_correct_data
> corrected %d errors\n", ret);
> + pr_err("doc200x_correct_data corrected %d
> errors\n",
> + ÂÂÂÂÂÂÂret);
> Â }
> Â if (DoC_is_MillenniumPlus(doc))
> Â WriteDOC(DOC_ECC_DIS, docptr, Mplus_ECCConf);
> Â else
> Â WriteDOC(DOC_ECC_DIS, docptr, ECCConf);
> Â if (no_ecc_failures && mtd_is_eccerr(ret)) {
> - printk(KERN_ERR "suppressing ECC failure\n");
> + pr_err("suppressing ECC failure\n");
> Â ret = 0;
> Â }
> Â return ret;
> @@ -1015,11 +1016,11 @@ 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;
> - printk(KERN_INFO "Found DiskOnChip %s Media Header
> at 0x%x\n", id, offs);
> + pr_info("Found DiskOnChip %s Media Header at
> 0x%x\n", id, offs);
> Â if (doc->mh0_page == -1) {
> Â doc->mh0_page = offs >> this->page_shift;
> Â if (!findmirror)
> @@ -1030,7 +1031,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
> @@ -1039,7 +1040,7 @@ static int __init find_media_headers(struct
> mtd_info *mtd, u_char *buf, const ch
> Â ret = mtd_read(mtd, offs, mtd->writesize, &retlen, buf);
> Â if (retlen != mtd->writesize) {
> Â /* Insanity.ÂÂGive up. */
> - printk(KERN_ERR "Read DiskOnChip Media Header once,
> but can't reread it???\n");
> + pr_err("Read DiskOnChip Media Header once, but can't
> reread it???\n");
> Â return 0;
> Â }
> Â return 1;
> @@ -1069,11 +1070,11 @@ static inline int __init nftl_partscan(struct
> mtd_info *mtd, struct mtd_partitio
> Â le16_to_cpus(&mh->FirstPhysicalEUN);
> Â le32_to_cpus(&mh->FormattedSize);
> Â
> - printk(KERN_INFO "ÂÂÂÂDataOrgIDÂÂÂÂÂÂÂÂ= %s\n"
> - Â"ÂÂÂÂNumEraseUnitsÂÂÂÂ= %d\n"
> - Â"ÂÂÂÂFirstPhysicalEUN = %d\n"
> - Â"ÂÂÂÂFormattedSizeÂÂÂÂ= %d\n"
> - Â"ÂÂÂÂUnitSizeFactorÂÂÂ= %d\n",
> + pr_info("ÂÂÂÂDataOrgIDÂÂÂÂÂÂÂÂ= %s\n"
> + "ÂÂÂÂNumEraseUnitsÂÂÂÂ= %d\n"
> + "ÂÂÂÂFirstPhysicalEUN = %d\n"
> + "ÂÂÂÂFormattedSizeÂÂÂÂ= %d\n"
> + "ÂÂÂÂUnitSizeFactorÂÂÂ= %d\n",
> Â mh->DataOrgID, mh->NumEraseUnits,
> Â mh->FirstPhysicalEUN, mh->FormattedSize,
> Â mh->UnitSizeFactor);
> @@ -1093,7 +1094,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
> @@ -1104,13 +1105,13 @@ static inline int __init nftl_partscan(struct
> mtd_info *mtd, struct mtd_partitio
> Â if (mh->UnitSizeFactor != 0xff) {
> Â this->bbt_erase_shift += (0xff - mh-
> >UnitSizeFactor);
> Â mtd->erasesize <<= (0xff - mh->UnitSizeFactor);
> - printk(KERN_INFO "Setting virtual erase size to
> %d\n", mtd->erasesize);
> + pr_info("Setting virtual erase size to %d\n", mtd-
> >erasesize);
> Â blocks = mtd->size >> this->bbt_erase_shift;
> Â maxblocks = min(32768U, mtd->erasesize - psize);
> Â }
> Â
> Â if (blocks > maxblocks) {
> - printk(KERN_ERR "UnitSizeFactor of 0x%02x is
> inconsistent with device size.ÂÂAborting.\n", mh->UnitSizeFactor);
> + pr_err("UnitSizeFactor of 0x%02x is inconsistent
> with device size.ÂÂAborting.\n", mh->UnitSizeFactor);
> Â goto out;
> Â }
> Â
> @@ -1181,14 +1182,14 @@ static inline int __init
> inftl_partscan(struct mtd_info *mtd, struct mtd_partiti
> Â le32_to_cpus(&mh->FormatFlags);
> Â le32_to_cpus(&mh->PercentUsed);
> Â
> - printk(KERN_INFO "ÂÂÂÂbootRecordIDÂÂÂÂÂÂÂÂÂÂ= %s\n"
> - Â"ÂÂÂÂNoOfBootImageBlocksÂÂÂ= %d\n"
> - Â"ÂÂÂÂNoOfBinaryPartitionsÂÂ= %d\n"
> - Â"ÂÂÂÂNoOfBDTLPartitionsÂÂÂÂ= %d\n"
> - Â"ÂÂÂÂBlockMultiplerBitsÂÂÂÂ= %d\n"
> - Â"ÂÂÂÂFormatFlgsÂÂÂÂÂÂÂÂÂÂÂÂ= %d\n"
> - Â"ÂÂÂÂOsakVersionÂÂÂÂÂÂÂÂÂÂÂ= %d.%d.%d.%d\n"
> - Â"ÂÂÂÂPercentUsedÂÂÂÂÂÂÂÂÂÂÂ= %d\n",
> + pr_info("ÂÂÂÂbootRecordIDÂÂÂÂÂÂÂÂÂÂ= %s\n"
> + "ÂÂÂÂNoOfBootImageBlocksÂÂÂ= %d\n"
> + "ÂÂÂÂNoOfBinaryPartitionsÂÂ= %d\n"
> + "ÂÂÂÂNoOfBDTLPartitionsÂÂÂÂ= %d\n"
> + "ÂÂÂÂBlockMultiplerBitsÂÂÂÂ= %d\n"
> + "ÂÂÂÂFormatFlgsÂÂÂÂÂÂÂÂÂÂÂÂ= %d\n"
> + "ÂÂÂÂOsakVersionÂÂÂÂÂÂÂÂÂÂÂ= %d.%d.%d.%d\n"
> + "ÂÂÂÂPercentUsedÂÂÂÂÂÂÂÂÂÂÂ= %d\n",
> Â mh->bootRecordID, mh->NoOfBootImageBlocks,
> Â mh->NoOfBinaryPartitions,
> Â mh->NoOfBDTLPartitions,
> @@ -1203,13 +1204,13 @@ static inline int __init
> inftl_partscan(struct mtd_info *mtd, struct mtd_partiti
> Â
> Â blocks = mtd->size >> vshift;
> Â if (blocks > 32768) {
> - printk(KERN_ERR "BlockMultiplierBits=%d is
> inconsistent with device size.ÂÂAborting.\n", mh-
> >BlockMultiplierBits);
> + pr_err("BlockMultiplierBits=%d is inconsistent with
> device size.ÂÂAborting.\n", mh->BlockMultiplierBits);
> Â goto out;
> Â }
> Â
> Â blocks = doc->chips_per_floor << (this->chip_shift - this-
> >phys_erase_shift);
> Â if (inftl_bbt_write && (blocks > mtd->erasesize)) {
> - printk(KERN_ERR "Writeable BBTs spanning more than
> one erase block are not yet supported.ÂÂFIX ME!\n");
> + pr_err("Writeable BBTs spanning more than one erase
> block are not yet supported.ÂÂFIX ME!\n");
> Â goto out;
> Â }
> Â
> @@ -1223,7 +1224,7 @@ static inline int __init inftl_partscan(struct
> mtd_info *mtd, struct mtd_partiti
> Â le32_to_cpus(&ip->spareUnits);
> Â le32_to_cpus(&ip->Reserved0);
> Â
> - printk(KERN_INFO "ÂÂÂÂPARTITION[%d] ->\n"
> + pr_info("ÂÂÂÂPARTITION[%d] ->\n"
> Â "ÂÂÂÂÂÂÂÂvirtualUnitsÂÂÂÂ= %d\n"
> Â "ÂÂÂÂÂÂÂÂfirstUnitÂÂÂÂÂÂÂ= %d\n"
> Â "ÂÂÂÂÂÂÂÂlastUnitÂÂÂÂÂÂÂÂ= %d\n"
> @@ -1309,7 +1310,7 @@ static int __init inftl_scan_bbt(struct
> mtd_info *mtd)
> Â struct mtd_partition parts[5];
> Â
> Â if (this->numchips > doc->chips_per_floor) {
> - printk(KERN_ERR "Multi-floor INFTL devices not yet
> supported.\n");
> + pr_err("Multi-floor INFTL devices not yet
> supported.\n");
> Â return -EIO;
> Â }
> Â
> @@ -1437,7 +1438,8 @@ static int __init doc_probe(unsigned long
> physadr)
> Â return -EBUSY;
> Â virtadr = ioremap(physadr, DOC_IOREMAP_LEN);
> Â if (!virtadr) {
> - printk(KERN_ERR "Diskonchip ioremap failed: 0x%x
> bytes at 0x%lx\n", DOC_IOREMAP_LEN, physadr);
> + pr_err("Diskonchip ioremap failed: 0x%x bytes at
> 0x%lx\n",
> + ÂÂÂÂÂÂÂDOC_IOREMAP_LEN, physadr);
> Â ret = -EIO;
> Â goto error_ioremap;
> Â }
> @@ -1496,7 +1498,7 @@ static int __init doc_probe(unsigned long
> physadr)
> Â reg = DoC_Mplus_Toggle;
> Â break;
> Â case DOC_ChipID_DocMilPlus32:
> - printk(KERN_ERR "DiskOnChip Millennium Plus
> 32MB is not supported, ignoring.\n");
> + pr_err("DiskOnChip Millennium Plus 32MB is
> not supported, ignoring.\n");
> Â default:
> Â ret = -ENODEV;
> Â goto notfound;
> @@ -1512,7 +1514,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;
> Â }
> @@ -1546,12 +1548,13 @@ static int __init doc_probe(unsigned long
> physadr)
> Â }
> Â newval = ~newval;
> Â if (oldval == newval) {
> - printk(KERN_DEBUG "Found alias of DOC at
> 0x%lx to 0x%lx\n", doc->physadr, physadr);
> + pr_debug("Found alias of DOC at 0x%lx to
> 0x%lx\n",
> + Âdoc->physadr, physadr);
> Â goto notfound;
> Â }
> Â }
> Â
> - printk(KERN_NOTICE "DiskOnChip found at 0x%lx\n", physadr);
> + pr_notice("DiskOnChip found at 0x%lx\n", physadr);
> Â
> Â len = sizeof(struct nand_chip) + sizeof(struct doc_priv) +
> Â ÂÂÂÂÂÂ(2 * sizeof(struct nand_bbt_descr));
> @@ -1666,12 +1669,13 @@ static int __init init_nanddoc(void)
> Â Â*/
> Â rs_decoder = init_rs(10, 0x409, FCR, 1, NROOTS);
> Â if (!rs_decoder) {
> - printk(KERN_ERR "DiskOnChip: Could not create a RS
> decoder\n");
> + pr_err("DiskOnChip: Could not create a RS
> decoder\n");
> Â return -ENOMEM;
> Â }
> Â
> Â if (doc_config_location) {
> - printk(KERN_INFO "Using configured DiskOnChip probe
> address 0x%lx\n", doc_config_location);
> + pr_info("Using configured DiskOnChip probe address
> 0x%lx\n",
> + doc_config_location);
> Â ret = doc_probe(doc_config_location);
> Â if (ret < 0)
> Â goto outerr;
> @@ -1683,7 +1687,7 @@ static int __init init_nanddoc(void)
> Â /* No banner message any more. Print a message if no
> DiskOnChip
> Â ÂÂÂfound, so the user knows we at least tried. */
> Â if (!doclist) {
> - printk(KERN_INFO "No valid DiskOnChip devices
> found\n");
> + pr_info("No valid DiskOnChip devices found\n");
> Â ret = -ENODEV;
> Â goto outerr;
> Â }
> diff --git a/drivers/mtd/nand/fsl_elbc_nand.c
> b/drivers/mtd/nand/fsl_elbc_nand.c
> index 17db2f9..396216c2 100644
> --- a/drivers/mtd/nand/fsl_elbc_nand.c
> +++ b/drivers/mtd/nand/fsl_elbc_nand.c
> @@ -929,8 +929,8 @@ static int fsl_elbc_nand_probe(struct
> platform_device *pdev)
> Â mtd_device_parse_register(mtd, part_probe_types, NULL,
> Â ÂÂNULL, 0);
> Â
> - printk(KERN_INFO "eLBC NAND device at 0x%llx, bank %d\n",
> - ÂÂÂÂÂÂÂ(unsigned long long)res.start, priv->bank);
> + pr_info("eLBC NAND device at 0x%llx, bank %d\n",
> + (unsigned long long)res.start, priv->bank);
> Â return 0;
> Â
> Âerr:
> diff --git a/drivers/mtd/nand/fsl_ifc_nand.c
> b/drivers/mtd/nand/fsl_ifc_nand.c
> index 9e03bac..f88a493 100644
> --- a/drivers/mtd/nand/fsl_ifc_nand.c
> +++ b/drivers/mtd/nand/fsl_ifc_nand.c
> @@ -805,7 +805,7 @@ static void fsl_ifc_sram_init(struct fsl_ifc_mtd
> *priv)
> Â ÂÂÂmsecs_to_jiffies(IFC_TIMEOUT_MSECS));
> Â
> Â if (ctrl->nand_stat != IFC_NAND_EVTER_STAT_OPC)
> - printk(KERN_ERR "fsl-ifc: Failed to Initialise
> SRAM\n");
> + pr_err("fsl-ifc: Failed to Initialise SRAM\n");
> Â
> Â /* Restore CSOR and CSOR_ext */
> Â ifc_out32(csor, &ifc_global->csor_cs[cs].csor);
> 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..7f11b68 100644
> --- a/drivers/mtd/nand/nand_bch.c
> +++ b/drivers/mtd/nand/nand_bch.c
> @@ -95,7 +95,7 @@ int nand_bch_correct_data(struct mtd_info *mtd,
> unsigned char *buf,
> Â errloc[i]);
> Â }
> Â } else if (count < 0) {
> - printk(KERN_ERR "ecc unrecoverable error\n");
> + pr_err("ecc unrecoverable error\n");
> Â count = -EBADMSG;
> Â }
> Â return count;
> @@ -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..eeb34ef 100644
> --- a/drivers/mtd/nand/nandsim.c
> +++ b/drivers/mtd/nand/nandsim.c
> @@ -23,6 +23,8 @@
> Â * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-
> 1307, USA
> Â */
> Â
> +#define pr_fmt(fmt)ÂÂ"[nandsim]" fmt
> +
> Â#include <linux/init.h>
> Â#include <linux/types.h>
> Â#include <linux/module.h>
> @@ -179,20 +181,17 @@ MODULE_PARM_DESC(bch, Â"Enable
> BCH ecc and set how many bits should "
> Â/* The largest possible page size */
> Â#define NS_LARGEST_PAGE_SIZE 4096
> Â
> -/* The prefix for simulator output */
> -#define NS_OUTPUT_PREFIX "[nandsim]"
> -
> Â/* Simulator's output macros (logging, debugging, warning, error) */
> Â#define NS_LOG(args...) \
> - do { if (log) printk(KERN_DEBUG NS_OUTPUT_PREFIX " log: "
> args); } while(0)
> + do { if (log) pr_debug(" log: " args); } while(0)
> Â#define NS_DBG(args...) \
> - do { if (dbg) printk(KERN_DEBUG NS_OUTPUT_PREFIX " debug: "
> args); } while(0)
> + do { if (dbg) pr_debug(" debug: " args); } while(0)
> Â#define NS_WARN(args...) \
> - do { printk(KERN_WARNING NS_OUTPUT_PREFIX " warning: "
> args); } while(0)
> + do { pr_warn(" warning: " args); } while(0)
> Â#define NS_ERR(args...) \
> - do { printk(KERN_ERR NS_OUTPUT_PREFIX " error: " args); }
> while(0)
> + do { pr_err(" error: " args); } while(0)
> Â#define NS_INFO(args...) \
> - do { printk(KERN_INFO NS_OUTPUT_PREFIX " " args); } while(0)
> + do { pr_info(" " args); } while(0)
> Â
> Â/* Busy-wait delay macros (microseconds, milliseconds) */
> Â#define NS_UDELAY(us) \
> diff --git a/drivers/mtd/nand/r852.c b/drivers/mtd/nand/r852.c
> index fc9287a..cd3cd1c 100644
> --- a/drivers/mtd/nand/r852.c
> +++ b/drivers/mtd/nand/r852.c
> @@ -7,6 +7,9 @@
> Â * published by the Free Software Foundation.
> Â */
> Â
> +#define DRV_NAME "r852"
> +#define pr_fmt(fmt)ÂÂDRV_NAME fmt

I've done this kind of change for the first time.
So please guide me if I am wrong here or if I made
things more complex.

Thanks

> +
> Â#include <linux/kernel.h>
> Â#include <linux/module.h>
> Â#include <linux/jiffies.h>
> @@ -935,7 +938,7 @@ static intÂÂr852_probe(struct pci_dev *pci_dev,
> const struct pci_device_id *id)
> Â &dev->card_detect_work, 0);
> Â
> Â
> - printk(KERN_NOTICE DRV_NAME ": driver loaded
> successfully\n");
> + pr_notice(": driver loaded successfully\n");
> Â return 0;
> Â
> Âerror10:
> diff --git a/drivers/mtd/nand/r852.h b/drivers/mtd/nand/r852.h
> index 8713c57..709eced 100644
> --- a/drivers/mtd/nand/r852.h
> +++ b/drivers/mtd/nand/r852.h
> @@ -145,16 +145,16 @@ struct r852_device {
> Â};
> Â
> Â#define DRV_NAME "r852"
> -
> +#define pr_fmt(fmt)ÂÂDRV_NAME fmt
> Â
> Â#define dbg(format, ...) \
> Â if (debug) \
> - printk(KERN_DEBUG DRV_NAME ": " format "\n", ##
> __VA_ARGS__)
> + pr_debug(": " format "\n", ## __VA_ARGS__)
> Â
> Â#define dbg_verbose(format, ...) \
> Â if (debug > 1) \
> - printk(KERN_DEBUG DRV_NAME ": " format "\n", ##
> __VA_ARGS__)
> + pr_debug(": " format "\n", ## __VA_ARGS__)
> Â
> Â
> Â#define message(format, ...) \
> - printk(KERN_INFO DRV_NAME ": " format "\n", ## __VA_ARGS__)
> + pr_info(": " format "\n", ## __VA_ARGS__)
> diff --git a/drivers/mtd/nand/sh_flctl.c
> b/drivers/mtd/nand/sh_flctl.c
> index e7f3c98..493f6b2 100644
> --- a/drivers/mtd/nand/sh_flctl.c
> +++ b/drivers/mtd/nand/sh_flctl.c
> @@ -877,7 +877,7 @@ static void flctl_cmdfunc(struct mtd_info *mtd,
> unsigned int command,
> Â else if (!flctl->seqin_column)
> Â execmd_write_page_sector(mtd);
> Â else
> - printk(KERN_ERR "Invalid address
> !?\n");
> + pr_err("Invalid address !?\n");
> Â break;
> Â }
> Â set_cmd_regs(mtd, command, (command << 8) |
> NAND_CMD_SEQIN);
> diff --git a/drivers/mtd/nand/sm_common.c
> b/drivers/mtd/nand/sm_common.c
> index c378705..7f5044a 100644
> --- a/drivers/mtd/nand/sm_common.c
> +++ b/drivers/mtd/nand/sm_common.c
> @@ -119,9 +119,8 @@ static int sm_block_markbad(struct mtd_info *mtd,
> loff_t ofs)
> Â
> Â ret = mtd_write_oob(mtd, ofs, &ops);
> Â if (ret < 0 || ops.oobretlen != SM_OOB_SIZE) {
> - printk(KERN_NOTICE
> - "sm_common: can't mark sector at %i as
> bad\n",
> - (int
> )ofs);
> + pr_notice("sm_common: can't mark sector at %i as
> bad\n",
> + ÂÂ(int)ofs);
> Â return -EIO;
> Â }
> Â