Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3730142pxb; Mon, 24 Jan 2022 16:33:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJw3UR7oJ2WidAOPyZqk0X+oy9/AR/XJY5SYm2g+F/CvoUsfJiad/WLwD7F4Pl4sMUMsjhLr X-Received: by 2002:a17:902:d510:b0:14b:3419:8bcb with SMTP id b16-20020a170902d51000b0014b34198bcbmr11007280plg.40.1643070796607; Mon, 24 Jan 2022 16:33:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643070796; cv=none; d=google.com; s=arc-20160816; b=Vq6QVFIITe1nx7dLhvP/orEgFfLalwPTeujEwDJArpz98IR4yCtT1h58X9QaPIVAoW 7dgAJ6284GDGlTpGjTZwmzF6qgKp+QZ6TpBGd3dUUIT/rlEx7BiGtMK1t+dIaiudboMH S4eLURszkAo87GV/QRrNp9H+YhwCH2R/AXWjSlEvVo3u9kfqM1ow6njVybPI7r5QV8jt VbPUHK5u6nxFrf+3P1TU5ss7guvkGkaHY/1r/lokE2gTiImCg8wQIpuVe6MrHafuUM1K GaMOVlFR3CeZIGmt8DzGmHBuhZ9w4bvomMO4CBJciYNnAbCPK5rrLMJpIkjXlfC8C3Ij 1muA== 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=jIyTKG1lvQFXLuZS2tYix/gbgli2cNmqm1g2eH5j990=; b=UG29d2NihOw40LPrzLstZ2tssOl2CW0hEBQc9Huep+z0q051GGN/uP/yGmnoJao2br 6ZFEu3sGEBNE0JVZjFpPnw3/DUZ9VbeqA3Y/oUINdpVvqxfGQaKqCHqVctP/z1uvZuHU 7rvw3MD/DzwD9Bu1XwgCi4nPJyoGdEUDshcZekBDvgGi6/lF8+nAKRpZZz9rxYYs6QTm n0r2MDOmo/y0qmY7Bk+ura6Gad47RRdb+cgDsWW/XbJ6hjKu/3ncuO1WyTJf4I93xp0m Lm/BbOg8Fb5ZUV8uBaN9ONVQt8yQVpc5QGixi2Jpg8EYu/wyVD4NN+2Sl6gOoNcNGF2d seng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kxzr9Pg1; 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 q12si4750838plx.79.2022.01.24.16.33.04; Mon, 24 Jan 2022 16:33:16 -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=kxzr9Pg1; 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 S3410660AbiAYA3n (ORCPT + 99 others); Mon, 24 Jan 2022 19:29:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2363433AbiAXXoa (ORCPT ); Mon, 24 Jan 2022 18:44:30 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 049B2C0BD114; Mon, 24 Jan 2022 13:39:17 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id BCFAEB811A9; Mon, 24 Jan 2022 21:39:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3361C340E4; Mon, 24 Jan 2022 21:39:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643060354; bh=s3xyad9RRiZmE3AKrOXRTeSue6X8CTulLNtjvuwpiS4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kxzr9Pg1mbn/NOleMD80Fd2Vt6A4ym33498lPpDtuN9bG+sSI9Li+kRM1yZ/DtcsW VnUJJOtFYOKBDpGajNsCcpQ1SqLUEDsMfy8R+KFssFpptIjgwSdVIoNzwEnibai6nU eafT9VMzNahFUdhV/0ljjx/7BHju4XZ5QNuRtIAc= 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.16 0921/1039] of: base: Improve argument length mismatch error Date: Mon, 24 Jan 2022 19:45:10 +0100 Message-Id: <20220124184156.256518367@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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 @@ -1349,9 +1349,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; } }