Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2153219lqb; Mon, 27 May 2024 09:25:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUPpzygE+P9S/k1z3UqWM+mqsD7ir66GGl6m8S6Swb+nChp1oBbJeCiG5rYGDP/UqdZyXx7BujIRhSy7PMXCd2QhkRixIQ+f47zF+kD6w== X-Google-Smtp-Source: AGHT+IGxLR/Zafq2MLqhQO8tlphb9XI3vHumdlxjsO4qFOrJMl6+VwxcMFeelhsWVjBL+oS3Tzz3 X-Received: by 2002:a50:d693:0:b0:578:63ec:3e90 with SMTP id 4fb4d7f45d1cf-57863ec3f7dmr6421858a12.14.1716827151063; Mon, 27 May 2024 09:25:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716827151; cv=pass; d=google.com; s=arc-20160816; b=QUPI1Q9UNoyG9+UTG0ps3dC0NX8S0Pn2QlAbbnD+8XtR0e7RY5esJ1jmf+tASQLngf wD17yTsuOV6jEDnkR41mCdhk+zJE3/ljWG5/W8qE7n7qALv38KkRyRnMX5RfT9TCSlUz iIrWMU4BoPxe3k7u5jOs+C3UHi9Swi5T+R1C/b4loE1tGSuPjj8i3WQc1Tmb/7Mbk1vL NVxnqxQg7TBxZI+t1X4hxNWI6bLa5rmj3i/DWHJpKXZhiwSqAcWtADiDuT74vBNhthBq fYgA0MK8hETC/fmjq8cUAjTPteFJIeZNb5KV4uWrr03f+4eS4Xnx2oZ7n9zELUZBhQ2d LDIQ== 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=IilDcbzGzG8MJynaB4el9RJ6tLmSv9BYDf8kPEDjUDQ=; fh=3YQ9Wn9iIS51y8NrdlOvPTQ4lFTakVN5LX1zxHYgQ/4=; b=pPatUK4/Knce7CiKK6aQdluP4Lu6KKWsaHCK+uSOLT6QbZS2sEaJdgqTYgh0xJ6Z0M DsxucmjRpWGfDy2oVjlbkQjc5o7uIwjxjlqQEzxC8zUuaS676FI2c5pW0d6eah8N78BE mHUiLKlxOC92gThoIBTR38qwS1uZSHPagVLeKvSvScHKKNn1sSzydwgQPNn4W+VkZ/QU P61MxALnDIMxyT2exUFaHy0N5VeQdzm/4Ts8pvLlx/942tZjzkOcbFC+g4jAVrb9R1IV CZeuSwq/7wK7uOag3qESxcrBeEj/OcpXcALPLHMtAWwRxQYNS/6R5gn49sSxFz171Qjk pIlA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=nOLzTlWK; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-191227-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191227-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-579c83bf2d9si1922922a12.474.2024.05.27.09.25.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 09:25:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-191227-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=nOLzTlWK; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-191227-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191227-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id C79711F21B4E for ; Mon, 27 May 2024 16:25:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C8AEB16E86A; Mon, 27 May 2024 16:15:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="nOLzTlWK" Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (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 4CC67163A97; Mon, 27 May 2024 16:15:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716826531; cv=none; b=a8s6+p3twzlAVsuNN9uNFSW+4tSQikYj7QJBARG2HNZeMX8A0DVNez5RtkYBCXf+/KcszVSe7I/MHciO2TyVpiDzk5J4vH9TSPX5H6Z7MFJdfJ0GIDTaD8ew2Fteekpdrcg83ULzuoN8gQfpY3/lb4Iu0dquir4Lu4IFmemEaxs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716826531; c=relaxed/simple; bh=VofzQAz9jwO+Od3EmvQ5kjLYk/NvWLcXsH0JjB5B9VQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oyW60Fnv1ic2TPdgyiD5GdjxcqDEVTAqbh7pdxk7N2f+n2Fq8v6aseSNsYWv95yo8nhQg2+8x5GJKSUFhi7H0UrJNtIAu6jMtdmNEWT3qtlqTVLs4fH1CFxS71CMIlHDZEoM2QsSzdKErVksf4MghxAvyFeusqt/DwX3W7oIIVc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=nOLzTlWK; arc=none smtp.client-ip=217.70.183.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPA id 4A101FF80D; Mon, 27 May 2024 16:15:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1716826526; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IilDcbzGzG8MJynaB4el9RJ6tLmSv9BYDf8kPEDjUDQ=; b=nOLzTlWKLJ/MbZOfyb4/CjZgC9/G4TPjacYc6yUqFYSaCPd5I6/F++I/cjMCQvyR6+WyBK 9d6kCAUBs5F+K9whSGwO3p4lu35onnc4n/NnW43mQjsR34Z7km1lD5X7PXUXRRXTEy1pUy Bh+qWl8+ZbzxiBKlxdsmfq9jQkCovYfw9F8lbG40LFQ0Z2JGSVz7vN9pcQF2pAWTLiP8wf zvJBt3XGGStzm4On1AmLakQBiG4SEYFsTd7mHtRVXaMVXIzB6eluC78WRXxSTc42jJ/GKm W1D+893BV++4CIea94xy/ZtUfIwXr5LVFmY/OtShMWKYC0SY5T7p1/i0MJcGuA== From: Herve Codina To: Simon Horman , Sai Krishna Gajula , Herve Codina , Thomas Gleixner , Rob Herring , Krzysztof Kozlowski , Conor Dooley , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Lee Jones , Arnd Bergmann , Horatiu Vultur , UNGLinuxDriver@microchip.com, Andrew Lunn , Heiner Kallweit , Russell King , Saravana Kannan , Bjorn Helgaas , Philipp Zabel , Lars Povlsen , Steen Hegelund , Daniel Machon , Alexandre Belloni Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, netdev@vger.kernel.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Allan Nielsen , Steen Hegelund , Luca Ceresoli , Thomas Petazzoni Subject: [PATCH v2 16/19] of: unittest: Add a test case for of_changeset_add_prop_bool() Date: Mon, 27 May 2024 18:14:43 +0200 Message-ID: <20240527161450.326615-17-herve.codina@bootlin.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240527161450.326615-1-herve.codina@bootlin.com> References: <20240527161450.326615-1-herve.codina@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-GND-Sasl: herve.codina@bootlin.com Improve of_unittest_changeset_prop() to have a test case for the newly introduced of_changeset_add_prop_bool(). Signed-off-by: Herve Codina --- drivers/of/unittest.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c index f8edc96db680..c830f346df45 100644 --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c @@ -1009,6 +1009,13 @@ static void __init __maybe_unused changeset_check_u32_array(struct device_node * } } +static void __init __maybe_unused changeset_check_bool(struct device_node *np, + const char *prop_name) +{ + unittest(of_property_read_bool(np, prop_name), + "%s value mismatch (read 'false', exp 'true')\n", prop_name); +} + static void __init of_unittest_changeset_prop(void) { #ifdef CONFIG_OF_DYNAMIC @@ -1044,6 +1051,9 @@ static void __init of_unittest_changeset_prop(void) u32_array, ARRAY_SIZE(u32_array)); unittest(ret == 0, "failed to add prop-u32-array\n"); + ret = of_changeset_add_prop_bool(&chgset, np, "prop-bool"); + unittest(ret == 0, "failed to add prop-bool\n"); + of_node_put(np); ret = of_changeset_apply(&chgset); @@ -1058,6 +1068,7 @@ static void __init of_unittest_changeset_prop(void) changeset_check_string_array(np, "prop-string-array", str_array, ARRAY_SIZE(str_array)); changeset_check_u32(np, "prop-u32", 1234); changeset_check_u32_array(np, "prop-u32-array", u32_array, ARRAY_SIZE(u32_array)); + changeset_check_bool(np, "prop-bool"); of_node_put(np); -- 2.45.0