Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp1053194rdb; Fri, 2 Feb 2024 12:00:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IET+CuUtCxBM68fyoLaqimgsf14cIrOWywBh3YeEXTtPuTUe6VYHUw7cCMwDEzbNM4JwkiE X-Received: by 2002:a05:6e02:104a:b0:363:ba82:c01e with SMTP id p10-20020a056e02104a00b00363ba82c01emr463891ilj.8.1706904051944; Fri, 02 Feb 2024 12:00:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706904051; cv=pass; d=google.com; s=arc-20160816; b=Sa54IJyh/IvXCRhq/mi7hI4y08KHv5aeYr9Tx6XLWz+jUZNQu/UehVWeAy3xURUwYl 165HCJu6r1DjB9UwARrEsEosMuxhDVYMkQBHBKCr11OZkfXbDFFHxLeasZozGXrkSEf/ 8v14vMcYBR3DzlRNAjjT9OnffVQvvpwfC8RJF5GsveYyKnW2OKP8Ny4IoFgTAlbQobgt xAdr9/5gZNT95arWNpvHJyUJFZW3hOpk0ZMj9nAdrlWv3HRKss1GtbkDLaemlqZmuSSU GiWxHV0W+s4IoGYtNgHV4yI9IdsLJYsrpWZiQrCauchwwwg+DTfF0wyzGM1a85vwD/+p V1cw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Vxm7GroJb1jr7a7SKxct7zVVLJ9MIYxfQSDNcHJxJs8=; fh=RA4BPcMfIASrNrSZTf9P8pR9fcm1D5h3eMzmSm1vIVs=; b=NAoMb6Mn0xeHU5hPLhciYnEherayjr2u1ULYJ3t2xJEE1zUq+T3Di6pwZ7iM55mSB9 sW95VtmAoR6TplBQUPsnBE7UtfFD+fRC+8xeJsCF78Gp3TlUH+zsEQlIOKELkDa5WLtn /B/88ASR2pZCJWg46coOmshqpmNK6myIMExz+BYN1zafvgH10/VlP1UjwWB24bmZV60T JzAWoJBR6vwcZANRIVlPUSr2PunZ1PqtxFONgh5hswqvk8fcMtRpn/gNPsPgGiNwh2hn iVsi3MvqE3eKu/jfy49qbUTCoL+jvmVWfA08y2889ag8Ed4Hcm/W67rGc0MZ9cMy04gw c0LQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rqr1TVIk; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-50515-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50515-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCWuEDBC+60rvy1TNjSJYIkoMWOPcMa5n/7NMmTy2qhZ8X3aZn7MosAM8Kf+2gvidpM9ziSb9aXybq5n5F+ODAaNgjb2DYll8iMc63OAlg== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id k4-20020a63d104000000b005cf97c743c6si2064292pgg.749.2024.02.02.12.00.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 12:00:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-50515-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rqr1TVIk; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-50515-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50515-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 9405A28D095 for ; Fri, 2 Feb 2024 20:00:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E063485931; Fri, 2 Feb 2024 19:59:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="rqr1TVIk" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0465485929; Fri, 2 Feb 2024 19:59:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706903956; cv=none; b=eRb7AJQOiPgL/JnlJcDNDsfNEdR4t/Uw9hMDQV79yX22a2BrxoYp5TpIfxLKVZ8oXlaEkNeGE3KTQQCc8Gbq4xmkSPn/0+/YHA6kME+aaTIU3QFnFCIC7qIymIR6goR/qhrBd/vIRuE+6TjHr74s5IEqWOzHTnUwXayqKP34Mfs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706903956; c=relaxed/simple; bh=QNmBS0brQeJSjUserQhzHk2Vt2IzcbhX82b9CN/v9CM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=g7/jreHac22fAhfkEtVSnWkp1hNn1GMUX7S7YYIPWGJzlFOD91MZgAZ3tboTw8kFxVhVldPTJWwivsTvOyTxH5mAD6WhAvrHxGXyV3XJZOhD1MlGlMDDXoNttc7t2msE7pIPtOe+AzvNblT3qWHMaSHQ4bH9r/l+XMb7PVZZdIo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rqr1TVIk; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5EB81C43141; Fri, 2 Feb 2024 19:59:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706903955; bh=QNmBS0brQeJSjUserQhzHk2Vt2IzcbhX82b9CN/v9CM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rqr1TVIkELbYe8QcCaThgPp5LfWi4EUBvIMppFR3VVYloXIkVaSj1nLdUvXnARg9u W4AepGXy6uRZGg2L9PFyE7fy9ii7eFqT6dlWogyio4PE7QIoBYNy7tMnDPJ8UfC7hG XFbmaFzRY/46VmL/ZfeffKX1wCpke+epxasSxyVyG3ZE8GhMyOB43ybYp65Se6knYS adbMjrvYBVdu4eZEpmkn75FnBt+KEP63nyZeBhz6u4l5XoVWgDQlttPxbupz2oLhsm s7YXw3hJ2rRF52Uz2vwU3YR5WfwgKeeO2H4/PfvHfC78HwzoSD7g5UczgKO8C9fD6x i93LlSW/kUN1g== From: Stephen Boyd To: Rob Herring Cc: Frank Rowand , linux-kernel@vger.kernel.org, patches@lists.linux.dev, linux-um@lists.infradead.org, linux-arm-kernel@lists.infradead.org, kunit-dev@googlegroups.com, linux-kselftest@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v3 6/7] of: unittest: treat missing of_root as error instead of fixing up Date: Fri, 2 Feb 2024 11:59:07 -0800 Message-ID: <20240202195909.3458162-7-sboyd@kernel.org> X-Mailer: git-send-email 2.43.0.594.gd9cf4e227d-goog In-Reply-To: <20240202195909.3458162-1-sboyd@kernel.org> References: <20240202195909.3458162-1-sboyd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Frank Rowand unflatten_device_tree() now ensures that the 'of_root' node is populated with the root of a default empty devicetree. Remove the unittest code that created 'of_root' if it was missing. Verify that 'of_root' is valid before attempting to attach the testcase-data subtree. Remove the unittest code that unflattens the unittest overlay base if architecture is UML because that is always done now. Signed-off-by: Frank Rowand Link: https://lore.kernel.org/r/20230317053415.2254616-3-frowand.list@gmail.com Cc: Rob Herring Signed-off-by: Stephen Boyd --- drivers/of/unittest.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c index a8b27dd16ecf..742d919e8ab4 100644 --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c @@ -1732,20 +1732,16 @@ static int __init unittest_data_add(void) return -EINVAL; } + /* attach the sub-tree to live tree */ if (!of_root) { - of_root = unittest_data_node; - for_each_of_allnodes(np) - __of_attach_node_sysfs(np); - of_aliases = of_find_node_by_path("/aliases"); - of_chosen = of_find_node_by_path("/chosen"); - of_overlay_mutex_unlock(); - return 0; + pr_warn("%s: no live tree to attach sub-tree\n", __func__); + kfree(unittest_data); + return -ENODEV; } EXPECT_BEGIN(KERN_INFO, "Duplicate name in testcase-data, renamed to \"duplicate-name#1\""); - /* attach the sub-tree to live tree */ np = unittest_data_node->child; while (np) { struct device_node *next = np->sibling; -- https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git/ https://git.kernel.org/pub/scm/linux/kernel/git/sboyd/spmi.git