From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.120]) by mx.groups.io with SMTP id smtpd.web12.7.1598290136568567942 for ; Mon, 24 Aug 2020 10:28:56 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=P44Lwdsf; spf=pass (domain: redhat.com, ip: 205.139.110.120, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598290135; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6OwollJQGOtVHnymxeyLxXPV4W1ib4ReMtAPB46JbVA=; b=P44Lwdsf2K8R5ZjYOyhcC8//J9Gkic2Mlxl6DAROoAb3HeovDo0QOFlN9AB0Gmilx1npkZ dt+DkY6RTcpHWxsBLkGxVpGdE2k+bj3S22SdNAUKG1Jw75gDcUPq2YRSMGGWsuXKI0TMA5 AaY6CnNwtenSCMjmK1j/kOY47IwVp18= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-412-a0CamOgDNFSpgqVDcK4U2Q-1; Mon, 24 Aug 2020 13:28:50 -0400 X-MC-Unique: a0CamOgDNFSpgqVDcK4U2Q-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7383D81F015; Mon, 24 Aug 2020 17:28:49 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-112-186.ams2.redhat.com [10.36.112.186]) by smtp.corp.redhat.com (Postfix) with ESMTP id 080D1600E4; Mon, 24 Aug 2020 17:28:47 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH] EmbeddedPkg/libfdt: Add strncmp macro to use AsciiStrnCmp To: devel@edk2.groups.io, leif@nuviainc.com, Abner Chang Cc: Ard Biesheuvel , Daniel Schaefer References: <20200806023421.25161-1-abner.chang@hpe.com> <20200818180422.GC17439@vanye> From: "Laszlo Ersek" Message-ID: <1af0be4b-a3ef-1f18-ba0a-076fbb445c3f@redhat.com> Date: Mon, 24 Aug 2020 19:28:47 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200818180422.GC17439@vanye> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 08/18/20 20:04, Leif Lindholm wrote: > 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 Merged as commit 019f513a19f8, via . If there is an associated TianoCore BZ (the commit message does not mention one), please flip it to RESOLVED|FIXED, and mark the commit hash on it. Thanks, Laszlo > > >> --- >> 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 >> > > >