Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3577215pxb; Mon, 24 Jan 2022 12:38:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJxuwaHa+NSWPjHKJojGqawKTwDXRB8yHWrLL668aElvvXqvNgRG56qay7PBA16djptx6VSU X-Received: by 2002:a63:171a:: with SMTP id x26mr13003391pgl.447.1643056726448; Mon, 24 Jan 2022 12:38:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643056726; cv=none; d=google.com; s=arc-20160816; b=GoDgmn9gQz0DSu/ymqG7T6YmpOnZ/zYgw+o/LDDV8IF6P2z9kY+6HbCQEOejrpnoq6 b/lkWRhJgV3waVpLISbEv8QNc2F5NaAzxAIEMcRd+vgtVzyDhq6iD8veAeohJTtdZB8x aUZ8AjDAgR19PwFKwi/iuOugtbKPSoKrDADMJWOkPVcedduY3OBD+65i/qMzrtueDU0c NHVwgOD/DRxklv5BYzFQPvV14MQfuu+R9UKRdSou9nrf7ohODi/QOqDKbjJCwLbDn8in nXf7NdJHq0A6yKLEgxVS9WrxAF+YXSNMXnoBcptOtU2bDJAPS+Z1Qk/gkq/yFQnaHvh+ qxow== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=En9pgxY8fJqcBquS50zvXVY+wPkwd3auLWfgI0q1wNY=; b=WcjLtOQ3A0uzd7CB/l7KkYeuRfODd0hfT/ie/ZTfKrBarETusAYTUGEP2SKPKAXdS0 kLY+4oZJog5KplrjZiGA9t21KmY70c2mYm7YGLUR1SiIszMX0YepRh5YnVI70Rf5Ubd0 9yuMVIUlP6QkQTQktF7KHlZVl+s6Vb2Bj1AqCTLmGAbPodkm6vVSkvz0pXKSmnQV+mFD tx2Exfa6tkfXDdDBgJ1K6B7MJWnYvYdFldxdTqXScsM5jbz3Ug4bY5PgZ6Ok/Q7Jrdjx gog7JY7yCvhGfF4/l4rE6vMlv4HgZZv/oqgmRrXzva0+zHZwvPeMs/VXHd4gv+LYQ8UJ Av2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BCp+Pgvg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pi16si50416pjb.154.2022.01.24.12.38.32; Mon, 24 Jan 2022 12:38:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BCp+Pgvg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357267AbiAXTtm (ORCPT + 99 others); Mon, 24 Jan 2022 14:49:42 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:34628 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347433AbiAXTjH (ORCPT ); Mon, 24 Jan 2022 14:39:07 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 290FB614B8; Mon, 24 Jan 2022 19:39:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0D5A1C340ED; Mon, 24 Jan 2022 19:39:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643053146; bh=jDg9XGqHjkDJjhAXgWKbRhPaSoxWIUpSvlaXpemAD9Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BCp+Pgvgfb8e/Jn9w+rlWQ7u5MN3VYeJQGDu6v1pBTWQJ6lyCAoPUTAO2v8rDZHC1 ipJI08tXHs93PXJAq1AHOdfSFqKleJTP2Oo6HkcwN3u+YYoM9FlET/t36WwdzXM+GT kG7T6SbzxZ8bF1deFVfALED5/oUxxCMJPnWZaNaQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Baruch Siach , Rob Herring Subject: [PATCH 5.4 274/320] of: base: Improve argument length mismatch error Date: Mon, 24 Jan 2022 19:44:18 +0100 Message-Id: <20220124184003.297857000@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183953.750177707@linuxfoundation.org> References: <20220124183953.750177707@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Baruch Siach commit 5d05b811b5acb92fc581a7b328b36646c86f5ab9 upstream. The cells_name field of of_phandle_iterator might be NULL. Use the phandle name instead. With this change instead of: OF: /soc/pinctrl@1000000: (null) = 3 found 2 We get: OF: /soc/pinctrl@1000000: phandle pinctrl@1000000 needs 3, found 2 Which is a more helpful messages making DT debugging easier. In this particular example the phandle name looks like duplicate of the same node name. But note that the first node is the parent node (it->parent), while the second is the phandle target (it->node). They happen to be the same in the case that triggered this improvement. See commit 72cb4c48a46a ("arm64: dts: qcom: ipq6018: Fix gpio-ranges property"). Signed-off-by: Baruch Siach Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/f6a68e0088a552ea9dfd4d8e3b5b586d92594738.1640881913.git.baruch@tkos.co.il Signed-off-by: Greg Kroah-Hartman --- drivers/of/base.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -1366,9 +1366,14 @@ int of_phandle_iterator_next(struct of_p * property data length */ if (it->cur + count > it->list_end) { - pr_err("%pOF: %s = %d found %td\n", - it->parent, it->cells_name, - count, it->list_end - it->cur); + if (it->cells_name) + pr_err("%pOF: %s = %d found %td\n", + it->parent, it->cells_name, + count, it->list_end - it->cur); + else + pr_err("%pOF: phandle %s needs %d, found %td\n", + it->parent, of_node_full_name(it->node), + count, it->list_end - it->cur); goto err; } }