Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05B14C4338F for ; Fri, 6 Aug 2021 16:21:04 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 16EDE60EB9 for ; Fri, 6 Aug 2021 16:21:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 16EDE60EB9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1018182E4C; Fri, 6 Aug 2021 18:21:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="GNSro+EU"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 22FD682E4C; Fri, 6 Aug 2021 18:20:59 +0200 (CEST) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3A6E48262E for ; Fri, 6 Aug 2021 18:20:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: by mail.kernel.org (Postfix) with ESMTPSA id 8A538611BF; Fri, 6 Aug 2021 16:20:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1628266854; bh=pMKDb5Z4XPpJ0u56DQKGtSi3Gv3rS8Vg7IDg0ujmJ/Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=GNSro+EUXEW88GzYdmG1VrZE7vS3Nst0qMai9FJQT1vxiox3aDH21LoTvhCfQ5yZz 96DVoaRIMaHu9zBIbDDhHnf6FWmWq891Y4t8Uhwz0WZ21BE+KDARttTy8ly/LXPBlm 8l+DkVD5EAwl7pKcVVDgkb/SOdmf50Zsxw1+7fCe5t9fuJwQnNvDIrV7M0FjOHXVZX KeRWDAWK6fIre0eEmK2fgY1GfwsTtdd8tuwk2TV8jTbhvpSLz2DXMROQm2PbQK1uq9 2pV3aHyYhwUSnKgk6WbgS5CjArEweq4GcJmGhYFP2HAjbXwWtDjF5OHlTOreoYlfiW 2H04mFjx4Bi0A== Received: by pali.im (Postfix) id 524E6768; Fri, 6 Aug 2021 18:20:52 +0200 (CEST) Date: Fri, 6 Aug 2021 18:20:52 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: Heinrich Schuchardt Cc: Simon Glass , Michal Simek , Marek =?utf-8?B?QmVow7pu?= , u-boot@lists.denx.de Subject: Re: [PATCH 3/7] xyz-modem: Put xyzModem_stream_close debug diagnostic message into ZM_DEBUG() Message-ID: <20210806162052.65txqefsvvfngijv@pali> References: <20210803142844.19455-1-pali@kernel.org> <20210803142844.19455-4-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180716 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On Wednesday 04 August 2021 11:30:25 Heinrich Schuchardt wrote: > On 03.08.21 16:28, Pali Rohár wrote: > > This is how all other debug / diagnostic messages are handled. > > This commit message is misleading. What you do is hide an output. > > > > > Signed-off-by: Pali Rohár > > --- > > common/xyzModem.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/common/xyzModem.c b/common/xyzModem.c > > index 631c44e11adf..c200c9ff9177 100644 > > --- a/common/xyzModem.c > > +++ b/common/xyzModem.c > > @@ -608,10 +608,10 @@ xyzModem_stream_read (char *buf, int size, int *err) > > void > > xyzModem_stream_close (int *err) > > { > > - diag_printf > > + ZM_DEBUG (zm_dprintf > > ("xyzModem - %s mode, %d(SOH)/%d(STX)/%d(CAN) packets, %d retries\n", > > xyz.crc_mode ? "CRC" : "Cksum", xyz.total_SOH, xyz.total_STX, > > - xyz.total_CAN, xyz.total_retries); > > + xyz.total_CAN, xyz.total_retries)); > > ZM_DEBUG (zm_flush ()); > > zm_dprintf prints into the debug buffer which seems not to be overflow > protected. > > diag_printf prints to the console. > > Why do you want to hide this message? I'm not hiding it. I'm just moving debug output to be send via same way as others. > Isn't the CRC what the user will want to check? It does not print any CRC, so nothing to check. It print information which type of CRC was used during transfer. > And if many retries occur doesn't this alert the user that the transfer > may be corrupted? Hm... corruption itself is handled by protocol. So if it happens then transfer is aborted and via other patches is indicated to user. Anyway, if this function xyzModem_stream_close() prior calling xyzModem_stream_terminate() then nothing is visible to user because it is send to the x/y-modem sending application, which drop it as garbage according to the protocol. Such information can be send after restoring terminal from file transfer state back to the user input/output state. > > Best regards > > Heinrich > > > } > > > >