Re: [PATCH] libfdt: Drop including string.h from libfdt_internal.h

Simon Glass <[email protected]>
Newsgroups org.kernel.vger.devicetree-compiler
Message-ID <CAFLszTiSrqHVsLmsokRKZ-bc7Kb6dHjA_SfoiSkETH8PXxkUNw@mail.gmail.com>
On Mon, 11 Aug 2025 at 07:05, Rob Herring (Arm) <[email protected]> wrote:
>
> Commit 0f69cedc08fc ("libfdt_internal: fdt_find_string_len_()") added a
> string.h include to libfdt_internal.h which introduces a libc dependency
> which cannot be overridden. Environments without libc (e.g. Linux
> kernel) use a custom libfdt_env.h. string.h is already indirectly
> included in libfdt_env.h, so it can be dropped from libfdt_internal.h.
>
> Fixes: 0f69cedc08fc ("libfdt_internal: fdt_find_string_len_()")
> Signed-off-by: Rob Herring (Arm) <[email protected]>
> ---
>  libfdt/libfdt_internal.h | 1 -
>  1 file changed, 1 deletion(-)

Reviewed-by: Simon Glass <[email protected]>

>
> diff --git a/libfdt/libfdt_internal.h b/libfdt/libfdt_internal.h
> index 773bba87bc6e..b60b5456f596 100644
> --- a/libfdt/libfdt_internal.h
> +++ b/libfdt/libfdt_internal.h
> @@ -6,7 +6,6 @@
>   * Copyright (C) 2006 David Gibson, IBM Corporation.
>   */
>  #include <fdt.h>
> -#include <string.h>
>
>  #define FDT_ALIGN(x, a)                (((x) + (a) - 1) & ~((a) - 1))
>  #define FDT_TAGALIGN(x)                (FDT_ALIGN((x), FDT_TAGSIZE))
> --
> 2.47.2
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.