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>
* board_fdt_chosen_bootargs - boards may override this function to use
* alternative kernel command line arguments
*/
-__weak char *board_fdt_chosen_bootargs(void)
+__weak const char *board_fdt_chosen_bootargs(void)
{
return env_get("bootargs");
}
struct abuf buf = {};
int nodeoffset;
int err;
- char *str; /* used to set string properties */
+ const char *str; /* used to set string properties */
err = fdt_check_header(fdt);
if (err < 0) {
*
* 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