From patchwork Fri Dec 10 06:49:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 522732 Delivered-To: patch@linaro.org Received: by 2002:a05:6e04:2287:0:0:0:0 with SMTP id bl7csp2169591imb; Thu, 9 Dec 2021 22:51:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJw5tXxh3ZtVNFzGtqv8krh820CsrTHMa9wYGPefS/kx0zcEGtAkm885dlHLF+3Vx2bwIkj4 X-Received: by 2002:a05:6402:3590:: with SMTP id y16mr34934405edc.343.1639119117622; Thu, 09 Dec 2021 22:51:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639119117; cv=none; d=google.com; s=arc-20160816; b=izy9TGJ13aTYmPUzhhbT/4b44kqqJXwcHwb2Fc9a8jSdC5O58uDfO2YCTuoDSAa7SR c74NMMzdlqQ/uexspI+LyZvY/1h80dUu3Rhou/a4O0dxFarXq0AtdgREXOxdNqfZjQ2T DQAvclbgnOFJ6LZ+JRaUgIqKjVHQ8Z9dR5alqsU+mQOWdEBegvXzrQRsdp8gvbYEO+B6 9L7LbRRLyBoXwgD1QA0KGUsa0QrXk+2zTcbHu2VgfFEDbWe28AZfC8HJkdVxMNXizIGW S3R9PTcNwk+blgFOnUk5jkqiV7sTbDEimnP9xNtcX98bO49pD1z61L4X+mXSe2YAgog2 Jn5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Dn4vUcXR703H4rWltIKdHVHwUawMm6yEwEClHG4bWi8=; b=F1YylNNEfQKvrm0R7wvIoPrxOIKH1rCWFydIKy7ahZa1NkMZ0a7Fht2ok8EpwX1YCq fy+i2LIWGrD/D+gtNzD1a/8VQ5qLb19av1M0KtsPxYeVHUMCdQOiTaBJt0gxzqK/j92n ehLmD34gHR+ORcj3Wg/VtInXuR36rCt9PTTAkInSumXDtAE/bUp+NMaBIQIRT+SS7NmP 3wuJOfb7nR1MfHPJpc1ONILRiUy82HxlB2esuhah6wmBnC3/dxcUZBN2CW7ABTnjWAHY K2MpII3VRgS/y5DIUICG1jgqTDkLAB0f9jNdp2AptM0HuJrtIvgQQJNNJS0IFD1O+Ldg 000Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oPKZddO9; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id bi1si3379897edb.285.2021.12.09.22.51.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Dec 2021 22:51:57 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oPKZddO9; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9479E8316B; Fri, 10 Dec 2021 07:51:11 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="oPKZddO9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3AFA083012; Fri, 10 Dec 2021 07:50:51 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 305B8830BA for ; Fri, 10 Dec 2021 07:50:46 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=takahiro.akashi@linaro.org Received: by mail-pj1-x1029.google.com with SMTP id j6-20020a17090a588600b001a78a5ce46aso8788509pji.0 for ; Thu, 09 Dec 2021 22:50:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Dn4vUcXR703H4rWltIKdHVHwUawMm6yEwEClHG4bWi8=; b=oPKZddO9mPnvvbyBoSPr0N//kO6PG7WayeR+2N5oeljToNwhWCQCx1DED+m1cCOmmh i23/R8KEpwoXAdqs3ubz9nRwcyidyXIaUKmFyzf7b/FPAdShGiK/kNBSWJ9aJYrg3Gg2 zbXUwbVhevd/a4x3jxlNEEdiBwyt+9b+ch9VD5o+IzOor1Fpzo03mqNZhyV/9EmUHAJ5 uDjxaYwZdXCdfb62xtgtj3lHoAyQxTDRfH2QR2goV+Hc/FidoBhjRPZSeRr6TlYkU8Yv GKnSNOQFv7qHuDoA24wY2SAfcgzBcJQ71cKv7zaUbXnL8R6s3vxT22laVgDzGH79ToEK DHRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Dn4vUcXR703H4rWltIKdHVHwUawMm6yEwEClHG4bWi8=; b=GcJz3wl8WleaXcFqjxuSMhq3Scimb2zhmMqj8ZmaNUSV80ilu9lOyh2pSobkDEB0w3 cU9g7/G/+98Ru0kxgfanUEijJr17kQGkFrAQfdwQeV0D9enponGPDKuHc6dg8N/obXcB qMo6LUPFjo6qDRgrJwmY53gtKi8A9coVa16XkkTB4Eed3/hufZ4l4WPHdQDNYFJtblGY Q14RobXLMrzFgx1jadcDNBkits1x4wehcNuhBj9FXpL8UE/FGE/lX/SrZFqxXzKSmZn7 2Y5XCBhEQcaQcno19czZYc7KYJxhbbjc5LzWOEIvbE8lQOpldv5Zm1sVIP9zZZStiOeE DXwQ== X-Gm-Message-State: AOAM530noWcwAk98hoYYjXfNZ0ObyNK1zEeShXCV+PQy0KN0l+Awx5YC aBnNtHRLHHBxLoeQttWwsBnfqQ== X-Received: by 2002:a17:90a:be0c:: with SMTP id a12mr22060375pjs.204.1639119044715; Thu, 09 Dec 2021 22:50:44 -0800 (PST) Received: from localhost.localdomain ([2400:4050:c3e1:100:75dd:4e0e:4542:936e]) by smtp.gmail.com with ESMTPSA id nn4sm1639035pjb.38.2021.12.09.22.50.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Dec 2021 22:50:44 -0800 (PST) From: AKASHI Takahiro To: xypron.glpk@gmx.de, agraf@csgraf.de, sjg@chromium.org, ilias.apalodimas@linaro.org Cc: masami.hiramatsu@linaro.org, u-boot@lists.denx.de, AKASHI Takahiro Subject: [RFC v2 09/20] dm: fix an 'undefined' error in some macros Date: Fri, 10 Dec 2021 15:49:36 +0900 Message-Id: <20211210064947.73361-10-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211210064947.73361-1-takahiro.akashi@linaro.org> References: <20211210064947.73361-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Due to a non-existing parameter name in macro's, use of those macro's will cause a compiler error of "undefined reference". Unfortunately, dm test doesn't fail because a wrong name ("&dev", hence it is accidentally a valid name in the context of a caller site) is passed on. Signed-off-by: AKASHI Takahiro Fixes: f262d4ca4b2b ("dm: core: Add a way to read platdata for all child devices") Fixes: 903e83ee8464 ("dm: core: Add a way to iterate through children, probing each") Reviewed-by: Simon Glass Reviewed-by: Ilias Apalodimas --- include/dm/device.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/dm/device.h b/include/dm/device.h index 3028d002ab0d..f7900417066d 100644 --- a/include/dm/device.h +++ b/include/dm/device.h @@ -959,8 +959,8 @@ static inline bool device_is_on_pci_bus(const struct udevice *dev) * @parent: parent device to scan */ #define device_foreach_child_of_to_plat(pos, parent) \ - for (int _ret = device_first_child_ofdata_err(parent, &dev); !_ret; \ - _ret = device_next_child_ofdata_err(&dev)) + for (int _ret = device_first_child_ofdata_err(parent, &pos); !_ret; \ + _ret = device_next_child_ofdata_err(&pos)) /** * device_foreach_child_probe() - iterate through children, probing them @@ -976,8 +976,8 @@ static inline bool device_is_on_pci_bus(const struct udevice *dev) * @parent: parent device to scan */ #define device_foreach_child_probe(pos, parent) \ - for (int _ret = device_first_child_err(parent, &dev); !_ret; \ - _ret = device_next_child_err(&dev)) + for (int _ret = device_first_child_err(parent, &pos); !_ret; \ + _ret = device_next_child_err(&pos)) /** * dm_scan_fdt_dev() - Bind child device in the device tree