Skip to content
Snippets Groups Projects
  • Simon Glass's avatar
    1a62d64c
    cli: Support macro processing with a fixed-size buffer · 1a62d64c
    Simon Glass authored and Tom Rini's avatar Tom Rini committed
    
    At present cli_simple_process_macros() requires that the caller provide
    an output buffer that is exactly CONFIG_SYS_CBSIZE bytes in length. This
    makes sense since it is designed to be used from the command line. But we
    also want to use it for bootargs substitution.
    
    Update the function to allow the caller to specify the buffer size. Also
    return an error if the buffer is exhausted. The caller can ignore that if
    preferred.
    
    Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
    1a62d64c
    History
    cli: Support macro processing with a fixed-size buffer
    Simon Glass authored and Tom Rini's avatar Tom Rini committed
    
    At present cli_simple_process_macros() requires that the caller provide
    an output buffer that is exactly CONFIG_SYS_CBSIZE bytes in length. This
    makes sense since it is designed to be used from the command line. But we
    also want to use it for bootargs substitution.
    
    Update the function to allow the caller to specify the buffer size. Also
    return an error if the buffer is exhausted. The caller can ignore that if
    preferred.
    
    Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>