Patchwork [U-Boot,v2,3/6] ubi: ubifs: Turn off verbose prints

login
register
mail settings
Submitter Joe Hershberger
Date March 26, 2013, 9:53 p.m.
Message ID <1364334811-3118-4-git-send-email-joe.hershberger@ni.com>
Download mbox | patch
Permalink /patch/231543/
State Superseded
Delegated to: Tom Rini
Headers show

Comments

Joe Hershberger - March 26, 2013, 9:53 p.m.
The prints are out of control.  SILENCE!

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
---
Changes in v2:
- Cleaned up the msg print silencing

 common/cmd_ubi.c      |  3 +++
 drivers/mtd/mtdpart.c | 14 ++++++++------
 drivers/mtd/ubi/ubi.h |  4 ++++
 fs/ubifs/ubifs.h      |  4 ++++
 4 files changed, 19 insertions(+), 6 deletions(-)
Stefan Roese - April 2, 2013, 10:46 a.m.
Hi Joe,

On 26.03.2013 22:53, Joe Hershberger wrote:
> The prints are out of control.  SILENCE!
> 
> Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
> ---
> Changes in v2:
> - Cleaned up the msg print silencing

Thanks. But could you please make these printf's configurable? Either
silence them with an config option (something like
CONFIG_SYS_UBI_SILENCE_OUTPUT). Or create a "verbose" parameter for the
"ubi/ubifs" commands instead?

Otherwise all current users of these UBI/UBIFS functions/commands have
no chance to see the output as they are used to.

Thanks,
Stefan
Tom Rini - April 2, 2013, 6:25 p.m.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 04/02/2013 06:46 AM, Stefan Roese wrote:
> Hi Joe,
> 
> On 26.03.2013 22:53, Joe Hershberger wrote:
>> The prints are out of control.  SILENCE!
>> 
>> Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> --- 
>> Changes in v2: - Cleaned up the msg print silencing
> 
> Thanks. But could you please make these printf's configurable? 
> Either silence them with an config option (something like 
> CONFIG_SYS_UBI_SILENCE_OUTPUT). Or create a "verbose" parameter
> for the "ubi/ubifs" commands instead?
> 
> Otherwise all current users of these UBI/UBIFS functions/commands 
> have no chance to see the output as they are used to.

Agreed.

- -- 
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJRWyKmAAoJENk4IS6UOR1Wc7IP/2G8l2DLxvk0ZAdXyO/51Vy1
2atD1dDPpfARuXCoPw0qgmqtwGRE8qqiFwlUphVXmHsBHUYVQ0TI5irHALh/CeiH
TUDyOk9PSpVIB6XcM2APp5QROyjL13Uyg/QnXyp3Pp28QwGpoomvE2xQQU9jNzca
qc2sAC6t2UaydD4Aouq3uFAAM+QwU1o3Fvca5TZ58nZXpiWDAUBV7cbvxQ5nhaRv
7XoirJ8Vko13V96K0Ty/4fy+2ZPszj73OqgQaDduP5I/7DDADWBWjx4rBkPhY17c
tNh+c2+v873M0yzfmK++cY3FXs6+vkbOa/0zFyR5JJl3lau9GpAetVoZCeIr4fTO
zc3y7Y1r3y0c7DAFJOzWp811QcItDuzT7DEpv/KltDe6N2NM5mzzbba9q+rD3Xk3
1QGyxVP+c5S5tCYqKSIz5FdnKTBZr5MqTDRgB2hbsH5Vob1/rR58inpba+Sl+V7P
p+fIW0L7VSjoiVKdEWDR/XE1SiQmOX6bt8ZuZdE8xPqcOHDq2LeHSlQ9Y5vHTjdF
7znEcZRMcWW/26yUBdnMcHfDL3oddL9CZmFNEGRtqcfHKf1guCmnlLuLcqGRJsBb
5OhnFGhngtsRnjR71fUXlMP/ZJKhm21H/iK1rKE7uUGGrEU5KuREa6+sPgJNFFGu
5D0TncRlgQZtrh2o10JW
=vn7W
-----END PGP SIGNATURE-----

Patch

