From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by mx.groups.io with SMTP id smtpd.web10.71950.1597773866253449273 for ; Tue, 18 Aug 2020 11:04:26 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=qwcg6ds8; spf=pass (domain: nuviainc.com, ip: 209.85.128.66, mailfrom: leif@nuviainc.com) Received: by mail-wm1-f66.google.com with SMTP id t14so17837259wmi.3 for ; Tue, 18 Aug 2020 11:04:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=YCvo7pSe63nGARflm0FIA0nwOaC7sVlMaOzQn80ohlE=; b=qwcg6ds8NRmdjhPYjwRmSi2umlBx+eYHsKcE17a2SGCx40GCHNYori6m+/nJe5SL6A Eq356l9dYeiy5SEc64H4+1+HBzEBQWSqJr4mZS6oV7dx4RVdr8fLBCAyR3lLtbwHbJnY VLwqiNVrjDEFi9VwEFYY9031cDo7RdvnH80cEmHbAxrFphZ+Suz0XYEA556UEDaP9upc 1YKZb8eprttGfsFsO1QlIF8D7HLXUpQKg3DzDNwk9IBJ3eiucPNkuJyc4Sj1Fp1xNdWd kG/mNH+e56ddVITwIVYoNKcQBCtxiiHT/G6X4PRqE+SRi4DPAm8JVz2bq68xK+BbnQRs Iz+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=YCvo7pSe63nGARflm0FIA0nwOaC7sVlMaOzQn80ohlE=; b=QCisx4kOCv3wcHuuoUUJdVD1TjQz6okmugpVwDNHdBRcs7QYTzx9D3Uh+AJcGcw5BE jLPRHC7bY+beh3PX25DUH/p4Bum/znbqE07Z15snvrO015GL1H2UhvmlSyh0Lix2GHBY dhiZxsvjQs6Ze173GCrsHw4MmjdpHf6D89A8PFe2wdVKeRa/TbgC5nmCKnbQF7ybHqk0 ctbHukfmebKa+XrgNlQGseeaJ4wxEnr2K4tcrtk3AK0ohNxHgZ1CfgC6Wqiv39begMwH dkU7MoKK0ArNJah5lErScawTLDCITcOOXHI8z9rj1/IczEpKPdJHx4N9mtTGDXs8JgQR 5bRg== X-Gm-Message-State: AOAM531EAnFEiqIKTzTkAnX3NtfQufTctjH4Aynf75TYwmf5IKxBxoPr Ba13ZZOW0/zzEjkee1loGJHgaA== X-Google-Smtp-Source: ABdhPJySOB2W/bubphpRCYd/FlS2bAIY9zM7vjYbYK0WTMeLgh7/91JmNVbDqJPJrSy1sQo+TIH0Xg== X-Received: by 2002:a1c:27c2:: with SMTP id n185mr1124999wmn.78.1597773864556; Tue, 18 Aug 2020 11:04:24 -0700 (PDT) Return-Path: Received: from vanye ([2001:470:1f09:12f0:b26e:bfff:fea9:f1b8]) by smtp.gmail.com with ESMTPSA id w132sm927212wma.32.2020.08.18.11.04.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Aug 2020 11:04:24 -0700 (PDT) Date: Tue, 18 Aug 2020 19:04:22 +0100 From: "Leif Lindholm" To: Abner Chang Cc: devel@edk2.groups.io, Ard Biesheuvel , Daniel Schaefer Subject: Re: [PATCH] EmbeddedPkg/libfdt: Add strncmp macro to use AsciiStrnCmp Message-ID: <20200818180422.GC17439@vanye> References: <20200806023421.25161-1-abner.chang@hpe.com> MIME-Version: 1.0 In-Reply-To: <20200806023421.25161-1-abner.chang@hpe.com> User-Agent: Mutt/1.10.1 (2018-07-13) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 > > Cc: Leif Lindholm > Cc: Ard Biesheuvel > Cc: Daniel Schaefer Whoops, I failed to file this away in my queue - apologies. Many thanks for fixing this in opensbi. Reviewed-by: Leif Lindholm > --- > 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 >