[U-Boot] [PATCH 1/6] fdt_support: make fdt_fixup_mtdparts() prototype more specific

Simon Glass sjg at chromium.org
Thu Jul 19 15:21:44 UTC 2018


Hi Masahiro,

On 19 July 2018 at 01:28, Masahiro Yamada <yamada.masahiro at socionext.com> wrote:
> 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 at socionext.com>
> ---
>
>  common/fdt_support.c  | 13 +++++++------
>  include/fdt_support.h | 11 ++++++++---
>  2 files changed, 15 insertions(+), 9 deletions(-)
>

Reviewed-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list