From patchwork Thu Sep 19 10:42:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Orzel X-Patchwork-Id: 13807630 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A8F85CE8D77 for ; Thu, 19 Sep 2024 10:45:42 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.800600.1210559 (Exim 4.92) (envelope-from ) id 1srEfF-0004XU-PQ; Thu, 19 Sep 2024 10:45:33 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 800600.1210559; Thu, 19 Sep 2024 10:45:33 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1srEfF-0004XA-M7; Thu, 19 Sep 2024 10:45:33 +0000 Received: by outflank-mailman (input) for mailman id 800600; Thu, 19 Sep 2024 10:45:32 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1srEfE-0003mj-ER for xen-devel@lists.xenproject.org; Thu, 19 Sep 2024 10:45:32 +0000 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on20601.outbound.protection.outlook.com [2a01:111:f403:2413::601]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 4a461542-7674-11ef-a0b8-8be0dac302b0; Thu, 19 Sep 2024 12:45:31 +0200 (CEST) Received: from SN6PR16CA0066.namprd16.prod.outlook.com (2603:10b6:805:ca::43) by LV2PR12MB5871.namprd12.prod.outlook.com (2603:10b6:408:174::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.17; Thu, 19 Sep 2024 10:45:25 +0000 Received: from SA2PEPF0000150B.namprd04.prod.outlook.com (2603:10b6:805:ca:cafe::f2) by SN6PR16CA0066.outlook.office365.com (2603:10b6:805:ca::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.28 via Frontend Transport; Thu, 19 Sep 2024 10:45:25 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by SA2PEPF0000150B.mail.protection.outlook.com (10.167.242.43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7918.13 via Frontend Transport; Thu, 19 Sep 2024 10:45:24 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 19 Sep 2024 05:45:24 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 19 Sep 2024 05:45:24 -0500 Received: from XIR-MICHALO-L1.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 19 Sep 2024 05:45:22 -0500 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 4a461542-7674-11ef-a0b8-8be0dac302b0 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=RyKAfJat7D7YOTM5FsNmWSPdM5e8Q1zZkdhg/MA1QTfkH5Xa+GNJKQhhhDOx5cpK2juISO1cR4s5hWwoTt8KaIVFAdfdoVpNckiHoDsHhqOtDtPhVg9suJqYWMzPK0URBRWrSsuTqxiuoq6thELBwYGzXUiWOVjysiJ6zT9PJYFFEfkvO1gGwcQbsrfR/n59+Iq9wgMFJR4rxW3GGaZJCWHydfi3C2T7yDterLAnpbPP0ttUyImzFsLZqDFYgaX3Rqly15sgCnCUZDrhS9bB4qDZRJH+EeRaZDsArZdHsQA832Z+n5lmP9uxM4gR//NwgvCb+gOFTMZ+ydK6srgbmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=bu105dDIpB4eZMz42pqaBoX0Nyrbf+DW33CIprSzLCw=; b=WT9bp+3u1P9EbQuSHeZMFMSx5c4s3lPpiKprBfTevdMtXCUcGtYMsDkFAasSC3s3cMmpOMJIsHMXJWA+ViSVkHGg/pSPviSmulZODnT6ioqxPp98ZMz6RpkQuxKv/WZ8io8HqZM1/C7pAMmkRF3gLaYN3xL+vzIpOLe1aB5BaphhD39OoEGzneAVfQdXwYLzZjMSihaGBhQimJyJSAqOFgI9BMjAw6ayiY78TxFid/Inb3MNqC17sdNSz/L5+1UzL49+Pm11QiJ0zcOCGvRnFaCn9DVBqrwKoaqfva5ATPGpM+BnjInlAMMnWmE6V/bkG6UFxp3IVo5cALLo/Q9qmQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bu105dDIpB4eZMz42pqaBoX0Nyrbf+DW33CIprSzLCw=; b=GLuN+ZWCgSPs0v7BgiJlEEPz2nnJKUTNtgfMxQqEdGBkrCd+KYHCZcq7JNBeY5xQDBoDzLFvCZhruKaeq0GwAOgvayZxDCBCgZoHAvPkt03jvZFnmn1VCkDZeUb8lKKT0UFgWn1EURKWTY98laCNTnEur+JVmpx/svsVilhgggE= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C From: Michal Orzel To: CC: Michal Orzel , Stefano Stabellini , Julien Grall , Bertrand Marquis Subject: [PATCH 3/4] dt-overlay: Remove ASSERT_UNREACHABLE from add_nodes() Date: Thu, 19 Sep 2024 12:42:37 +0200 Message-ID: <20240919104238.232704-4-michal.orzel@amd.com> X-Mailer: git-send-email 2.37.6 In-Reply-To: <20240919104238.232704-1-michal.orzel@amd.com> References: <20240919104238.232704-1-michal.orzel@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF0000150B:EE_|LV2PR12MB5871:EE_ X-MS-Office365-Filtering-Correlation-Id: 2e76b153-6704-40b0-9347-08dcd8982b2c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|36860700013|82310400026|1800799024; X-Microsoft-Antispam-Message-Info: lrcdtqYtoIxi7aZ9tV4ompS9lkZqcuMZStTO+i5x0Lccxv8D1pkvL8Yt9DK6YYdXViTO9Fitywn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hBT0+y2vw7bALnDBPJzfClmWqH1BGXaukMOsubno9tgX6E75N4aYhMPQwAUNLrOGG5iKKFN2Dwbb9ngubNlcctvc5Jh8JP+EDtQ147VWh8oYz4wxfE1aP1B7rZ3NQjJRI6s6Bh0fZ3x+5aah51X0iXowG7UZgMN0Uf92LKP8pq/prvsbnUflfXfq4MxaBMHRRRKtPaIpNaX5YEYGHCXi6LlGzlitbrxP19pn3rQzWFz/UUpKWOyw04p/XkOUPTIUodRUd+wi0cxgPCTbScqHAYUPw5FfOwpZ7ut3Tr X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(36860700013)(82310400026)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2024 10:45:24.9956 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2e76b153-6704-40b0-9347-08dcd8982b2c X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SA2PEPF0000150B.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5871 The assumption stated in the comment that the code will never get there is incorrect. It's enough for the target-path to be incorrect (i.e. user error), which will lead to an incorrect overall node path and we will end up in this "unreachable" place causing a failure in debug builds. Fixes: 0c0facdab6f5 ("xen/arm: Implement device tree node addition functionalities") Signed-off-by: Michal Orzel Reviewed-by: Stefano Stabellini Acked-by: Julien Grall --- xen/common/dt-overlay.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/xen/common/dt-overlay.c b/xen/common/dt-overlay.c index 8606b14d1e8e..d18bd12bd38d 100644 --- a/xen/common/dt-overlay.c +++ b/xen/common/dt-overlay.c @@ -596,11 +596,7 @@ static long add_nodes(struct overlay_track *tr, char **nodes_full_path) overlay_node = dt_find_node_by_path_from(tr->dt_host_new, nodes_full_path[j]); if ( overlay_node == NULL ) - { - /* Sanity check. But code will never come here. */ - ASSERT_UNREACHABLE(); return -EFAULT; - } /* * Find previous and next node to overlay_node in dt_host_new. We will