From patchwork Thu Dec 9 02:41:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 1565571 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=pK2jFAY9; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4J8dbY5QhLz9sRR for ; Thu, 9 Dec 2021 13:42:01 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7B3CA8193A; Thu, 9 Dec 2021 03:41:56 +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="pK2jFAY9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6AA9582F91; Thu, 9 Dec 2021 03:41:54 +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-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) (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 375AF811D9 for ; Thu, 9 Dec 2021 03:41:51 +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-pf1-x42f.google.com with SMTP id g18so4123550pfk.5 for ; Wed, 08 Dec 2021 18:41:51 -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:mime-version :content-transfer-encoding; bh=Dn4vUcXR703H4rWltIKdHVHwUawMm6yEwEClHG4bWi8=; b=pK2jFAY9B7nm76B5/HoQCsBSq1dlRAQKbjov9dWh0DBBXaJKAZ1GDwbDPpoSHcxq4y 1F8m2XA/GEclKGdd75ETlKlrmCVg+wvvA7gv5Z9sRPHDNL6W7FKZUC9oyTz89saHU3mO 2BaMiST+dTqZezvaGY0ICOev4BXMSy+S272hoDfc9igrQqvLhNlmKPD0u8GnIM8EhCGM 1QRcFQJ95T3qS1sYz8wtMFl5YHlluFl+XVmI5nAvQSPwDtm2nONi5oLWzeTV67Rg6OMF IGsrtcgX5N5nSwiKjC1fbthG+7O//00WUMGAFfL2WwVpH91tGgHNKOFNTmmJMuetEBzq ZrMg== 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:mime-version :content-transfer-encoding; bh=Dn4vUcXR703H4rWltIKdHVHwUawMm6yEwEClHG4bWi8=; b=FsmieiDz/ZANKF2nPtYAmBBUIDMqjZvgfE9SeicNBjriu0a30eOvpcAKfF2H8ngMa3 endQHUz2Yru5EGf9VqzfhMWzGbUaVtE4R7AqQQ12LX6ejaLBt3s0LkgSem6QCf+EnJ5A ceasN6enOG77agl4X04YWMpyxDS/5KoQFkQnSbSLq1tsg5pwVAI3+GBQKk/Vuz0TqI7I QwRe1iDlU/LXI1K7cN0ILvAZXf8UZUebiqpkJtvdHP6KKgCm3hKX3bSCz2jw5pNI1vry hW53Zh76aAPVguuG6e0hfH4xS6mWfc/oBYAdtPuRpNYspfguPNyq0tjIqEBlad6oeEyX Pq3w== X-Gm-Message-State: AOAM530QLrSsHBheX4iUUqBSTr+nR+jNrDGkKX3ghZYnq/HssF5jYiOW gB4nawND7kvw7pNRHAyd0RwFeg== X-Google-Smtp-Source: ABdhPJw002u2An3Ft6/awuLfaUQouX+R1DbPpdErv0uHWzGuR+IbNc7TE8Ks27pauZ/I81mQG3hTGA== X-Received: by 2002:a63:4c09:: with SMTP id z9mr31348304pga.561.1639017709446; Wed, 08 Dec 2021 18:41:49 -0800 (PST) Received: from localhost.localdomain ([2400:4050:c3e1:100:9c7e:5a6d:3f01:d562]) by smtp.gmail.com with ESMTPSA id u22sm5065087pfk.148.2021.12.08.18.41.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Dec 2021 18:41:49 -0800 (PST) From: AKASHI Takahiro To: sjg@chromium.org Cc: u-boot@lists.denx.de, AKASHI Takahiro Subject: [PATCH] dm: fix an 'undefined' error in some macros Date: Thu, 9 Dec 2021 11:41:20 +0900 Message-Id: <20211209024120.47920-1-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.33.0 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") --- 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