* [PATCH NAND 0/5] Replace printk statements with pr_*macros
@ 2018-02-16 16:50 Shreeya Patel
2018-02-16 16:55 ` [PATCH NAND 1/5] mtd/nand: Replace printk with pr_warn Shreeya Patel
` (6 more replies)
0 siblings, 7 replies; 26+ messages in thread
From: Shreeya Patel @ 2018-02-16 16:50 UTC (permalink / raw)
To: boris.brezillon, richard, dwmw2, computersforpeace, marek.vasut,
cyrille.pitchen, outreachy-kernel, ezequiel
Cc: Shreeya Patel
This patchset removes all the log levels i.e. KERN_WARN,
KERN_NOTICE, KERN_ERR, KERN_INFO, KERN_DEBUG used in the printk
statements and replaces the printk statements with appropriate
pr_*macros.
According to the kernel coding style, pr_*macro is the preferred
way to print the message.
Shreeya Patel (5):
mtd/nand: Replace printk with pr_warn
mtd/nand: Replace printk with pr_notice
mtd/nand: Replace printk with pr_err
mtd/nand: Replace printk with pr_info
mtd/nand: Replace printk with pr_debug
drivers/mtd/nand/ams-delta.c | 4 +--
drivers/mtd/nand/cafe_nand.c | 4 +--
drivers/mtd/nand/cs553x_nand.c | 8 ++---
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 | 10 +++---
drivers/mtd/nand/r852.c | 2 +-
drivers/mtd/nand/r852.h | 6 ++--
drivers/mtd/nand/sh_flctl.c | 2 +-
drivers/mtd/nand/sm_common.c | 5 ++-
13 files changed, 70 insertions(+), 67 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH NAND 1/5] mtd/nand: Replace printk with pr_warn
2018-02-16 16:50 [PATCH NAND 0/5] Replace printk statements with pr_*macros Shreeya Patel
@ 2018-02-16 16:55 ` Shreeya Patel
2018-02-16 17:08 ` [Outreachy kernel] " Julia Lawall
2018-02-16 16:57 ` [PATCH NAND 2/5] mtd/nand: Replace printk with pr_notice Shreeya Patel
` (5 subsequent siblings)
6 siblings, 1 reply; 26+ messages in thread
From: Shreeya Patel @ 2018-02-16 16:55 UTC (permalink / raw)
To: boris.brezillon, richard, dwmw2, computersforpeace, marek.vasut,
cyrille.pitchen, outreachy-kernel, ezequiel
Cc: Shreeya Patel
pr_*macro is the preferred way to print messages, replace all
printk(KERN_WARN, ...) with pr_warn.
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
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH NAND 2/5] mtd/nand: Replace printk with pr_notice
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 16:57 ` Shreeya Patel
2018-02-16 17:00 ` [PATCH NAND 3/5] mtd/nand: Replace printk with pr_err Shreeya Patel
` (4 subsequent siblings)
6 siblings, 0 replies; 26+ messages in thread
From: Shreeya Patel @ 2018-02-16 16:57 UTC (permalink / raw)
To: boris.brezillon, richard, dwmw2, computersforpeace, marek.vasut,
cyrille.pitchen, outreachy-kernel, ezequiel
Cc: Shreeya Patel
pr_*macro is the preferred way to print messages, replace all
printk(KERN_NOTICE, ...) with pr_notice.
Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
---
drivers/mtd/nand/ams-delta.c | 2 +-
drivers/mtd/nand/cs553x_nand.c | 4 ++--
drivers/mtd/nand/diskonchip.c | 2 +-
drivers/mtd/nand/r852.c | 2 +-
drivers/mtd/nand/sm_common.c | 5 ++---
5 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/mtd/nand/ams-delta.c b/drivers/mtd/nand/ams-delta.c
index 24b1c24..e120ce9 100644
--- a/drivers/mtd/nand/ams-delta.c
+++ b/drivers/mtd/nand/ams-delta.c
@@ -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/cs553x_nand.c b/drivers/mtd/nand/cs553x_nand.c
index d4269a4..ec54f81 100644
--- a/drivers/mtd/nand/cs553x_nand.c
+++ b/drivers/mtd/nand/cs553x_nand.c
@@ -189,10 +189,10 @@ 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;
}
diff --git a/drivers/mtd/nand/diskonchip.c b/drivers/mtd/nand/diskonchip.c
index dac4aec..ae2452d 100644
--- a/drivers/mtd/nand/diskonchip.c
+++ b/drivers/mtd/nand/diskonchip.c
@@ -1551,7 +1551,7 @@ static int __init doc_probe(unsigned long physadr)
}
}
- 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));
diff --git a/drivers/mtd/nand/r852.c b/drivers/mtd/nand/r852.c
index fc9287a..3d54c6a 100644
--- a/drivers/mtd/nand/r852.c
+++ b/drivers/mtd/nand/r852.c
@@ -935,7 +935,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(DRV_NAME ": driver loaded successfully\n");
return 0;
error10:
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;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH NAND 3/5] mtd/nand: Replace printk with pr_err
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 16:57 ` [PATCH NAND 2/5] mtd/nand: Replace printk with pr_notice Shreeya Patel
@ 2018-02-16 17:00 ` Shreeya Patel
2018-02-16 17:03 ` [PATCH NAND 4/5] mtd/nand: Replace printk with pr_info Shreeya Patel
` (3 subsequent siblings)
6 siblings, 0 replies; 26+ messages in thread
From: Shreeya Patel @ 2018-02-16 17:00 UTC (permalink / raw)
To: boris.brezillon, richard, dwmw2, computersforpeace, marek.vasut,
cyrille.pitchen, outreachy-kernel, ezequiel
Cc: Shreeya Patel
pr_*macro is the preferred way to print messages, replace all
printk(KERN_ERR, ...) with pr_err.
Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
---
drivers/mtd/nand/diskonchip.c | 22 ++++++++++++----------
drivers/mtd/nand/fsl_ifc_nand.c | 2 +-
drivers/mtd/nand/nand_bch.c | 2 +-
drivers/mtd/nand/nandsim.c | 2 +-
drivers/mtd/nand/sh_flctl.c | 2 +-
5 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/drivers/mtd/nand/diskonchip.c b/drivers/mtd/nand/diskonchip.c
index ae2452d..93d23d1d 100644
--- a/drivers/mtd/nand/diskonchip.c
+++ b/drivers/mtd/nand/diskonchip.c
@@ -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;
@@ -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;
@@ -1110,7 +1111,7 @@ static inline int __init nftl_partscan(struct mtd_info *mtd, struct mtd_partitio
}
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;
}
@@ -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;
}
@@ -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;
@@ -1666,7 +1668,7 @@ 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;
}
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/nand_bch.c b/drivers/mtd/nand/nand_bch.c
index 366c04a..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;
diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c
index b2436ea..96df1c5 100644
--- a/drivers/mtd/nand/nandsim.c
+++ b/drivers/mtd/nand/nandsim.c
@@ -190,7 +190,7 @@ MODULE_PARM_DESC(bch, "Enable BCH ecc and set how many bits should "
#define NS_WARN(args...) \
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)
+ do { pr_err(NS_OUTPUT_PREFIX " error: " args); } while(0)
#define NS_INFO(args...) \
do { printk(KERN_INFO NS_OUTPUT_PREFIX " " args); } while(0)
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);
--
2.7.4
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH NAND 4/5] mtd/nand: Replace printk with pr_info
2018-02-16 16:50 [PATCH NAND 0/5] Replace printk statements with pr_*macros Shreeya Patel
` (2 preceding siblings ...)
2018-02-16 17:00 ` [PATCH NAND 3/5] mtd/nand: Replace printk with pr_err Shreeya Patel
@ 2018-02-16 17:03 ` Shreeya Patel
2018-02-16 17:08 ` [PATCH NAND 5/5] mtd/nand: Replace printk with pr_debug Shreeya Patel
` (2 subsequent siblings)
6 siblings, 0 replies; 26+ messages in thread
From: Shreeya Patel @ 2018-02-16 17:03 UTC (permalink / raw)
To: boris.brezillon, richard, dwmw2, computersforpeace, marek.vasut,
cyrille.pitchen, outreachy-kernel, ezequiel
Cc: Shreeya Patel
pr_*macro is the preferred way to print messages, replace all
printk(KERN_INFO, ...) with pr_info.
Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
---
drivers/mtd/nand/cs553x_nand.c | 2 +-
drivers/mtd/nand/diskonchip.c | 39 ++++++++++++++++++++-------------------
drivers/mtd/nand/fsl_elbc_nand.c | 4 ++--
drivers/mtd/nand/nandsim.c | 2 +-
drivers/mtd/nand/r852.h | 2 +-
5 files changed, 25 insertions(+), 24 deletions(-)
diff --git a/drivers/mtd/nand/cs553x_nand.c b/drivers/mtd/nand/cs553x_nand.c
index ec54f81..e690ddc 100644
--- a/drivers/mtd/nand/cs553x_nand.c
+++ b/drivers/mtd/nand/cs553x_nand.c
@@ -295,7 +295,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 93d23d1d..d921b9a 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;
}
}
@@ -1020,7 +1020,7 @@ static int __init find_media_headers(struct mtd_info *mtd, u_char *buf, const ch
}
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)
@@ -1070,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);
@@ -1105,7 +1105,7 @@ 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);
}
@@ -1182,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,
@@ -1224,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"
@@ -1673,7 +1673,8 @@ static int __init init_nanddoc(void)
}
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;
@@ -1685,7 +1686,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/nandsim.c b/drivers/mtd/nand/nandsim.c
index 96df1c5..cfcc907 100644
--- a/drivers/mtd/nand/nandsim.c
+++ b/drivers/mtd/nand/nandsim.c
@@ -192,7 +192,7 @@ MODULE_PARM_DESC(bch, "Enable BCH ecc and set how many bits should "
#define NS_ERR(args...) \
do { pr_err(NS_OUTPUT_PREFIX " error: " args); } while(0)
#define NS_INFO(args...) \
- do { printk(KERN_INFO NS_OUTPUT_PREFIX " " args); } while(0)
+ do { pr_info(NS_OUTPUT_PREFIX " " args); } while(0)
/* Busy-wait delay macros (microseconds, milliseconds) */
#define NS_UDELAY(us) \
diff --git a/drivers/mtd/nand/r852.h b/drivers/mtd/nand/r852.h
index 8713c57..c59ca11 100644
--- a/drivers/mtd/nand/r852.h
+++ b/drivers/mtd/nand/r852.h
@@ -157,4 +157,4 @@ struct r852_device {
#define message(format, ...) \
- printk(KERN_INFO DRV_NAME ": " format "\n", ## __VA_ARGS__)
+ pr_info(DRV_NAME ": " format "\n", ## __VA_ARGS__)
--
2.7.4
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH NAND 5/5] mtd/nand: Replace printk with pr_debug
2018-02-16 16:50 [PATCH NAND 0/5] Replace printk statements with pr_*macros Shreeya Patel
` (3 preceding siblings ...)
2018-02-16 17:03 ` [PATCH NAND 4/5] mtd/nand: Replace printk with pr_info Shreeya Patel
@ 2018-02-16 17:08 ` Shreeya Patel
2018-02-16 17:19 ` [PATCH NAND 0/5] Replace printk statements with pr_*macros Richard Weinberger
2018-02-16 17:19 ` Ezequiel Garcia
6 siblings, 0 replies; 26+ messages in thread
From: Shreeya Patel @ 2018-02-16 17:08 UTC (permalink / raw)
To: boris.brezillon, richard, dwmw2, computersforpeace, marek.vasut,
cyrille.pitchen, outreachy-kernel, ezequiel
Cc: Shreeya Patel
pr_*macro is the preferred way to print messages, replace all
printk(KERN_DEBUG, ...) with pr_debug.
Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
---
drivers/mtd/nand/diskonchip.c | 5 +++--
drivers/mtd/nand/nandsim.c | 4 ++--
drivers/mtd/nand/r852.h | 4 ++--
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/mtd/nand/diskonchip.c b/drivers/mtd/nand/diskonchip.c
index d921b9a..4821ecc 100644
--- a/drivers/mtd/nand/diskonchip.c
+++ b/drivers/mtd/nand/diskonchip.c
@@ -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)
@@ -1548,7 +1548,8 @@ 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;
}
}
diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c
index cfcc907..4e5f817 100644
--- a/drivers/mtd/nand/nandsim.c
+++ b/drivers/mtd/nand/nandsim.c
@@ -184,9 +184,9 @@ MODULE_PARM_DESC(bch, "Enable BCH ecc and set how many bits should "
/* 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(NS_OUTPUT_PREFIX " 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(NS_OUTPUT_PREFIX " debug: " args); } while(0)
#define NS_WARN(args...) \
do { pr_warn(NS_OUTPUT_PREFIX " warning: " args); } while(0)
#define NS_ERR(args...) \
diff --git a/drivers/mtd/nand/r852.h b/drivers/mtd/nand/r852.h
index c59ca11..63de9b6 100644
--- a/drivers/mtd/nand/r852.h
+++ b/drivers/mtd/nand/r852.h
@@ -149,11 +149,11 @@ struct r852_device {
#define dbg(format, ...) \
if (debug) \
- printk(KERN_DEBUG DRV_NAME ": " format "\n", ## __VA_ARGS__)
+ pr_debug(DRV_NAME ": " format "\n", ## __VA_ARGS__)
#define dbg_verbose(format, ...) \
if (debug > 1) \
- printk(KERN_DEBUG DRV_NAME ": " format "\n", ## __VA_ARGS__)
+ pr_debug(DRV_NAME ": " format "\n", ## __VA_ARGS__)
#define message(format, ...) \
--
2.7.4
^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [Outreachy kernel] [PATCH NAND 1/5] mtd/nand: Replace printk with pr_warn
2018-02-16 16:55 ` [PATCH NAND 1/5] mtd/nand: Replace printk with pr_warn Shreeya Patel
@ 2018-02-16 17:08 ` Julia Lawall
2018-02-16 17:52 ` Shreeya Patel
0 siblings, 1 reply; 26+ messages in thread
From: Julia Lawall @ 2018-02-16 17:08 UTC (permalink / raw)
To: Shreeya Patel
Cc: boris.brezillon, richard, dwmw2, computersforpeace, marek.vasut,
cyrille.pitchen, outreachy-kernel, ezequiel
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?
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.shreeya.patel23498%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH NAND 0/5] Replace printk statements with pr_*macros
2018-02-16 16:50 [PATCH NAND 0/5] Replace printk statements with pr_*macros Shreeya Patel
` (4 preceding siblings ...)
2018-02-16 17:08 ` [PATCH NAND 5/5] mtd/nand: Replace printk with pr_debug Shreeya Patel
@ 2018-02-16 17:19 ` Richard Weinberger
2018-02-16 17:24 ` Ezequiel Garcia
2018-02-16 18:00 ` Boris Brezillon
2018-02-16 17:19 ` Ezequiel Garcia
6 siblings, 2 replies; 26+ messages in thread
From: Richard Weinberger @ 2018-02-16 17:19 UTC (permalink / raw)
To: Shreeya Patel
Cc: boris.brezillon, dwmw2, computersforpeace, marek.vasut,
cyrille.pitchen, outreachy-kernel, ezequiel
Am Freitag, 16. Februar 2018, 17:50:09 CET schrieb Shreeya Patel:
> This patchset removes all the log levels i.e. KERN_WARN,
> KERN_NOTICE, KERN_ERR, KERN_INFO, KERN_DEBUG used in the printk
> statements and replaces the printk statements with appropriate
> pr_*macros.
> According to the kernel coding style, pr_*macro is the preferred
> way to print the message.
Beside of that, how does it improve the code?
Don't get me wrong, pr_* is the way to go for new code, but I don't think it
is worth "fixing" in existing code and make working with git blame more
painful.
Thanks,
//richard
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH NAND 0/5] Replace printk statements with pr_*macros
2018-02-16 16:50 [PATCH NAND 0/5] Replace printk statements with pr_*macros Shreeya Patel
` (5 preceding siblings ...)
2018-02-16 17:19 ` [PATCH NAND 0/5] Replace printk statements with pr_*macros Richard Weinberger
@ 2018-02-16 17:19 ` Ezequiel Garcia
2018-02-16 17:23 ` [Outreachy kernel] " Julia Lawall
` (2 more replies)
6 siblings, 3 replies; 26+ messages in thread
From: Ezequiel Garcia @ 2018-02-16 17:19 UTC (permalink / raw)
To: Shreeya Patel
Cc: Boris Brezillon, Richard Weinberger, David Woodhouse,
Brian Norris, Marek Vasut, Cyrille Pitchen, outreachy-kernel,
linux-mtd
Hi Shreeya,
Thanks for the contribution.
On 16 February 2018 at 13:50, Shreeya Patel
<shreeya.patel23498@gmail.com> wrote:
> This patchset removes all the log levels i.e. KERN_WARN,
> KERN_NOTICE, KERN_ERR, KERN_INFO, KERN_DEBUG used in the printk
> statements and replaces the printk statements with appropriate
> pr_*macros.
> According to the kernel coding style, pr_*macro is the preferred
> way to print the message.
>
So, two things to begin with.
First of all, despite this contribution being part of outreachy,
I believe you can include mailing lists in your case.
In other words, don't use the "nol" option in get_maintainer
script and Cc the MTD mailing list: linux-mtd at lists.infradead.org.
>
> Shreeya Patel (5):
> mtd/nand: Replace printk with pr_warn
> mtd/nand: Replace printk with pr_notice
> mtd/nand: Replace printk with pr_err
> mtd/nand: Replace printk with pr_info
> mtd/nand: Replace printk with pr_debug
>
This is a non-usual split. We usually split patches per-driver,
instead of grouping all the pr_{} of a given type together.
Can you re-do the series? Grouping the changes per-driver,
i.e. all the pr_{} changes in cafe_nand.c together, and so on.
> drivers/mtd/nand/ams-delta.c | 4 +--
> drivers/mtd/nand/cafe_nand.c | 4 +--
> drivers/mtd/nand/cs553x_nand.c | 8 ++---
> 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 | 10 +++---
> drivers/mtd/nand/r852.c | 2 +-
> drivers/mtd/nand/r852.h | 6 ++--
> drivers/mtd/nand/sh_flctl.c | 2 +-
> drivers/mtd/nand/sm_common.c | 5 ++-
> 13 files changed, 70 insertions(+), 67 deletions(-)
>
> --
> 2.7.4
>
--
Ezequiel García, VanguardiaSur
www.vanguardiasur.com.ar
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [Outreachy kernel] Re: [PATCH NAND 0/5] Replace printk statements with pr_*macros
2018-02-16 17:19 ` Ezequiel Garcia
@ 2018-02-16 17:23 ` Julia Lawall
2018-02-16 17:26 ` Ezequiel Garcia
2018-02-16 17:35 ` Shreeya Patel
2018-02-16 17:45 ` Boris Brezillon
2 siblings, 1 reply; 26+ messages in thread
From: Julia Lawall @ 2018-02-16 17:23 UTC (permalink / raw)
To: Ezequiel Garcia
Cc: Shreeya Patel, Boris Brezillon, Richard Weinberger,
David Woodhouse, Brian Norris, Marek Vasut, Cyrille Pitchen,
outreachy-kernel, linux-mtd
[-- Attachment #1: Type: text/plain, Size: 2717 bytes --]
On Fri, 16 Feb 2018, Ezequiel Garcia wrote:
> Hi Shreeya,
>
> Thanks for the contribution.
>
> On 16 February 2018 at 13:50, Shreeya Patel
> <shreeya.patel23498@gmail.com> wrote:
> > This patchset removes all the log levels i.e. KERN_WARN,
> > KERN_NOTICE, KERN_ERR, KERN_INFO, KERN_DEBUG used in the printk
> > statements and replaces the printk statements with appropriate
> > pr_*macros.
> > According to the kernel coding style, pr_*macro is the preferred
> > way to print the message.
> >
>
> So, two things to begin with.
>
> First of all, despite this contribution being part of outreachy,
> I believe you can include mailing lists in your case.
>
> In other words, don't use the "nol" option in get_maintainer
> script and Cc the MTD mailing list: linux-mtd at lists.infradead.org.
Shouldn't the dev_* functions also be usable?
julia
>
> >
> > Shreeya Patel (5):
> > mtd/nand: Replace printk with pr_warn
> > mtd/nand: Replace printk with pr_notice
> > mtd/nand: Replace printk with pr_err
> > mtd/nand: Replace printk with pr_info
> > mtd/nand: Replace printk with pr_debug
> >
>
> This is a non-usual split. We usually split patches per-driver,
> instead of grouping all the pr_{} of a given type together.
>
> Can you re-do the series? Grouping the changes per-driver,
> i.e. all the pr_{} changes in cafe_nand.c together, and so on.
>
> > drivers/mtd/nand/ams-delta.c | 4 +--
> > drivers/mtd/nand/cafe_nand.c | 4 +--
> > drivers/mtd/nand/cs553x_nand.c | 8 ++---
> > 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 | 10 +++---
> > drivers/mtd/nand/r852.c | 2 +-
> > drivers/mtd/nand/r852.h | 6 ++--
> > drivers/mtd/nand/sh_flctl.c | 2 +-
> > drivers/mtd/nand/sm_common.c | 5 ++-
> > 13 files changed, 70 insertions(+), 67 deletions(-)
> >
> > --
> > 2.7.4
> >
>
>
>
> --
> Ezequiel García, VanguardiaSur
> www.vanguardiasur.com.ar
>
> --
> 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/CAAEAJfAg_hei2PF37_oX2tf%2BMv43ye-nEOt%2BKRVFerp1Jfzn2Q%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH NAND 0/5] Replace printk statements with pr_*macros
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
` (2 more replies)
2018-02-16 18:00 ` Boris Brezillon
1 sibling, 3 replies; 26+ messages in thread
From: Ezequiel Garcia @ 2018-02-16 17:24 UTC (permalink / raw)
To: Richard Weinberger
Cc: Shreeya Patel, Boris Brezillon, David Woodhouse, Brian Norris,
Marek Vasut, Cyrille Pitchen, outreachy-kernel
Hey Richard,
On 16 February 2018 at 14:19, Richard Weinberger <richard@nod.at> wrote:
> Am Freitag, 16. Februar 2018, 17:50:09 CET schrieb Shreeya Patel:
>> This patchset removes all the log levels i.e. KERN_WARN,
>> KERN_NOTICE, KERN_ERR, KERN_INFO, KERN_DEBUG used in the printk
>> statements and replaces the printk statements with appropriate
>> pr_*macros.
>> According to the kernel coding style, pr_*macro is the preferred
>> way to print the message.
>
> Beside of that, how does it improve the code?
> Don't get me wrong, pr_* is the way to go for new code, but I don't think it
> is worth "fixing" in existing code and make working with git blame more
> painful.
>
Shreeya's intention is to work on [1], migrating drivers to exec_op.
As a first task, before being accepted, she is required to submit
cleanup patches (or small tasks).
Since I couldn't come up with small tasks for MTD, I suggested
starting with printk cleaning. So this was my idea.
Printk to pr_{} or dev_{} is not only aesthetical, it's also a consolidation
change. Centralizing prints allows for other improvements.
See for instance Wolfram's work [2, 3].
In any case, does it hurt git-blame so much? It only affects
the lines where the print is performed.
BTW, should you have ideas for small cleanup tasks in MTD,
let us know.
[1] https://www.outreachy.org/communities/cfp/linux-kernel/project/migrate-nand-driver-to-new-exec_op-framework/
[2] https://elinux.org/Refactor_kernel_strings
[3] https://elinux.org/Refactor_kernel_strings
Thanks,
--
Ezequiel García, VanguardiaSur
www.vanguardiasur.com.ar
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH NAND 0/5] Replace printk statements with pr_*macros
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:48 ` [Outreachy kernel] " Greg KH
2 siblings, 0 replies; 26+ messages in thread
From: Ezequiel Garcia @ 2018-02-16 17:25 UTC (permalink / raw)
To: Richard Weinberger
Cc: Shreeya Patel, Boris Brezillon, David Woodhouse, Brian Norris,
Marek Vasut, Cyrille Pitchen, outreachy-kernel, linux-mtd
(Ccing MTD)
On 16 February 2018 at 14:24, Ezequiel Garcia
<ezequiel@vanguardiasur.com.ar> wrote:
> Hey Richard,
>
> On 16 February 2018 at 14:19, Richard Weinberger <richard@nod.at> wrote:
>> Am Freitag, 16. Februar 2018, 17:50:09 CET schrieb Shreeya Patel:
>>> This patchset removes all the log levels i.e. KERN_WARN,
>>> KERN_NOTICE, KERN_ERR, KERN_INFO, KERN_DEBUG used in the printk
>>> statements and replaces the printk statements with appropriate
>>> pr_*macros.
>>> According to the kernel coding style, pr_*macro is the preferred
>>> way to print the message.
>>
>> Beside of that, how does it improve the code?
>> Don't get me wrong, pr_* is the way to go for new code, but I don't think it
>> is worth "fixing" in existing code and make working with git blame more
>> painful.
>>
>
> Shreeya's intention is to work on [1], migrating drivers to exec_op.
> As a first task, before being accepted, she is required to submit
> cleanup patches (or small tasks).
>
> Since I couldn't come up with small tasks for MTD, I suggested
> starting with printk cleaning. So this was my idea.
>
> Printk to pr_{} or dev_{} is not only aesthetical, it's also a consolidation
> change. Centralizing prints allows for other improvements.
>
> See for instance Wolfram's work [2, 3].
>
> In any case, does it hurt git-blame so much? It only affects
> the lines where the print is performed.
>
> BTW, should you have ideas for small cleanup tasks in MTD,
> let us know.
>
> [1] https://www.outreachy.org/communities/cfp/linux-kernel/project/migrate-nand-driver-to-new-exec_op-framework/
> [2] https://elinux.org/Refactor_kernel_strings
> [3] https://elinux.org/Refactor_kernel_strings
>
> Thanks,
> --
> Ezequiel García, VanguardiaSur
> www.vanguardiasur.com.ar
--
Ezequiel García, VanguardiaSur
www.vanguardiasur.com.ar
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [Outreachy kernel] Re: [PATCH NAND 0/5] Replace printk statements with pr_*macros
2018-02-16 17:23 ` [Outreachy kernel] " Julia Lawall
@ 2018-02-16 17:26 ` Ezequiel Garcia
2018-02-16 17:48 ` Boris Brezillon
0 siblings, 1 reply; 26+ messages in thread
From: Ezequiel Garcia @ 2018-02-16 17:26 UTC (permalink / raw)
To: Julia Lawall
Cc: Shreeya Patel, Boris Brezillon, Richard Weinberger,
David Woodhouse, Brian Norris, Marek Vasut, Cyrille Pitchen,
outreachy-kernel, linux-mtd
On 16 February 2018 at 14:23, Julia Lawall <julia.lawall@lip6.fr> wrote:
>
>
> On Fri, 16 Feb 2018, Ezequiel Garcia wrote:
>
>> Hi Shreeya,
>>
>> Thanks for the contribution.
>>
>> On 16 February 2018 at 13:50, Shreeya Patel
>> <shreeya.patel23498@gmail.com> wrote:
>> > This patchset removes all the log levels i.e. KERN_WARN,
>> > KERN_NOTICE, KERN_ERR, KERN_INFO, KERN_DEBUG used in the printk
>> > statements and replaces the printk statements with appropriate
>> > pr_*macros.
>> > According to the kernel coding style, pr_*macro is the preferred
>> > way to print the message.
>> >
>>
>> So, two things to begin with.
>>
>> First of all, despite this contribution being part of outreachy,
>> I believe you can include mailing lists in your case.
>>
>> In other words, don't use the "nol" option in get_maintainer
>> script and Cc the MTD mailing list: linux-mtd at lists.infradead.org.
>
> Shouldn't the dev_* functions also be usable?
>
Provided that:
1. it's applicable, i.e. if in the context of a device.
2. Richard is not too opposed to the idea.
Then, yes.
--
Ezequiel García, VanguardiaSur
www.vanguardiasur.com.ar
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH NAND 0/5] Replace printk statements with pr_*macros
2018-02-16 17:19 ` Ezequiel Garcia
2018-02-16 17:23 ` [Outreachy kernel] " Julia Lawall
@ 2018-02-16 17:35 ` Shreeya Patel
2018-02-16 17:45 ` Boris Brezillon
2 siblings, 0 replies; 26+ messages in thread
From: Shreeya Patel @ 2018-02-16 17:35 UTC (permalink / raw)
To: Ezequiel Garcia
Cc: Boris Brezillon, Richard Weinberger, David Woodhouse,
Brian Norris, Marek Vasut, Cyrille Pitchen, outreachy-kernel,
linux-mtd
On Fri, 2018-02-16 at 14:19 -0300, Ezequiel Garcia wrote:
> Hi Shreeya,
>
> Thanks for the contribution.
>
> On 16 February 2018 at 13:50, Shreeya Patel
> <shreeya.patel23498@gmail.com> wrote:
> >
> > This patchset removes all the log levels i.e. KERN_WARN,
> > KERN_NOTICE, KERN_ERR, KERN_INFO, KERN_DEBUG used in the printk
> > statements and replaces the printk statements with appropriate
> > pr_*macros.
> > According to the kernel coding style, pr_*macro is the preferred
> > way to print the message.
> >
> So, two things to begin with.
>
> First of all, despite this contribution being part of outreachy,
> I believe you can include mailing lists in your case.
>
> In other words, don't use the "nol" option in get_maintainer
> script and Cc the MTD mailing list: linux-mtd at lists.infradead.org.
Ok. I'll take care of this.
>
> >
> >
> > Shreeya Patel (5):
> > mtd/nand: Replace printk with pr_warn
> > mtd/nand: Replace printk with pr_notice
> > mtd/nand: Replace printk with pr_err
> > mtd/nand: Replace printk with pr_info
> > mtd/nand: Replace printk with pr_debug
> >
> This is a non-usual split. We usually split patches per-driver,
> instead of grouping all the pr_{} of a given type together.
>
> Can you re-do the series? Grouping the changes per-driver,
> i.e. all the pr_{} changes in cafe_nand.c together, and so on.
Yes, I'll do it again. :)
Also, I wanted to ask you that there are still printk statements
present in the driver which are just printing the message i.e. they
don't include any log levels.
So should I leave them as it is?
Thanks for your reviews
>
> >
> > drivers/mtd/nand/ams-delta.c | 4 +--
> > drivers/mtd/nand/cafe_nand.c | 4 +--
> > drivers/mtd/nand/cs553x_nand.c | 8 ++---
> > 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 | 10 +++---
> > drivers/mtd/nand/r852.c | 2 +-
> > drivers/mtd/nand/r852.h | 6 ++--
> > drivers/mtd/nand/sh_flctl.c | 2 +-
> > drivers/mtd/nand/sm_common.c | 5 ++-
> > 13 files changed, 70 insertions(+), 67 deletions(-)
> >
> > --
> > 2.7.4
> >
>
>
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH NAND 0/5] Replace printk statements with pr_*macros
2018-02-16 17:19 ` Ezequiel Garcia
2018-02-16 17:23 ` [Outreachy kernel] " Julia Lawall
2018-02-16 17:35 ` Shreeya Patel
@ 2018-02-16 17:45 ` Boris Brezillon
2 siblings, 0 replies; 26+ messages in thread
From: Boris Brezillon @ 2018-02-16 17:45 UTC (permalink / raw)
To: Ezequiel Garcia
Cc: Shreeya Patel, Boris Brezillon, Richard Weinberger,
David Woodhouse, Brian Norris, Marek Vasut, Cyrille Pitchen,
outreachy-kernel, linux-mtd
On Fri, 16 Feb 2018 14:19:41 -0300
Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> wrote:
> Hi Shreeya,
>
> Thanks for the contribution.
>
> On 16 February 2018 at 13:50, Shreeya Patel
> <shreeya.patel23498@gmail.com> wrote:
> > This patchset removes all the log levels i.e. KERN_WARN,
> > KERN_NOTICE, KERN_ERR, KERN_INFO, KERN_DEBUG used in the printk
> > statements and replaces the printk statements with appropriate
> > pr_*macros.
> > According to the kernel coding style, pr_*macro is the preferred
> > way to print the message.
> >
>
> So, two things to begin with.
>
> First of all, despite this contribution being part of outreachy,
> I believe you can include mailing lists in your case.
>
> In other words, don't use the "nol" option in get_maintainer
> script and Cc the MTD mailing list: linux-mtd at lists.infradead.org.
>
> >
> > Shreeya Patel (5):
> > mtd/nand: Replace printk with pr_warn
> > mtd/nand: Replace printk with pr_notice
> > mtd/nand: Replace printk with pr_err
> > mtd/nand: Replace printk with pr_info
> > mtd/nand: Replace printk with pr_debug
Nitpick: prefix should be "mtd: nand: ".
> >
>
> This is a non-usual split. We usually split patches per-driver,
> instead of grouping all the pr_{} of a given type together.
I agree.
>
> Can you re-do the series? Grouping the changes per-driver,
> i.e. all the pr_{} changes in cafe_nand.c together, and so on.
Actually, for such simple/automatic changes you can even group things
in a single patch. I'm fine either way.
>
> > drivers/mtd/nand/ams-delta.c | 4 +--
> > drivers/mtd/nand/cafe_nand.c | 4 +--
> > drivers/mtd/nand/cs553x_nand.c | 8 ++---
> > 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 | 10 +++---
> > drivers/mtd/nand/r852.c | 2 +-
> > drivers/mtd/nand/r852.h | 6 ++--
> > drivers/mtd/nand/sh_flctl.c | 2 +-
> > drivers/mtd/nand/sm_common.c | 5 ++-
> > 13 files changed, 70 insertions(+), 67 deletions(-)
> >
> > --
> > 2.7.4
> >
>
>
>
--
Boris Brezillon, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [Outreachy kernel] Re: [PATCH NAND 0/5] Replace printk statements with pr_*macros
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>
0 siblings, 2 replies; 26+ messages in thread
From: Boris Brezillon @ 2018-02-16 17:48 UTC (permalink / raw)
To: Ezequiel Garcia
Cc: Julia Lawall, Shreeya Patel, Boris Brezillon, Richard Weinberger,
David Woodhouse, Brian Norris, Marek Vasut, Cyrille Pitchen,
outreachy-kernel, linux-mtd
On Fri, 16 Feb 2018 14:26:56 -0300
Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> wrote:
> On 16 February 2018 at 14:23, Julia Lawall <julia.lawall@lip6.fr> wrote:
> >
> >
> > On Fri, 16 Feb 2018, Ezequiel Garcia wrote:
> >
> >> Hi Shreeya,
> >>
> >> Thanks for the contribution.
> >>
> >> On 16 February 2018 at 13:50, Shreeya Patel
> >> <shreeya.patel23498@gmail.com> wrote:
> >> > This patchset removes all the log levels i.e. KERN_WARN,
> >> > KERN_NOTICE, KERN_ERR, KERN_INFO, KERN_DEBUG used in the printk
> >> > statements and replaces the printk statements with appropriate
> >> > pr_*macros.
> >> > According to the kernel coding style, pr_*macro is the preferred
> >> > way to print the message.
> >> >
> >>
> >> So, two things to begin with.
> >>
> >> First of all, despite this contribution being part of outreachy,
> >> I believe you can include mailing lists in your case.
> >>
> >> In other words, don't use the "nol" option in get_maintainer
> >> script and Cc the MTD mailing list: linux-mtd at lists.infradead.org.
> >
> > Shouldn't the dev_* functions also be usable?
> >
>
> Provided that:
> 1. it's applicable, i.e. if in the context of a device.
Yep, be careful with that. The MTD/NAND subsystem initializes
mtd->dev.name quite late, so it's not safe to use &mtd->dev with
dev_<loglevel>(). Note that you can use the NAND controller pdev->dev if
available.
> 2. Richard is not too opposed to the idea.
>
> Then, yes.
--
Boris Brezillon, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [Outreachy kernel] [PATCH NAND 1/5] mtd/nand: Replace printk with pr_warn
2018-02-16 17:08 ` [Outreachy kernel] " Julia Lawall
@ 2018-02-16 17:52 ` Shreeya Patel
0 siblings, 0 replies; 26+ messages in thread
From: Shreeya Patel @ 2018-02-16 17:52 UTC (permalink / raw)
To: Julia Lawall
Cc: boris.brezillon, richard, dwmw2, computersforpeace, marek.vasut,
cyrille.pitchen, outreachy-kernel, ezequiel
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.
> >
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH NAND 0/5] Replace printk statements with pr_*macros
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
2 siblings, 1 reply; 26+ messages in thread
From: Richard Weinberger @ 2018-02-16 17:58 UTC (permalink / raw)
To: Ezequiel Garcia
Cc: Shreeya Patel, Boris Brezillon, David Woodhouse, Brian Norris,
Marek Vasut, Cyrille Pitchen, outreachy-kernel
Ezequiel,
Am Freitag, 16. Februar 2018, 18:24:46 CET schrieb Ezequiel Garcia:
> Hey Richard,
>
> On 16 February 2018 at 14:19, Richard Weinberger <richard@nod.at> wrote:
> > Am Freitag, 16. Februar 2018, 17:50:09 CET schrieb Shreeya Patel:
> >> This patchset removes all the log levels i.e. KERN_WARN,
> >> KERN_NOTICE, KERN_ERR, KERN_INFO, KERN_DEBUG used in the printk
> >> statements and replaces the printk statements with appropriate
> >> pr_*macros.
> >> According to the kernel coding style, pr_*macro is the preferred
> >> way to print the message.
> >
> > Beside of that, how does it improve the code?
> > Don't get me wrong, pr_* is the way to go for new code, but I don't think
> > it is worth "fixing" in existing code and make working with git blame
> > more painful.
>
> Shreeya's intention is to work on [1], migrating drivers to exec_op.
> As a first task, before being accepted, she is required to submit
> cleanup patches (or small tasks).
Working on exec_op would be great! This is highly appreciated.
> Since I couldn't come up with small tasks for MTD, I suggested
> starting with printk cleaning. So this was my idea.
>
> Printk to pr_{} or dev_{} is not only aesthetical, it's also a consolidation
> change. Centralizing prints allows for other improvements.
>
> See for instance Wolfram's work [2, 3].
>
> In any case, does it hurt git-blame so much? It only affects
> the lines where the print is performed.
...and it pollutes patch context. So, from now on back/forward porting patches
will cause much more rejects and need manual interaction.
In UBI we did a similar change a few years ago.
So, I'm not rejecting this patches but:
Told-you-so: Richard Weinberger <richard@nod.at>
Thanks,
//richard
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [Outreachy kernel] Re: [PATCH NAND 0/5] Replace printk statements with pr_*macros
2018-02-16 17:48 ` Boris Brezillon
@ 2018-02-16 17:59 ` Shreeya Patel
[not found] ` <1518976870.2784.4.camel@gmail.com>
1 sibling, 0 replies; 26+ messages in thread
From: Shreeya Patel @ 2018-02-16 17:59 UTC (permalink / raw)
To: Boris Brezillon, Ezequiel Garcia
Cc: Julia Lawall, Richard Weinberger, David Woodhouse, Brian Norris,
Marek Vasut, Cyrille Pitchen, outreachy-kernel, linux-mtd
On Fri, 2018-02-16 at 18:48 +0100, Boris Brezillon wrote:
> On Fri, 16 Feb 2018 14:26:56 -0300
> Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> wrote:
>
> >
> > On 16 February 2018 at 14:23, Julia Lawall <julia.lawall@lip6.fr>
> > wrote:
> > >
> > >
> > >
> > > On Fri, 16 Feb 2018, Ezequiel Garcia wrote:
> > >
> > > >
> > > > Hi Shreeya,
> > > >
> > > > Thanks for the contribution.
> > > >
> > > > On 16 February 2018 at 13:50, Shreeya Patel
> > > > <shreeya.patel23498@gmail.com> wrote:
> > > > >
> > > > > This patchset removes all the log levels i.e. KERN_WARN,
> > > > > KERN_NOTICE, KERN_ERR, KERN_INFO, KERN_DEBUG used in the
> > > > > printk
> > > > > statements and replaces the printk statements with
> > > > > appropriate
> > > > > pr_*macros.
> > > > > According to the kernel coding style, pr_*macro is the
> > > > > preferred
> > > > > way to print the message.
> > > > >
> > > > So, two things to begin with.
> > > >
> > > > First of all, despite this contribution being part of
> > > > outreachy,
> > > > I believe you can include mailing lists in your case.
> > > >
> > > > In other words, don't use the "nol" option in get_maintainer
> > > > script and Cc the MTD mailing list: linux-mtd at
> > > > lists.infradead.org.
> > > Shouldn't the dev_* functions also be usable?
> > >
> > Provided that:
> > 1. it's applicable, i.e. if in the context of a device.
> Yep, be careful with that. The MTD/NAND subsystem initializes
> mtd->dev.name quite late, so it's not safe to use &mtd->dev with
> dev_<loglevel>(). Note that you can use the NAND controller pdev->dev
> if
> available.
This information is quite useful, thanks.
I'll see that what will be the best thing to use here.
>
> >
> > 2. Richard is not too opposed to the idea.
> >
> > Then, yes.
>
>
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH NAND 0/5] Replace printk statements with pr_*macros
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 18:00 ` Boris Brezillon
1 sibling, 0 replies; 26+ messages in thread
From: Boris Brezillon @ 2018-02-16 18:00 UTC (permalink / raw)
To: Richard Weinberger
Cc: Shreeya Patel, boris.brezillon, dwmw2, computersforpeace,
marek.vasut, cyrille.pitchen, outreachy-kernel, ezequiel
Hi Richard,
On Fri, 16 Feb 2018 18:19:40 +0100
Richard Weinberger <richard@nod.at> wrote:
> Am Freitag, 16. Februar 2018, 17:50:09 CET schrieb Shreeya Patel:
> > This patchset removes all the log levels i.e. KERN_WARN,
> > KERN_NOTICE, KERN_ERR, KERN_INFO, KERN_DEBUG used in the printk
> > statements and replaces the printk statements with appropriate
> > pr_*macros.
> > According to the kernel coding style, pr_*macro is the preferred
> > way to print the message.
>
> Beside of that, how does it improve the code?
> Don't get me wrong, pr_* is the way to go for new code, but I don't think it
> is worth "fixing" in existing code and make working with git blame more
> painful.
That's true about git blame, though I doubt we'll find a bug in the
printk message, and IIRC, there's an option to find the original
offender even when cosmetic changes have happened in between.
Now, I'd like to explain a bit why I sometimes accept cosmetic/coding
style patches and why I sometimes don't. When this is a first
contribution, I consider this as a way for new comers to learn the
patch submission/review process. But as soon as I start receiving a lot
of cosmetic changes from the same contributor and I see the person does
not move to more useful contributions I stop accepting her/his
patches. I also tend to take patches from people who write coccinelle
scripts, because they try to make things consistent across the whole
source tree and most importantly, they know what they're doing :-).
Maybe I'm wrong in my reasoning, but I thought it was worth explaining
the decision process ;-).
Regards,
Boris
--
Boris Brezillon, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH NAND 0/5] Replace printk statements with pr_*macros
2018-02-16 17:58 ` Richard Weinberger
@ 2018-02-16 18:15 ` Boris Brezillon
0 siblings, 0 replies; 26+ messages in thread
From: Boris Brezillon @ 2018-02-16 18:15 UTC (permalink / raw)
To: Richard Weinberger
Cc: Ezequiel Garcia, Shreeya Patel, Boris Brezillon, David Woodhouse,
Brian Norris, Marek Vasut, Cyrille Pitchen, outreachy-kernel
On Fri, 16 Feb 2018 18:58:35 +0100
Richard Weinberger <richard@nod.at> wrote:
> Ezequiel,
>
> Am Freitag, 16. Februar 2018, 18:24:46 CET schrieb Ezequiel Garcia:
> > Hey Richard,
> >
> > On 16 February 2018 at 14:19, Richard Weinberger <richard@nod.at> wrote:
> > > Am Freitag, 16. Februar 2018, 17:50:09 CET schrieb Shreeya Patel:
> > >> This patchset removes all the log levels i.e. KERN_WARN,
> > >> KERN_NOTICE, KERN_ERR, KERN_INFO, KERN_DEBUG used in the printk
> > >> statements and replaces the printk statements with appropriate
> > >> pr_*macros.
> > >> According to the kernel coding style, pr_*macro is the preferred
> > >> way to print the message.
> > >
> > > Beside of that, how does it improve the code?
> > > Don't get me wrong, pr_* is the way to go for new code, but I don't think
> > > it is worth "fixing" in existing code and make working with git blame
> > > more painful.
> >
> > Shreeya's intention is to work on [1], migrating drivers to exec_op.
> > As a first task, before being accepted, she is required to submit
> > cleanup patches (or small tasks).
>
> Working on exec_op would be great! This is highly appreciated.
Indeed.
>
> > Since I couldn't come up with small tasks for MTD, I suggested
> > starting with printk cleaning. So this was my idea.
> >
> > Printk to pr_{} or dev_{} is not only aesthetical, it's also a consolidation
> > change. Centralizing prints allows for other improvements.
> >
> > See for instance Wolfram's work [2, 3].
> >
> > In any case, does it hurt git-blame so much? It only affects
> > the lines where the print is performed.
>
> ...and it pollutes patch context. So, from now on back/forward porting patches
> will cause much more rejects and need manual interaction.
> In UBI we did a similar change a few years ago.
Oh, I didn't thought about this side-effect. Still, we're talking about
really old drivers that are most of the time not maintained or poorly
maintained.
>
> So, I'm not rejecting this patches but:
>
> Told-you-so: Richard Weinberger <richard@nod.at>
>
If I can get interesting contributions (like conversion of one or
several drivers to ->exec_op()) I'm okay to pay the price and manually
backport the potential fixes that do not apply cleanly because of
these cosmetic changes ;-).
--
Boris Brezillon, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [Outreachy kernel] Re: [PATCH NAND 0/5] Replace printk statements with pr_*macros
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:48 ` Greg KH
2018-02-16 18:54 ` Julia Lawall
2 siblings, 1 reply; 26+ messages in thread
From: Greg KH @ 2018-02-16 18:48 UTC (permalink / raw)
To: Ezequiel Garcia
Cc: Richard Weinberger, Shreeya Patel, Boris Brezillon,
David Woodhouse, Brian Norris, Marek Vasut, Cyrille Pitchen,
outreachy-kernel
On Fri, Feb 16, 2018 at 02:24:46PM -0300, Ezequiel Garcia wrote:
> Hey Richard,
>
> On 16 February 2018 at 14:19, Richard Weinberger <richard@nod.at> wrote:
> > Am Freitag, 16. Februar 2018, 17:50:09 CET schrieb Shreeya Patel:
> >> This patchset removes all the log levels i.e. KERN_WARN,
> >> KERN_NOTICE, KERN_ERR, KERN_INFO, KERN_DEBUG used in the printk
> >> statements and replaces the printk statements with appropriate
> >> pr_*macros.
> >> According to the kernel coding style, pr_*macro is the preferred
> >> way to print the message.
> >
> > Beside of that, how does it improve the code?
> > Don't get me wrong, pr_* is the way to go for new code, but I don't think it
> > is worth "fixing" in existing code and make working with git blame more
> > painful.
> >
>
> Shreeya's intention is to work on [1], migrating drivers to exec_op.
> As a first task, before being accepted, she is required to submit
> cleanup patches (or small tasks).
"cleanup patches" should always start in the drivers/staging/ tree, to
avoid bothering other subsytem maintainers. Please start there before
moving on to the "tasks" as mentioned on the site that are picked by the
mentors.
Don't skip the cleanup patches for no good reason please.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [Outreachy kernel] Re: [PATCH NAND 0/5] Replace printk statements with pr_*macros
2018-02-16 18:48 ` [Outreachy kernel] " Greg KH
@ 2018-02-16 18:54 ` Julia Lawall
0 siblings, 0 replies; 26+ messages in thread
From: Julia Lawall @ 2018-02-16 18:54 UTC (permalink / raw)
To: Greg KH
Cc: Ezequiel Garcia, Richard Weinberger, Shreeya Patel,
Boris Brezillon, David Woodhouse, Brian Norris, Marek Vasut,
Cyrille Pitchen, outreachy-kernel
On Fri, 16 Feb 2018, Greg KH wrote:
> On Fri, Feb 16, 2018 at 02:24:46PM -0300, Ezequiel Garcia wrote:
> > Hey Richard,
> >
> > On 16 February 2018 at 14:19, Richard Weinberger <richard@nod.at> wrote:
> > > Am Freitag, 16. Februar 2018, 17:50:09 CET schrieb Shreeya Patel:
> > >> This patchset removes all the log levels i.e. KERN_WARN,
> > >> KERN_NOTICE, KERN_ERR, KERN_INFO, KERN_DEBUG used in the printk
> > >> statements and replaces the printk statements with appropriate
> > >> pr_*macros.
> > >> According to the kernel coding style, pr_*macro is the preferred
> > >> way to print the message.
> > >
> > > Beside of that, how does it improve the code?
> > > Don't get me wrong, pr_* is the way to go for new code, but I don't think it
> > > is worth "fixing" in existing code and make working with git blame more
> > > painful.
> > >
> >
> > Shreeya's intention is to work on [1], migrating drivers to exec_op.
> > As a first task, before being accepted, she is required to submit
> > cleanup patches (or small tasks).
>
> "cleanup patches" should always start in the drivers/staging/ tree, to
> avoid bothering other subsytem maintainers. Please start there before
> moving on to the "tasks" as mentioned on the site that are picked by the
> mentors.
>
> Don't skip the cleanup patches for no good reason please.
Actually, I told Shreeya that she could skip the initial phase because she
has been doing some other work on kernel code off and on over the last few
months. On the other hand, a generic change such as printk -> pr* or dev*
could indeed have just been experimented with on staging drivers.
julia
>
> thanks,
>
> greg k-h
>
> --
> 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/20180216184832.GA9616%40kroah.com.
> For more options, visit https://groups.google.com/d/optout.
>
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [Outreachy kernel] Re: [PATCH NAND 0/5] Replace printk statements with pr_*macros
[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
0 siblings, 2 replies; 26+ messages in thread
From: Boris Brezillon @ 2018-02-18 20:09 UTC (permalink / raw)
To: Shreeya Patel
Cc: Julia Lawall, Shreeya Patel, Boris Brezillon, Richard Weinberger,
David Woodhouse, Brian Norris, Marek Vasut, Cyrille Pitchen,
outreachy-kernel, linux-mtd, Ezequiel Garcia
Hi Shreeya,
Please try to keep everyone in the loop when you reply to an email. All
discussions should happen publicly to keep everyone aware of the
progress and let other developers/maintainers take part to the
discussion if they have something to add.
On Sun, 18 Feb 2018 23:56:05 +0530
Shreeya Patel <shreeya.patel23498@gmail.com> wrote:
> On Sun, 2018-02-18 at 19:13 +0100, Boris Brezillon wrote:
> > On Sun, 18 Feb 2018 23:31:10 +0530
> > Shreeya Patel <shreeya.patel23498@gmail.com> wrote:
> >
> > >
> > > On Fri, 2018-02-16 at 18:48 +0100, Boris Brezillon wrote:
> > >
> > > Hello Sir,
> > >
> > > >
> > > > On Fri, 16 Feb 2018 14:26:56 -0300
> > > > Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> wrote:
> > > >
> > > > >
> > > > >
> > > > > On 16 February 2018 at 14:23, Julia Lawall <julia.lawall@lip6.f
> > > > > r>
> > > > > wrote:
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > On Fri, 16 Feb 2018, Ezequiel Garcia wrote:
> > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Hi Shreeya,
> > > > > > >
> > > > > > > Thanks for the contribution.
> > > > > > >
> > > > > > > On 16 February 2018 at 13:50, Shreeya Patel
> > > > > > > <shreeya.patel23498@gmail.com> wrote:
> > > > > > > >
> > > > > > > >
> > > > > > > > This patchset removes all the log levels i.e. KERN_WARN,
> > > > > > > > KERN_NOTICE, KERN_ERR, KERN_INFO, KERN_DEBUG used in the
> > > > > > > > printk
> > > > > > > > statements and replaces the printk statements with
> > > > > > > > appropriate
> > > > > > > > pr_*macros.
> > > > > > > > According to the kernel coding style, pr_*macro is the
> > > > > > > > preferred
> > > > > > > > way to print the message.
> > > > > > > >
> > > > > > > So, two things to begin with.
> > > > > > >
> > > > > > > First of all, despite this contribution being part of
> > > > > > > outreachy,
> > > > > > > I believe you can include mailing lists in your case.
> > > > > > >
> > > > > > > In other words, don't use the "nol" option in
> > > > > > > get_maintainer
> > > > > > > script and Cc the MTD mailing list: linux-mtd at
> > > > > > > lists.infradead.org.
> > > > > > Shouldn't the dev_* functions also be usable?
> > > > > >
> > > > > Provided that:
> > > > > 1. it's applicable, i.e. if in the context of a device.
> > > > Yep, be careful with that. The MTD/NAND subsystem initializes
> > > > mtd->dev.name quite late, so it's not safe to use &mtd->dev with
> > > > dev_<loglevel>(). Note that you can use the NAND controller pdev-
> > > > >dev
> > > > if
> > > > available.
> > > I would like to ask here that what will be the benefit or good
> > > cause if
> > > I use pdev->dev?
> > > How is it different from others?
> > Well, pdev->dev is guaranteed to be properly initialized when you
> > pass
> > it to dev_<loglevel>(). This is not the case with mtd->dev which is
> > initialized in mtd_device_register(), but the NAND controller driver
> > usually does some operations on the NAND device before reaching this
> > point (reading the ID, reading the bad block markers to determine
> > which
> > blocks are bad, ...).
> >
> Thanks for making me understand.
>
> > Anyway, I think it's better if you first do the
> > s/printk(KERN_<LOGLEVEL>(/pr_<loglevel>(/ replacement. Replacing
> > pr_xxx
> > by dev_xxx is something we can do afterwards.
>
> I've created one patch where I have replaced printk
> with dev_* and used pdev->dev.
Okay. pdev->dev is not always directly accessible so doing
s/printk(KERN_<LOGLEVEL>/dev_<loglevel>(&pdev->dev, / is likely to
cause build failures. But I guess you compile-tested the changes you're
about to submit.
Regards,
Boris
--
Boris Brezillon, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [Outreachy kernel] Re: [PATCH NAND 0/5] Replace printk statements with pr_*macros
2018-02-18 20:09 ` Boris Brezillon
@ 2018-02-18 20:20 ` Shreeya Patel
2018-02-18 20:30 ` Shreeya Patel
1 sibling, 0 replies; 26+ messages in thread
From: Shreeya Patel @ 2018-02-18 20:20 UTC (permalink / raw)
To: Boris Brezillon
Cc: Julia Lawall, Boris Brezillon, Richard Weinberger,
David Woodhouse, Brian Norris, Marek Vasut, Cyrille Pitchen,
outreachy-kernel, linux-mtd, Ezequiel Garcia
On Sun, 2018-02-18 at 21:09 +0100, Boris Brezillon wrote:
> Hi Shreeya,
>
> Please try to keep everyone in the loop when you reply to an email.
> All
> discussions should happen publicly to keep everyone aware of the
> progress and let other developers/maintainers take part to the
> discussion if they have something to add.
I'll keep this in mind.
>
>
> On Sun, 18 Feb 2018 23:56:05 +0530
> Shreeya Patel <shreeya.patel23498@gmail.com> wrote:
>
> >
> > On Sun, 2018-02-18 at 19:13 +0100, Boris Brezillon wrote:
> > >
> > > On Sun, 18 Feb 2018 23:31:10 +0530
> > > Shreeya Patel <shreeya.patel23498@gmail.com> wrote:
> > >
> > > >
> > > >
> > > > On Fri, 2018-02-16 at 18:48 +0100, Boris Brezillon wrote:
> > > >
> > > > Hello Sir,
> > > >
> > > > >
> > > > >
> > > > > On Fri, 16 Feb 2018 14:26:56 -0300
> > > > > Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> wrote:
> > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > On 16 February 2018 at 14:23, Julia Lawall <julia.lawall@li
> > > > > > p6.f
> > > > > > r>
> > > > > > wrote:
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > On Fri, 16 Feb 2018, Ezequiel Garcia wrote:
> > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > Hi Shreeya,
> > > > > > > >
> > > > > > > > Thanks for the contribution.
> > > > > > > >
> > > > > > > > On 16 February 2018 at 13:50, Shreeya Patel
> > > > > > > > <shreeya.patel23498@gmail.com> wrote:
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > This patchset removes all the log levels i.e.
> > > > > > > > > KERN_WARN,
> > > > > > > > > KERN_NOTICE, KERN_ERR, KERN_INFO, KERN_DEBUG used in
> > > > > > > > > the
> > > > > > > > > printk
> > > > > > > > > statements and replaces the printk statements with
> > > > > > > > > appropriate
> > > > > > > > > pr_*macros.
> > > > > > > > > According to the kernel coding style, pr_*macro is
> > > > > > > > > the
> > > > > > > > > preferred
> > > > > > > > > way to print the message.
> > > > > > > > >
> > > > > > > > So, two things to begin with.
> > > > > > > >
> > > > > > > > First of all, despite this contribution being part of
> > > > > > > > outreachy,
> > > > > > > > I believe you can include mailing lists in your case.
> > > > > > > >
> > > > > > > > In other words, don't use the "nol" option in
> > > > > > > > get_maintainer
> > > > > > > > script and Cc the MTD mailing list: linux-mtd at
> > > > > > > > lists.infradead.org.
> > > > > > > Shouldn't the dev_* functions also be usable?
> > > > > > >
> > > > > > Provided that:
> > > > > > 1. it's applicable, i.e. if in the context of a device.
> > > > > Yep, be careful with that. The MTD/NAND subsystem initializes
> > > > > mtd->dev.name quite late, so it's not safe to use &mtd->dev
> > > > > with
> > > > > dev_<loglevel>(). Note that you can use the NAND controller
> > > > > pdev-
> > > > > >
> > > > > > dev
> > > > > if
> > > > > available.
> > > > I would like to ask here that what will be the benefit or good
> > > > cause if
> > > > I use pdev->dev?
> > > > How is it different from others?
> > > Well, pdev->dev is guaranteed to be properly initialized when you
> > > pass
> > > it to dev_<loglevel>(). This is not the case with mtd->dev which
> > > is
> > > initialized in mtd_device_register(), but the NAND controller
> > > driver
> > > usually does some operations on the NAND device before reaching
> > > this
> > > point (reading the ID, reading the bad block markers to determine
> > > which
> > > blocks are bad, ...).
> > >
> > Thanks for making me understand.
> >
> > >
> > > Anyway, I think it's better if you first do the
> > > s/printk(KERN_<LOGLEVEL>(/pr_<loglevel>(/ replacement. Replacing
> > > pr_xxx
> > > by dev_xxx is something we can do afterwards.
> > I've created one patch where I have replaced printk
> > with dev_* and used pdev->dev.
> Okay. pdev->dev is not always directly accessible so doing
> s/printk(KERN_<LOGLEVEL>/dev_<loglevel>(&pdev->dev, / is likely to
> cause build failures. But I guess you compile-tested the changes
> you're
> about to submit.
Yes, it wasn't directly accessible at some places.
Also, I was unable to compile ams-delta.c file.
I am working on it right now as I will have to cross compile for arm.
Thanks
>
> Regards,
>
> Boris
>
>
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [Outreachy kernel] Re: [PATCH NAND 0/5] Replace printk statements with pr_*macros
2018-02-18 20:09 ` Boris Brezillon
2018-02-18 20:20 ` Shreeya Patel
@ 2018-02-18 20:30 ` Shreeya Patel
1 sibling, 0 replies; 26+ messages in thread
From: Shreeya Patel @ 2018-02-18 20:30 UTC (permalink / raw)
To: Boris Brezillon
Cc: Julia Lawall, Boris Brezillon, Richard Weinberger,
David Woodhouse, Brian Norris, Marek Vasut, Cyrille Pitchen,
outreachy-kernel, linux-mtd, Ezequiel Garcia
On Sun, 2018-02-18 at 21:09 +0100, Boris Brezillon wrote:
> Hi Shreeya,
>
> Please try to keep everyone in the loop when you reply to an email.
> All
> discussions should happen publicly to keep everyone aware of the
> progress and let other developers/maintainers take part to the
> discussion if they have something to add.
I'll keep this in mind.
>
>
> On Sun, 18 Feb 2018 23:56:05 +0530
> Shreeya Patel <shreeya.patel23498@gmail.com> wrote:
>
> >
> > On Sun, 2018-02-18 at 19:13 +0100, Boris Brezillon wrote:
> > >
> > > On Sun, 18 Feb 2018 23:31:10 +0530
> > > Shreeya Patel <shreeya.patel23498@gmail.com> wrote:
> > >
> > > >
> > > >
> > > > On Fri, 2018-02-16 at 18:48 +0100, Boris Brezillon wrote:
> > > >
> > > > Hello Sir,
> > > >
> > > > >
> > > > >
> > > > > On Fri, 16 Feb 2018 14:26:56 -0300
> > > > > Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> wrote:
> > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > On 16 February 2018 at 14:23, Julia Lawall <julia.lawall@li
> > > > > > p6.f
> > > > > > r>
> > > > > > wrote:
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > On Fri, 16 Feb 2018, Ezequiel Garcia wrote:
> > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > Hi Shreeya,
> > > > > > > >
> > > > > > > > Thanks for the contribution.
> > > > > > > >
> > > > > > > > On 16 February 2018 at 13:50, Shreeya Patel
> > > > > > > > <shreeya.patel23498@gmail.com> wrote:
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > This patchset removes all the log levels i.e.
> > > > > > > > > KERN_WARN,
> > > > > > > > > KERN_NOTICE, KERN_ERR, KERN_INFO, KERN_DEBUG used in
> > > > > > > > > the
> > > > > > > > > printk
> > > > > > > > > statements and replaces the printk statements with
> > > > > > > > > appropriate
> > > > > > > > > pr_*macros.
> > > > > > > > > According to the kernel coding style, pr_*macro is
> > > > > > > > > the
> > > > > > > > > preferred
> > > > > > > > > way to print the message.
> > > > > > > > >
> > > > > > > > So, two things to begin with.
> > > > > > > >
> > > > > > > > First of all, despite this contribution being part of
> > > > > > > > outreachy,
> > > > > > > > I believe you can include mailing lists in your case.
> > > > > > > >
> > > > > > > > In other words, don't use the "nol" option in
> > > > > > > > get_maintainer
> > > > > > > > script and Cc the MTD mailing list: linux-mtd at
> > > > > > > > lists.infradead.org.
> > > > > > > Shouldn't the dev_* functions also be usable?
> > > > > > >
> > > > > > Provided that:
> > > > > > 1. it's applicable, i.e. if in the context of a device.
> > > > > Yep, be careful with that. The MTD/NAND subsystem initializes
> > > > > mtd->dev.name quite late, so it's not safe to use &mtd->dev
> > > > > with
> > > > > dev_<loglevel>(). Note that you can use the NAND controller
> > > > > pdev-
> > > > > >
> > > > > > dev
> > > > > if
> > > > > available.
> > > > I would like to ask here that what will be the benefit or good
> > > > cause if
> > > > I use pdev->dev?
> > > > How is it different from others?
> > > Well, pdev->dev is guaranteed to be properly initialized when you
> > > pass
> > > it to dev_<loglevel>(). This is not the case with mtd->dev which
> > > is
> > > initialized in mtd_device_register(), but the NAND controller
> > > driver
> > > usually does some operations on the NAND device before reaching
> > > this
> > > point (reading the ID, reading the bad block markers to determine
> > > which
> > > blocks are bad, ...).
> > >
> > Thanks for making me understand.
> >
> > >
> > > Anyway, I think it's better if you first do the
> > > s/printk(KERN_<LOGLEVEL>(/pr_<loglevel>(/ replacement. Replacing
> > > pr_xxx
> > > by dev_xxx is something we can do afterwards.
> > I've created one patch where I have replaced printk
> > with dev_* and used pdev->dev.
> Okay. pdev->dev is not always directly accessible so doing
> s/printk(KERN_<LOGLEVEL>/dev_<loglevel>(&pdev->dev, / is likely to
> cause build failures. But I guess you compile-tested the changes
> you're
> about to submit.
Yes, it wasn't directly accessible at some places.
Also, I was unable to compile ams-delta.c file.
I am working on it right now as I will have to cross compile for arm.
Thanks
>
> Regards,
>
> Boris
>
>
^ permalink raw reply [flat|nested] 26+ messages in thread
end of thread, other threads:[~2018-02-18 20:31 UTC | newest]
Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
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.