From: Wolfgang Denk Date: Wed, 28 Nov 2012 17:04:14 +0100 Subject: [U-Boot] [PATCH] mmc: Add an mmcsilent option In-Reply-To: <1354174469-5625-1-git-send-email-panto@antoniou-consulting.com> References: <1354174469-5625-1-git-send-email-panto@antoniou-consulting.com> Message-ID: <20121128160414.DC6CE20104E@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Pantelis Antoniou, In message <1354174469-5625-1-git-send-email-panto@antoniou-consulting.com> you wrote: > When using MMC commands for dfu there is considerable noise. > Suppress mmc messages when mmcsilent is set. > > Signed-off-by: Pantelis Antoniou > --- > common/cmd_mmc.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c > index 4c19df7..73383f3 100644 > --- a/common/cmd_mmc.c > +++ b/common/cmd_mmc.c > @@ -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; 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 -- 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.