From patchwork Thu Jul 23 01:54:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Chang, Abner (HPS SW/FW Technologist)" X-Patchwork-Id: 1334351 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=hpe.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=yETz3dF/; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BBxK81dvPz9sRk for ; Thu, 23 Jul 2020 12:35:56 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=l9wOQqHeJGLWmX8ZTIAe/0CDIMjhFssQFVDyOVdWmqg=; b=yETz3dF/TKRE9544dbHYn1M5T qmcEenhb1M3NBtSTgVx/8Zng+FdJxYqDy90bfuyldhm7CR6QJVzuHWd2aaqcygIu6o4BFgz5mZLQV MO40Ir55uJAlSkEYYHszW7MRAiMVwAu7cQ60taqHZLa0D8MnDdNC+lO0oXzIuDs28+D4gNEkc721e iPQW1T+bfAbl3kDkz1t1qeLPc6L4mWWU3R9FbAubmIQPBksga12TMkcEQzuxNeiaMSeq3DJrSIr+X 9CLnKKnJ4vV/rO7iUkhc0ADKCnyxn/PtIrB4Tuj7XTgMleiGSSGxrP1fnM0kAb8BiTyR693kuSObw ju72/rytQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jyR5L-000712-0o; Thu, 23 Jul 2020 02:35:51 +0000 Received: from mx0b-002e3701.pphosted.com ([148.163.143.35]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jyR5I-0006zc-7q for opensbi@lists.infradead.org; Thu, 23 Jul 2020 02:35:49 +0000 Received: from pps.filterd (m0134425.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 06N2TIs9008698; Thu, 23 Jul 2020 02:35:46 GMT Received: from g4t3425.houston.hpe.com (g4t3425.houston.hpe.com [15.241.140.78]) by mx0b-002e3701.pphosted.com with ESMTP id 32emds6da0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Jul 2020 02:35:46 +0000 Received: from g9t2301.houston.hpecorp.net (g9t2301.houston.hpecorp.net [16.220.97.129]) by g4t3425.houston.hpe.com (Postfix) with ESMTP id 1CDE1A8; Thu, 23 Jul 2020 02:35:46 +0000 (UTC) Received: from UB16Abner.asiapacific.hpqcorp.net (unknown [15.119.209.39]) by g9t2301.houston.hpecorp.net (Postfix) with ESMTP id ADF1B48; Thu, 23 Jul 2020 02:35:44 +0000 (UTC) From: Abner Chang To: opensbi@lists.infradead.org Subject: [PATCH 1/3] Use standard C string APIs in FDT helper Date: Thu, 23 Jul 2020 09:54:02 +0800 Message-Id: <20200723015404.17667-2-abner.chang@hpe.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200723015404.17667-1-abner.chang@hpe.com> References: <20200723015404.17667-1-abner.chang@hpe.com> MIME-Version: 1.0 X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-07-22_17:2020-07-22, 2020-07-22 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 phishscore=0 malwarescore=0 impostorscore=0 priorityscore=1501 bulkscore=0 lowpriorityscore=0 clxscore=1015 mlxscore=0 spamscore=0 mlxlogscore=911 suspectscore=1 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007230018 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200722_223548_420304_5EA1CA8F X-CRM114-Status: UNSURE ( 9.86 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [148.163.143.35 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [148.163.143.35 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Atish Patra , Anup Patel , abner.chang@hpe.com, Daniel Schaefer Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Use strncmp instead of using sbi_strcmp directly in fdthelp.c. - This commit add implementation of sbi_strncmp. Signed-off-by: Abner Chang Cc: Atish Patra Cc: Anup Patel Cc: Daniel Schaefer Reviewed-by: Anup Patel Reviewed-by: Atish Patra --- include/sbi/sbi_string.h | 2 +- lib/sbi/sbi_string.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/sbi/sbi_string.h b/include/sbi/sbi_string.h index 338075f..5e7304f 100644 --- a/include/sbi/sbi_string.h +++ b/include/sbi/sbi_string.h @@ -12,7 +12,7 @@ #include -int sbi_strcmp(const char *a, const char *b); +int sbi_strncmp(const char *a, const char *b, size_t count); size_t sbi_strlen(const char *str); diff --git a/lib/sbi/sbi_string.c b/lib/sbi/sbi_string.c index 38b700b..c29120a 100644 --- a/lib/sbi/sbi_string.c +++ b/lib/sbi/sbi_string.c @@ -14,10 +14,10 @@ #include -int sbi_strcmp(const char *a, const char *b) +int sbi_strncmp(const char *a, const char *b, size_t count) { /* search first diff or end of string */ - for (; *a == *b && *a != '\0'; a++, b++) + for (; count > 0 && *a == *b && *a != '\0'; a++, b++, count--) ; return *a - *b; From patchwork Thu Jul 23 01:54:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Chang, Abner (HPS SW/FW Technologist)" X-Patchwork-Id: 1334352 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=hpe.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=RpHSEh27; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BBxK96785z9sRk for ; Thu, 23 Jul 2020 12:35:57 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=comCAf1eiiLYxIgaz5TFcCWhKphkPEBDH8ppNVVi5hg=; b=RpHSEh27YLKrspvHcXl1GqEqP V0lfLEy4i1ZB0CNpdS5g9cIieSkCJFZVJKt4rGfYWhrjMvnJq51W6QzBt1o0QRJhD4pucLYYysAKj qNtorypel2gSQ+yKKba1xvP9DKfO21BtQF4lvD6ZouF1K6leSyDXg2RmhhJNwQwBDAwIKXmj2TAH+ gFe6E2Vvyz3dlZHYIp+gqcnxP/Dga/yIhFue3EzIa5/+gliQfdirbmy4ZWgjfVMB3g3RFNnBT62CA ZqPd2DCGWv/a07KqUSZ3t1C9gWjprVn9Nao0uw+lMC/g+2SSXAPsm1CYLZ4YHD4El/PUJ1S7Z01xs S5/m3UQsA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jyR5L-00071G-EZ; Thu, 23 Jul 2020 02:35:51 +0000 Received: from mx0b-002e3701.pphosted.com ([148.163.143.35]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jyR5I-000705-Kc for opensbi@lists.infradead.org; Thu, 23 Jul 2020 02:35:49 +0000 Received: from pps.filterd (m0150244.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 06N2SQ9H029487; Thu, 23 Jul 2020 02:35:48 GMT Received: from g4t3427.houston.hpe.com (g4t3427.houston.hpe.com [15.241.140.73]) by mx0b-002e3701.pphosted.com with ESMTP id 32ekuhxphg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Jul 2020 02:35:48 +0000 Received: from g9t2301.houston.hpecorp.net (g9t2301.houston.hpecorp.net [16.220.97.129]) by g4t3427.houston.hpe.com (Postfix) with ESMTP id A72556C; Thu, 23 Jul 2020 02:35:47 +0000 (UTC) Received: from UB16Abner.asiapacific.hpqcorp.net (unknown [15.119.209.39]) by g9t2301.houston.hpecorp.net (Postfix) with ESMTP id 61AA748; Thu, 23 Jul 2020 02:35:46 +0000 (UTC) From: Abner Chang To: opensbi@lists.infradead.org Subject: [PATCH 2/3] Use standard C string APIs in FDT helper Date: Thu, 23 Jul 2020 09:54:03 +0800 Message-Id: <20200723015404.17667-3-abner.chang@hpe.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200723015404.17667-1-abner.chang@hpe.com> References: <20200723015404.17667-1-abner.chang@hpe.com> MIME-Version: 1.0 X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-07-22_17:2020-07-22, 2020-07-22 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 suspectscore=1 mlxlogscore=972 priorityscore=1501 malwarescore=0 adultscore=0 clxscore=1015 phishscore=0 impostorscore=0 lowpriorityscore=0 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007230018 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200722_223548_734415_D708B2D7 X-CRM114-Status: GOOD ( 10.75 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [148.163.143.35 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [148.163.143.35 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Atish Patra , Anup Patel , abner.chang@hpe.com, Daniel Schaefer Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Use strncmp instead of using sbi_strcmp directly in fdthelp.c. - This commit add a macro to replace strncmp with sbi_strncmp. Signed-off-by: Abner Chang Cc: Atish Patra Cc: Anup Patel Cc: Daniel Schaefer Reviewed-by: Anup Patel --- lib/utils/libfdt/libfdt_env.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils/libfdt/libfdt_env.h b/lib/utils/libfdt/libfdt_env.h index 7fcfe01..a9be6a8 100644 --- a/lib/utils/libfdt/libfdt_env.h +++ b/lib/utils/libfdt/libfdt_env.h @@ -31,9 +31,9 @@ #define strchr sbi_strchr #define strrchr sbi_strrchr #define strcpy sbi_strcpy -#define strcmp sbi_strcmp #define strlen sbi_strlen #define strnlen sbi_strnlen +#define strncmp sbi_strncmp typedef uint16_t FDT_BITWISE fdt16_t; typedef uint32_t FDT_BITWISE fdt32_t; From patchwork Thu Jul 23 01:54:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Chang, Abner (HPS SW/FW Technologist)" X-Patchwork-Id: 1334354 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=hpe.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=14a2Uv6X; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BBxKF26Qtz9sRW for ; Thu, 23 Jul 2020 12:36:01 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=U7HQL1r8ScbCIdpEouGHW8f1/xeTmYEdAIxRfuCTAq4=; b=14a2Uv6XHDhu2gEvRMy5rDpYb vH18dO33cBczZITyXNcSjC/vY/MgW6RiwZhsAFzU1lvsx1P+UX2g/9y/ldHfsp/g3SKPli+SNajCG 8BqMp/0T8nhbPucX42L1lkF53okMBiiZORN9LFcdf1RiwOm08aspE8SuAokulqWfb81Js+mdRZZ/Z YpWCoPtusw1YTkHiz4GR/ovvTw/Da8gC9RotY9O7xX21QA3rIJgnDP1ucIabVuduo9sr4Nxfj8Fwi tlecKrLVj3bLSoXdCDT6djy28WuyJZTVpoUgjUicJQNKbPT9jFMprFq9mH7DQC6EcBnXUc3IfHLIc rFuttgLvQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jyR5Q-00072R-1N; Thu, 23 Jul 2020 02:35:56 +0000 Received: from mx0a-002e3701.pphosted.com ([148.163.147.86]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jyR5N-00070q-Rt for opensbi@lists.infradead.org; Thu, 23 Jul 2020 02:35:54 +0000 Received: from pps.filterd (m0150242.ppops.net [127.0.0.1]) by mx0a-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 06N2SSQp020404; Thu, 23 Jul 2020 02:35:50 GMT Received: from g9t5009.houston.hpe.com (g9t5009.houston.hpe.com [15.241.48.73]) by mx0a-002e3701.pphosted.com with ESMTP id 32dv36ryg9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Jul 2020 02:35:50 +0000 Received: from g9t2301.houston.hpecorp.net (g9t2301.houston.hpecorp.net [16.220.97.129]) by g9t5009.houston.hpe.com (Postfix) with ESMTP id 442FB63; Thu, 23 Jul 2020 02:35:49 +0000 (UTC) Received: from UB16Abner.asiapacific.hpqcorp.net (unknown [15.119.209.39]) by g9t2301.houston.hpecorp.net (Postfix) with ESMTP id 0128F48; Thu, 23 Jul 2020 02:35:47 +0000 (UTC) From: Abner Chang To: opensbi@lists.infradead.org Subject: [PATCH 3/3] Use standard C string APIs in FDT helper Date: Thu, 23 Jul 2020 09:54:04 +0800 Message-Id: <20200723015404.17667-4-abner.chang@hpe.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200723015404.17667-1-abner.chang@hpe.com> References: <20200723015404.17667-1-abner.chang@hpe.com> MIME-Version: 1.0 X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-07-22_17:2020-07-22, 2020-07-22 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 malwarescore=0 spamscore=0 clxscore=1015 priorityscore=1501 adultscore=0 lowpriorityscore=0 suspectscore=1 mlxscore=0 impostorscore=0 mlxlogscore=993 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007230018 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200722_223554_031189_65DCA8A1 X-CRM114-Status: GOOD ( 10.42 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [148.163.147.86 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [148.163.147.86 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Atish Patra , Anup Patel , abner.chang@hpe.com, Daniel Schaefer Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Use strncmp instead of using sbi_strcmp directly in fdthelp.c. Signed-off-by: Abner Chang Cc: Atish Patra Cc: Anup Patel Cc: Daniel Schaefer Reviewed-by: Anup Patel --- lib/utils/fdt/fdt_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils/fdt/fdt_helper.c b/lib/utils/fdt/fdt_helper.c index 78077f7..aec73a0 100644 --- a/lib/utils/fdt/fdt_helper.c +++ b/lib/utils/fdt/fdt_helper.c @@ -123,7 +123,7 @@ int fdt_parse_hart_id(void *fdt, int cpu_offset, u32 *hartid) prop = fdt_getprop(fdt, cpu_offset, "device_type", &len); if (!prop || !len) return SBI_EINVAL; - if (sbi_strcmp(prop, "cpu")) + if (strncmp (prop, "cpu", strlen ("cpu"))) return SBI_EINVAL; val = fdt_getprop(fdt, cpu_offset, "reg", &len);