From: "Leif Lindholm" <leif@nuviainc.com>
To: Abner Chang <abner.chang@hpe.com>
Cc: devel@edk2.groups.io, Ard Biesheuvel <ard.biesheuvel@arm.com>,
Daniel Schaefer <daniel.schaefer@hpe.com>
Subject: Re: [PATCH] EmbeddedPkg/libfdt: Add strncmp macro to use AsciiStrnCmp
Date: Tue, 18 Aug 2020 19:04:22 +0100 [thread overview]
Message-ID: <20200818180422.GC17439@vanye> (raw)
In-Reply-To: <20200806023421.25161-1-abner.chang@hpe.com>
On Thu, Aug 06, 2020 at 10:34:21 +0800, Abner Chang wrote:
> For the implementation which utilizes libfdt provided in EmbeddedPkg
> however it uses strncmp function in the libfdt helper library,
> libfdt_env.h should provide the macro implied with edk2 strncmp
> implementation.
>
> The example is RISC-V OpenSBI library. edk2 RISC-V port uses OpenSBI
> library and incorporate with edk2 libfdt. edk2 libfdt_env.h provides
> the necessary macros to build OpenSBI which uses fdt functions in edk2
> environment. However, OpenSBI also has libfdt helper library that uses
> strncmp function which is not defined in edk2 libfdt_env.h. This commit
> addresses the build issue caused by missing strncmp macro in
> libfdt_env.h.
>
> Check below three commits for the corresponding changes on OpenSBI,
> https://github.com/riscv/opensbi/commit/8e47649eff96c303e02fbd58cdc6c4ed341066ec
> https://github.com/riscv/opensbi/commit/2845d2d2cf4fb74a89452ba223995aa4a118c07e
> https://github.com/riscv/opensbi/commit/2cfd2fc9048806353298a1b967abf985901e36e8
>
> Signed-off-by: Abner Chang <abner.chang@hpe.com>
>
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
> Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Whoops, I failed to file this away in my queue - apologies.
Many thanks for fixing this in opensbi.
Reviewed-by: Leif Lindholm <leif@nuviainc.com>
> ---
> EmbeddedPkg/Include/libfdt_env.h | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/EmbeddedPkg/Include/libfdt_env.h b/EmbeddedPkg/Include/libfdt_env.h
> index 11a9764733..7feff52bc0 100644
> --- a/EmbeddedPkg/Include/libfdt_env.h
> +++ b/EmbeddedPkg/Include/libfdt_env.h
> @@ -76,4 +76,8 @@ static inline size_t strnlen (const char* str, size_t strsz ) {
> return AsciiStrnLenS (str, strsz);
> }
>
> +static inline size_t strncmp (const char* str1, const char* str2, size_t strsz ) {
> + return AsciiStrnCmp (str1, str2, strsz);
> +}
> +
> #endif /* _LIBFDT_ENV_H */
> --
> 2.25.0
>
next prev parent reply other threads:[~2020-08-18 18:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-06 2:34 [PATCH] EmbeddedPkg/libfdt: Add strncmp macro to use AsciiStrnCmp Abner Chang
2020-08-18 18:04 ` Leif Lindholm [this message]
2020-08-24 17:28 ` [edk2-devel] " Laszlo Ersek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200818180422.GC17439@vanye \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox