fdt_support: make fdt_fixup_mtdparts() prototype more specific
The second argument of fdt_fixup_mtdparts() is an opaque pointer, 'void *node_info', hence callers can pass any pointer. Obviously, fdt_fixup_mtdparts() expects 'struct node_info *' otherwise, it crashes run-time. Change the prototype so that it is compile-time checked. Also, add 'const' qualifier to it so that callers can constify the struct node_info arrays. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -205,11 +205,16 @@ int fdt_increase_size(void *fdt, int add_len);
|
||||
|
||||
int fdt_fixup_nor_flash_size(void *blob);
|
||||
|
||||
struct node_info;
|
||||
#if defined(CONFIG_FDT_FIXUP_PARTITIONS)
|
||||
void fdt_fixup_mtdparts(void *fdt, void *node_info, int node_info_size);
|
||||
void fdt_fixup_mtdparts(void *fdt, const struct node_info *node_info,
|
||||
int node_info_size);
|
||||
#else
|
||||
static inline void fdt_fixup_mtdparts(void *fdt, void *node_info,
|
||||
int node_info_size) {}
|
||||
static inline void fdt_fixup_mtdparts(void *fdt,
|
||||
const struct node_info *node_info,
|
||||
int node_info_size)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
void fdt_del_node_and_alias(void *blob, const char *alias);
|
||||
|
||||
Reference in New Issue
Block a user