[PATCH v2 01/21] sandbox: Use const in os_jump_to_file()

Mattijs Korpershoek mkorpershoek at baylibre.com
Thu Jul 18 10:02:07 CEST 2024


Hi Simon,

Thank you for the patch.

On sam., juil. 13, 2024 at 08:00, Simon Glass <sjg at chromium.org> wrote:

> The argument array is not changed by the callee, so mark it const.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>

Reviewed-by: Mattijs Korpershoek <mkorpershoek at baylibre.com>

> ---
>
> (no changes since v1)
>
>  arch/sandbox/cpu/os.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c
> index d7869b2e368..6a8a5e7b89b 100644
> --- a/arch/sandbox/cpu/os.c
> +++ b/arch/sandbox/cpu/os.c
> @@ -808,7 +808,7 @@ static int make_exec(char *fname, const void *data, int size)
>   * @count: Number of arguments in @add_args
>   * Return: 0 if OK, -ENOMEM if out of memory
>   */
> -static int add_args(char ***argvp, char *add_args[], int count)
> +static int add_args(char ***argvp, const char *add_args[], int count)
>  {
>  	char **argv, **ap;
>  	int argc;
> @@ -859,7 +859,7 @@ static int os_jump_to_file(const char *fname, bool delete_it)
>  	struct sandbox_state *state = state_get_current();
>  	char mem_fname[30];
>  	int fd, err;
> -	char *extra_args[5];
> +	const char *extra_args[5];
>  	char **argv = state->argv;
>  	int argc;
>  #ifdef DEBUG
> -- 
> 2.34.1


More information about the U-Boot mailing list