From nobody Fri Dec 19 17:08:03 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1588248318; cv=none; d=zohomail.com; s=zohoarc; b=Qd4QJitFvBZsSES7i5P0nhiKu9W0OOt+jsZ6GhTEfcGjzk4IFIGrq73sompgwbOk2uPecinx6g3VBWDyWuSyOQPuE2dvpIteQJXE5LIjy6ONn9jN1CzKleZb5kii1pbxwoty6G9Pabui0IGpF01vMjN+WeNeke9h+EJRl1HrfYU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588248318; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=8hi1p3eL3t21N4txt/xDnw2kNSKZMQWnLiLJ53KEUd4=; b=YQQ2+8qskhHcwVXtl8LxMFwYx1Ag72qz9DU0LTduFCWolsHf+6hu9lJn7NluLbt/Jhif9sMZnyTbI5H/6ywx8LsJM/KN8vdUcbj6ZaK0wvYB8G8UPpdVE0RyYj0rYY6LOuq6Qnx9kFk2QYcSR2pbAd57FNh/gi/23pFCxpQXPj4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1588248318902915.3039126543454; Thu, 30 Apr 2020 05:05:18 -0700 (PDT) Received: from localhost ([::1]:58992 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jU7wL-0003HI-DS for importer@patchew.org; Thu, 30 Apr 2020 08:05:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33944) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jU7jo-0003Y5-Dx for qemu-devel@nongnu.org; Thu, 30 Apr 2020 07:52:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jU7jl-0000TB-IY for qemu-devel@nongnu.org; Thu, 30 Apr 2020 07:52:20 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:34392) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jU7jl-0000SV-3k for qemu-devel@nongnu.org; Thu, 30 Apr 2020 07:52:17 -0400 Received: by mail-wr1-x429.google.com with SMTP id j1so6547169wrt.1 for ; Thu, 30 Apr 2020 04:52:16 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id j22sm491518wre.84.2020.04.30.04.52.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2020 04:52:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=8hi1p3eL3t21N4txt/xDnw2kNSKZMQWnLiLJ53KEUd4=; b=tbsVtx2/lE3Z8HBRsS3iPBc/MmKHtGrmQsX4gVkMiBDkAKCUlDfzV0hX+/A1f3Ldc+ iRiIH52p8FvHmcdKhWscrtj+2cAz4llCWHeE7uD2QIIbRTaCnyWQ47y5k1ud0gDmYg1Z QOURsT847VVhN7IY0+LFM33uiVIrUCAWfGbSWsguvcLP/3PQbKizT62ILG3Fy635gI7S KrgrtzUiNh25UgaDJnWdekyHlTV7eJsYX5E7pTT6lySgXyRrBnfiy48XCAJFiOPGu/nF xjJMq0wKVS/tohxxyjYg6utCy2CVjXf8m82prydmh5As5QKYUsHzR6MgQzKcBL40UXhR XXyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8hi1p3eL3t21N4txt/xDnw2kNSKZMQWnLiLJ53KEUd4=; b=ZUKqdN+YSstWM5nnPkye5oI0K9QCulyPGXCMUvr7DxZOnSAOhVjc+HBdpMA4H8G39V 441mYimkupE6npZaWVj2//Q9O3dYDyLNDS4WclmZss4IRfitCT72PAtwwuhNfh6Xcz6X cJrN4J83KfGYw5ZJBFXGvMmBBuJfmPt/lrCVGQluLYQl8hcl83oiavN/PcJU/VyeVRX4 jWgsYPoRciP2RmacP4PpeLyJ4T5QpVzdPLAQHFCfQJM2PGCvCE09VZFpNrsrsuAhWFaM sRV1VlHtttJEj6Yzn6sRRmnSyexat3vlBK1stuhazdr4UuScJwVim62LDYzbycfsSeZ3 ROSA== X-Gm-Message-State: AGi0PubKGJe67LZV9O1fb26h4sqyoj3LNO2/575XLL2GieBkM9zK21cG cZzVbQe4DCqOb5plTcwjv/+KG3eFyWtbIw== X-Google-Smtp-Source: APiQypLIJCwX40C/RA44RlhQBMuXOdL6DxLM2bj7VrhO40yue7APIjS+4EsGk2kRPwlXz5srpO10Qg== X-Received: by 2002:adf:f704:: with SMTP id r4mr3579382wrp.5.1588247535393; Thu, 30 Apr 2020 04:52:15 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 28/31] device_tree: Allow name wildcards in qemu_fdt_node_path() Date: Thu, 30 Apr 2020 12:51:39 +0100 Message-Id: <20200430115142.13430-29-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200430115142.13430-1-peter.maydell@linaro.org> References: <20200430115142.13430-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x429.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2a00:1450:4864:20::429 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" From: "Edgar E. Iglesias" Allow name wildcards in qemu_fdt_node_path(). This is useful to find all nodes with a given compatibility string. Reviewed-by: Alistair Francis Signed-off-by: Edgar E. Iglesias Message-id: 20200423121114.4274-2-edgar.iglesias@gmail.com Signed-off-by: Peter Maydell --- include/sysemu/device_tree.h | 3 +++ device_tree.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/sysemu/device_tree.h b/include/sysemu/device_tree.h index c16fd69bc0b..7c53ef76345 100644 --- a/include/sysemu/device_tree.h +++ b/include/sysemu/device_tree.h @@ -39,6 +39,9 @@ void *load_device_tree_from_sysfs(void); * NULL. If there is no error but no matching node was found, the * returned array contains a single element equal to NULL. If an error * was encountered when parsing the blob, the function returns NULL + * + * @name may be NULL to wildcard names and only match compatibility + * strings. */ char **qemu_fdt_node_path(void *fdt, const char *name, char *compat, Error **errp); diff --git a/device_tree.c b/device_tree.c index bba6cc21641..f5b4699aedb 100644 --- a/device_tree.c +++ b/device_tree.c @@ -308,7 +308,7 @@ char **qemu_fdt_node_path(void *fdt, const char *name, = char *compat, offset =3D len; break; } - if (!strcmp(iter_name, name)) { + if (!name || !strcmp(iter_name, name)) { char *path; =20 path =3D g_malloc(path_len); --=20 2.20.1