[PATCH 4/7] xyz-modem: Close stream after processing/sending terminate sequence

Heinrich Schuchardt heinrich.schuchardt at canonical.com
Wed Aug 4 10:59:23 CEST 2021


On 03.08.21 16:28, Pali Rohár wrote:
> Obviously it is not possible to send terminate sequence over stream after
> closing stream.

xyzModem_stream_close() does not close anything; it flushes the stream.
xyzModem_stream_terminate() sets xyz.at_eof = true and gives feedback to 
the user.

So I think this change is incorrect.

What we lack is documentation of the xyzModem functions in 
include/xyzModem.h.

Cf.
https://www.kernel.org/doc/html/latest/doc-guide/kernel-doc.html#function-documentation

Best regards

Heinrich

> 
> Signed-off-by: Pali Rohár <pali at kernel.org>
> ---
>   cmd/load.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/cmd/load.c b/cmd/load.c
> index b7894d7db02a..fb8c191fb64f 100644
> --- a/cmd/load.c
> +++ b/cmd/load.c
> @@ -1006,8 +1006,8 @@ static ulong load_serial_ymodem(ulong offset, int mode)
>   		printf("%s\n", xyzModem_error(err));
>   	}
>   
> -	xyzModem_stream_close(&err);
>   	xyzModem_stream_terminate(false, &getcxmodem);
> +	xyzModem_stream_close(&err);
>   
>   
>   	flush_cache(offset, ALIGN(size, ARCH_DMA_MINALIGN));
> 


More information about the U-Boot mailing list