Skip to contentSkip to conversation

mmc: Add an mmcsilent option

PATCH New Pantelis Antoniou 4 participants 5 messages Nov 28, 2012 – Nov 29, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: Add an mmcsilent option

When using MMC commands for dfu there is considerable noise. Suppress mmc messages when mmcsilent is set.

---
 common/cmd_mmc.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
common/cmd_mmc.c +6 -4
index 4c19df7..73383f3 100644
@@ -278,8 +278,9 @@ static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 			return 1;
 		}
 
-		printf("\nMMC %s: dev # %d, block # %d, count %d ... ",
-				argv[1], curr_device, blk, cnt);
+		if (getenv("mmcsilent") == NULL)
+			printf("\nMMC %s: dev # %d, block # %d, count %d ... ",
+					argv[1], curr_device, blk, cnt);
 
 		mmc_init(mmc);
 
@@ -301,8 +302,9 @@ static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 			BUG();
 		}
 
-		printf("%d blocks %s: %s\n",
-				n, argv[1], (n == cnt) ? "OK" : "ERROR");
+		if (getenv("mmcsilent") == NULL)
+			printf("%d blocks %s: %s\n",
+					n, argv[1], (n == cnt) ? "OK" : "ERROR");
 		return (n == cnt) ? 0 : 1;
 	}
 
Signature · 1 line
1.7.12
#1 lore raw

PATCH 1/1 mmc: Add an mmcsilent option

Dear Pantelis Antoniou,

Quoted 25 lines · In message <[email protected]>…

When using MMC commands for dfu there is considerable noise. Suppress mmc messages when mmcsilent is set.

---
 common/cmd_mmc.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
common/cmd_mmc.c +3 -2
index 4c19df7..73383f3 100644
@@ -278,8 +278,9 @@ static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 			return 1;
 		}
 
-		printf("\nMMC %s: dev # %d, block # %d, count %d ... ",
-				argv[1], curr_device, blk, cnt);
+		if (getenv("mmcsilent") == NULL)
+			printf("\nMMC %s: dev # %d, block # %d, count %d ... ",
+					argv[1], curr_device, blk, cnt);
 
 		mmc_init(mmc);
 

common/cmd_mmc.c static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) · line 308

Quoted 9 lines
common/cmd_mmc.c +3 -2
@@ -301,8 +302,9 @@ static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 			BUG();
 		}
 
-		printf("%d blocks %s: %s\n",
-				n, argv[1], (n == cnt) ? "OK" : "ERROR");
+		if (getenv("mmcsilent") == NULL)
+			printf("%d blocks %s: %s\n",
+					n, argv[1], (n == cnt) ? "OK" : "ERROR");
 		return (n == cnt) ? 0 : 1;

Do we need these messages at all? Or should we not just turn these printf() into debug() ?

If not, the "mmcsilent" variable needs to be documented.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Being schizophrenic is better than living alone.
#2 lore raw

PATCH 1/1 mmc: Add an mmcsilent option

In reply to Pantelis Antoniou
Quoted 5 lines · Pantelis Antoniou

When using MMC commands for dfu there is considerable noise. Suppress mmc messages when mmcsilent is set.

I'm not familiar with DFU mode, but is there a reason it's invoking the command line call, rather than accessing the card programmatically? The reason that printf is there is because it's a user-facing interface, rather than a software-facing interface.

Andy

#3 lore raw

PATCH 1/1 mmc: Add an mmcsilent option

Hi Andy,

Quoted 12 lines · Andy Fleming

On Thu, Nov 29, 2012 at 1:34 AM, Pantelis Antoniou <[email protected]> wrote:
When using MMC commands for dfu there is considerable noise.
Suppress mmc messages when mmcsilent is set.

I'm not familiar with DFU mode, but is there a reason it's invoking the command line call, rather than accessing the card programmatically? The reason that printf is there is because it's a user-facing interface, rather than a software-facing interface.

No there is not. It's just what was there and the messages were irritating. I would prefer a software interface TBH.

Quoted 1 line

Andy

Regards

-- Pantelis

#4 lore raw

PATCH 1/1 mmc: Add an mmcsilent option

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 22 lines · Pantelis Antoniou

Hi Andy,

Quoted 8 lines · Andy Fleming

On Thu, Nov 29, 2012 at 1:34 AM, Pantelis Antoniou <[email protected]> wrote: When using MMC commands for dfu there is considerable noise. Suppress mmc messages when mmcsilent is set.

Quoted 9 lines

I'm not familiar with DFU mode, but is there a reason it's invoking the command line call, rather than accessing the card programmatically? The reason that printf is there is because it's a user-facing interface, rather than a software-facing interface.

Quoted 2 lines

No there is not. It's just what was there and the messages were irritating. I would prefer a software interface TBH.

I'm trying to recall. Part of the issue was that, I believe, there wasn't an easy software interface to all of the MMC commands that we needed to use here. It might however have boiled down to as a future clean-up, abstract things so that cmd_mmc and cmd_dfu could make use of the same lower level code.

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

iQIcBAEBAgAGBQJQt4XhAAoJENk4IS6UOR1WnUcQAJDRFObh3mxSRccDDtsJ4Cab RBDnAdV6KmiCEJF3x2aWtlUdQVVUI15lPwqG6oKHup5s4oNEupSgvmvdXE3I8lCs dWlDU3pSRlIHMFIMJbd6Cy4nYX0rEwxXVEtlujZ875y+wx6sG25FdA7NoQ42uxif c+Oyt/2aUOXx0z2oFsrB7dIadF3cWxglwhla4ob2XBS4w2RYEmti94Vmp4drjlmj s+DMbS3h9Ar9tUIty1sFGUFVU4DycgeZ2COS3IezbcD4E+H6vTGchhZpxFgzsOwo KydHMRsbMvo3px42fE4frFto/n/UwIiS/eSdnN7vpILdZUhH6MmzmPKeLTYpxyGb HiZWnttVmbZHGGLZ/i95XIbQe9PeLsA0WEy5sZrBrn/2JgQ5ktJdpoWHePNk/4VU jO+DItIUWlh5cAsfsi2WFi42MNwMvbkZTItKuQrMpWSTwjmZIiWiIlHmFu5DUo5b 2TNReo2Ybr+7ajb4jz3rBbyVLGJdSPE0lJ+ZUkn6qjf/v3Sz0Z2QsF41keN499PB RaVmLvPVH96r/0jZQN0zlEwPX5f8g5ULnUBHsjLGDo8uc0ZzR9aNGq2bOvFSXOVO bZ/qedEHZvqrGxTkDO5LCpGwQPt8UigL7s9FWfkoXgZLP+4y7D+X4tPOYw3VbV+6 RTnJU9MduHBf6AU7XgRI
=55le
-----END PGP SIGNATURE-----