Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5888446rdb; Thu, 14 Dec 2023 02:32:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IH+E6+/kFGM4wDXFxQEtkuzMTdkkRaBeecSsVinqgpxtJVGQtPcNuvsAoVVnRvgD9qoo3n5 X-Received: by 2002:a05:6e02:1447:b0:35f:6723:f988 with SMTP id p7-20020a056e02144700b0035f6723f988mr5390740ilo.48.1702549943046; Thu, 14 Dec 2023 02:32:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702549943; cv=none; d=google.com; s=arc-20160816; b=dw2qbD3bKK5xsCfYDLP4iiulVN5JWKgYXyw1puH1GLFYiCRD982wmNROyQHh596VHs Frd6gvlwzyc5QqIiTMH1JH0H/XMBZLkHIbDP0aGaFdcNCyCkhEa5s9GG0cBogmYsuEkS 3C+o/8nAAFwxKiPpc3D9hDmD/VxsY79CFkq8NzOScX0tGQ8j4H141fUvVnVtArhaKwvJ 5cSYWXf25hNN9VwsZZITCGYSRSV/rMNpXOMPfsqkguih9SEyHMExqY+W8j6AUTu05y3U uj4S4SQKUE3J+s82yKXvfnK7tQyyQuhAdtTlHb8QDBUcdAyp+RXHoV1ljjdophRnoNis 94oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RoCUu1mXewEDtm43Qq0pBWgiYLguorwyr3zE9+lEq2w=; fh=6z+ElFTra147heHAzZZJ57t98ehK0pbxyWNV5p0IBGo=; b=p/yg+1PnXOLMkCwyACy5KZsg8JwrW4f/vxsN6VqepqAI+1hZk3CiXXRSMmdyLmHDlz 9I/cd8OQjfQ8YNItZdtfOCtCdLtMRvYPD56EDDuoKwdp2tjwCtsl3rjp+lkzfdWdMEDO 8LzV9xg3hOXFySX2jkSzCBeTnvgZZeAsD+UeL183i9DRmn9uuqgHvUQTU+UDl863bS+j GT0pEvRCIxYXccNtoF+UV7s+93Jufx+0fol5oVGL6Ssu8d3tczx7CJaFFlQ4eBV52Ejz rBVZBJhpcUjLFe6DDIn0seuIEuSKyOmrt6Tg8d5+TYScftLbg2Ybtg9zlg/EsFCsXWBM hYaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=TCEU2AUr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id e11-20020a170902744b00b001d0b4bfcbd7si731387plt.247.2023.12.14.02.32.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 02:32:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=TCEU2AUr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id BD5CB8313D37; Thu, 14 Dec 2023 02:32:19 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443652AbjLNKcF (ORCPT + 99 others); Thu, 14 Dec 2023 05:32:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1443630AbjLNKcE (ORCPT ); Thu, 14 Dec 2023 05:32:04 -0500 Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8138A11A for ; Thu, 14 Dec 2023 02:32:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1702549926; bh=RoCUu1mXewEDtm43Qq0pBWgiYLguorwyr3zE9+lEq2w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TCEU2AUr0ZA04uTWvKS/i3ZVnJa0VyDib+4PiyGCQg7iYXZ0YGOJGDur97P5pyzAJ ZDtG+cH7Qm4T+X/9B8J01Tj1odsNEBX7Zv7jVYv2UGg/igHIajr64YmluEtiDAktbJ FYNzi99K+px1npcA6NnqaXreto/JcbyQnFH3ZgWLhJhkphXGPb0d8FRzCMmA5OYoTE mi2ltw6Peioc0GwLpqNoOvumthQnpVxfsByUQS6ELu2c/csI87q8kODmX4phBHrPBG geRxOfCFC/OBotVhANnyzFeit42L1QHw+6Blf+5bqiU+1uuONyJ2OrSuNgPt6FhPFz cMuyAa7oMqijg== Received: from authenticated.ozlabs.org (localhost [127.0.0.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 mail.ozlabs.org (Postfix) with ESMTPSA id 4SrTDk1lzGz4xPQ; Thu, 14 Dec 2023 21:32:06 +1100 (AEDT) From: Michael Ellerman To: Cc: , , Subject: [PATCH v2 2/5] of: Change of_machine_is_compatible() to return bool Date: Thu, 14 Dec 2023 21:31:49 +1100 Message-ID: <20231214103152.12269-2-mpe@ellerman.id.au> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231214103152.12269-1-mpe@ellerman.id.au> References: <20231214103152.12269-1-mpe@ellerman.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 14 Dec 2023 02:32:19 -0800 (PST) of_machine_is_compatible() currently returns a positive integer if it finds a match. However none of the callers ever check the value, they all treat it as a true/false. So change of_machine_is_compatible() to return bool, which will allow the implementation to be changed in a subsequent patch. Suggested-by: Rob Herring Signed-off-by: Michael Ellerman --- drivers/of/base.c | 5 ++--- include/linux/of.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) v2: New. diff --git a/drivers/of/base.c b/drivers/of/base.c index 9020be2eb4d5..c82c8b77badc 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -419,10 +419,9 @@ bool of_machine_compatible_match(const char *const *compats) * of_machine_is_compatible - Test root of device tree for a given compatible value * @compat: compatible string to look for in root node's compatible property. * - * Return: A positive integer if the root node has the given value in its - * compatible property. + * Return: true if the root node has the given value in its compatible property. */ -int of_machine_is_compatible(const char *compat) +bool of_machine_is_compatible(const char *compat) { struct device_node *root; int rc = 0; diff --git a/include/linux/of.h b/include/linux/of.h index e3418babc203..c5c663a7fb77 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -402,7 +402,7 @@ extern void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align)); extern int of_alias_get_id(struct device_node *np, const char *stem); extern int of_alias_get_highest_id(const char *stem); -extern int of_machine_is_compatible(const char *compat); +extern bool of_machine_is_compatible(const char *compat); bool of_machine_compatible_match(const char *const *compats); extern int of_add_property(struct device_node *np, struct property *prop); -- 2.43.0