fdt_support: board_fdt_chosen_bootargs() should return const char*

It should be structured this way to demonstrate to the caller that
freeing the return value is unnecessary and that the caller cannot
modify it.
The function fdt_setprop() includes a parameter with a const char*
prototype, so it is better to use the const qualifier.

Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
Dmitry Rokosov
2024-12-20 00:42:09 +03:00
committed by Tom Rini
parent 453625a861
commit c39257c131
2 changed files with 3 additions and 3 deletions

View File

@@ -321,7 +321,7 @@ int fdt_kaslrseed(void *fdt, bool overwrite)
* board_fdt_chosen_bootargs - boards may override this function to use * board_fdt_chosen_bootargs - boards may override this function to use
* alternative kernel command line arguments * alternative kernel command line arguments
*/ */
__weak char *board_fdt_chosen_bootargs(void) __weak const char *board_fdt_chosen_bootargs(void)
{ {
return env_get("bootargs"); return env_get("bootargs");
} }
@@ -331,7 +331,7 @@ int fdt_chosen(void *fdt)
struct abuf buf = {}; struct abuf buf = {};
int nodeoffset; int nodeoffset;
int err; int err;
char *str; /* used to set string properties */ const char *str; /* used to set string properties */
err = fdt_check_header(fdt); err = fdt_check_header(fdt);
if (err < 0) { if (err < 0) {

View File

@@ -236,7 +236,7 @@ int board_rng_seed(struct abuf *buf);
* *
* Return: pointer to kernel command line arguments in memory * Return: pointer to kernel command line arguments in memory
*/ */
char *board_fdt_chosen_bootargs(void); const char *board_fdt_chosen_bootargs(void);
/* /*
* The keystone2 SOC requires all 32 bit aliased addresses to be converted * The keystone2 SOC requires all 32 bit aliased addresses to be converted