diff --git a/common/cmd_ubi.c b/common/cmd_ubi.c
index 7ca3bfa..70a8019 100644
--- a/common/cmd_ubi.c
+++ b/common/cmd_ubi.c
@@ -23,6 +23,9 @@ 
 #include <asm/errno.h>
 #include <jffs2/load_kernel.h>
 
+#undef ubi_msg
+#define ubi_msg(fmt, ...) printk(KERN_NOTICE "UBI: " fmt "\n", ##__VA_ARGS__)
+
 #define DEV_TYPE_NONE		0
 #define DEV_TYPE_NAND		1
 #define DEV_TYPE_ONENAND	2
diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c
index 96dcda2..2c60293 100644
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
@@ -347,16 +347,18 @@  static struct mtd_part *add_one_partition(struct mtd_info *master,
 		if (mtd_mod_by_eb(cur_offset, master) != 0) {
 			/* Round up to next erasesize */
 			slave->offset = (mtd_div_by_eb(cur_offset, master) + 1) * master->erasesize;
-			printk(KERN_NOTICE "Moving partition %d: "
-			       "0x%012llx -> 0x%012llx\n", partno,
-			       (unsigned long long)cur_offset, (unsigned long long)slave->offset);
+			debug("Moving partition %d: 0x%012llx -> 0x%012llx\n",
+				partno, (unsigned long long)cur_offset,
+				(unsigned long long)slave->offset);
 		}
 	}
 	if (slave->mtd.size == MTDPART_SIZ_FULL)
 		slave->mtd.size = master->size - slave->offset;
 
-	printk(KERN_NOTICE "0x%012llx-0x%012llx : \"%s\"\n", (unsigned long long)slave->offset,
-		(unsigned long long)(slave->offset + slave->mtd.size), slave->mtd.name);
+	debug("0x%012llx-0x%012llx : \"%s\"\n",
+		(unsigned long long)slave->offset,
+		(unsigned long long)(slave->offset + slave->mtd.size),
+		slave->mtd.name);
 
 	/* let's do some sanity checks */
 	if (slave->offset >= master->size) {
@@ -463,7 +465,7 @@  int add_mtd_partitions(struct mtd_info *master,
 	if (mtd_partitions.next == NULL)
 		INIT_LIST_HEAD(&mtd_partitions);
 
-	printk(KERN_NOTICE "Creating %d MTD partitions on \"%s\":\n", nbparts, master->name);
+	debug("Creating %d MTD partitions on \"%s\":\n", nbparts, master->name);
 
 	for (i = 0; i < nbparts; i++) {
 		slave = add_one_partition(master, parts + i, i, cur_offset);
diff --git a/drivers/mtd/ubi/ubi.h b/drivers/mtd/ubi/ubi.h
index 14c3a5f..e2c416f 100644
--- a/drivers/mtd/ubi/ubi.h
+++ b/drivers/mtd/ubi/ubi.h
@@ -59,7 +59,11 @@ 
 #define UBI_NAME_STR "ubi"
 
 /* Normal UBI messages */
+#if DEBUG
 #define ubi_msg(fmt, ...) printk(KERN_NOTICE "UBI: " fmt "\n", ##__VA_ARGS__)
+#else
+#define ubi_msg(fmt, ...)
+#endif
 /* UBI warning messages */
 #define ubi_warn(fmt, ...) printk(KERN_WARNING "UBI warning: %s: " fmt "\n", \
 				  __func__, ##__VA_ARGS__)
diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h
index 0af471a..11dd170 100644
--- a/fs/ubifs/ubifs.h
+++ b/fs/ubifs/ubifs.h
@@ -463,8 +463,12 @@  static inline ino_t parent_ino(struct dentry *dentry)
 #define UBIFS_VERSION 1
 
 /* Normal UBIFS messages */
+#if DEBUG
 #define ubifs_msg(fmt, ...) \
 		printk(KERN_NOTICE "UBIFS: " fmt "\n", ##__VA_ARGS__)
+#else
+#define ubifs_msg(fmt, ...)
+#endif
 /* UBIFS error messages */
 #define ubifs_err(fmt, ...)                                                  \
 	printk(KERN_ERR "UBIFS error (pid %d): %s: " fmt "\n", 0, \