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: 522495 Delivered-To: patch@linaro.org Received: by 2002:a05:6e04:2287:0:0:0:0 with SMTP id bl7csp377112imb; Wed, 8 Dec 2021 18:41:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJwQUgRLsLe/O0u6+6ZZmU/rxHSrP0PeBj1Lbq4IGw89bAwfMdSQ+NMNPQFCnRZVobFYEhhV X-Received: by 2002:a17:906:f856:: with SMTP id ks22mr11799314ejb.367.1639017719425; Wed, 08 Dec 2021 18:41:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639017719; cv=none; d=google.com; s=arc-20160816; b=GymH3xJLKGGNoe8FJhIs5pamVo3RYLHTG2ba+6355PBwQhMe8LB25uCnAHOIpSJlaN dxex3ERGW/sQGe1iZSw3jbYPCN+O5rXeWOB1B6dgVMAWezzMCTY4pfh2bqfO2950DSTo 9G2J1DW7dpJ5rPakP6t42fbyr4zG8VlXkwKjX4OyPR4rI5IPapw4F78EA100dAE0G/nV 3SpHRloU2qcQV1fOWrFKjUsFI8qNFJzNo5KgChCEf60PTQI2E2TqorOCqegBLUK01Uzf I9lV21FxyoY+x2Kqpu+GpchXapmHI1SoF2k14XnCOt3Kq3j5ESU7EbJvooenvSY+oooB yGBg== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=Dn4vUcXR703H4rWltIKdHVHwUawMm6yEwEClHG4bWi8=; b=p6/S7CVLHa2ddnQdYAKLf/OYIMyw78qdLMWBBOTKSF4JNGm22oW3n0b16GJ5byKfH2 bij6hQmgCLx5qLkWFShfYaVAiH1A67s9RshNrNyncXt5k8lsebaDngX00DpblqzvZT6N ZMAYX9gOWYyhCkCsRS76w+RKobEkfzeOZGH0jDBdUvjCeTuXDP5kKiVF6cHIVVTcA2rH zsRGoRaska5hA4ovcz88Xdi7Z3/rIzVUnagsP4H1ynucHpJFpmZi7D2nWNsDDyuFp0S7 /dRGOyvW3ttsAoLQxCMTu8Afhgxkezf7UvNZucEmoX4YAJnxKWYwE6rFxDAbARXTcysV 4STg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pK2jFAY9; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id cb17si6063080edb.493.2021.12.08.18.41.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Dec 2021 18:41:59 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pK2jFAY9; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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 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-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