Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2927055pxj; Sun, 6 Jun 2021 19:46:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHdmBpBGEFrTKztXg+VzLVPctntT6Df3rJWzIfEjz+5kx2aepqkOdFLRXRfNbS5yxQVGOH X-Received: by 2002:a50:9b42:: with SMTP id a2mr17416906edj.215.1623033994399; Sun, 06 Jun 2021 19:46:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623033994; cv=none; d=google.com; s=arc-20160816; b=Kym2W1wjpfV8vlHUOOlnWV04byJb6fxg99ST+VQ/IFWZLvnly37vEITnYo7FGic7h1 SxlTlBaWh/CROuBdkKJEk1uberUVG48/Vull6pujJKNI5r9cbO4kFWm917uF5lyTkiOa OIUb/oQMdPBbkYzs48rwU07tqPTb4GPsAo5Kj8Ba67EDMxQblDT83LXWP3//3+6nct30 99Ru/cbcRohE+R8Ild+nWdDJUX5dR1XofNvPshqCJO0vPcY/vYe4e4CouYZ+ETHgTkyM 44Ftputq9PYQCOFriVJFa3QkJQt4f1FXv9UCyCdaPioxEQTZFOU9lHtcesJAHoeXAOyH ndew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=FWc0OiIF0KRY1fl/NFAv3l7YLWkTraVQvFnPNal0M6w=; b=d9Ngo5TDILqwutY7oQE9MMlcrvj+YQfnxUz8MPynICtjNJPPmoOIKt8e5SgA9HE/u3 T2lDIWtyWAy40DDTOiHLPLSiQySaqghM3vJ3ZiKFfnRMSaSBeGEt0Ems/pg9EjWY2m0c 0qWFQQDGqm6Lk/IoNenlt3Gv+Crz+6qIDBlzw8SHkMKl/cdtMTex8CCjEaXgsHy2bRZM Gw37lFdoFbtXqIVlb3iSn7upQkXyqR1kwLfJQrNJkxbL/d5GSKI98WaUGnBSc3dMDzYT 5Io6XtwRw80le+LKmSDSjtNynkN3ZSlzaLB0JFUXyHDNyewJHJTaXJe9ZY+zSl1bpbAv 0xgQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j3si11005350ejv.180.2021.06.06.19.46.11; Sun, 06 Jun 2021 19:46:34 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230150AbhFGCpI (ORCPT + 99 others); Sun, 6 Jun 2021 22:45:08 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:3441 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230127AbhFGCpH (ORCPT ); Sun, 6 Jun 2021 22:45:07 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4FyyJs5Db8z6vwS; Mon, 7 Jun 2021 10:40:13 +0800 (CST) Received: from dggemi762-chm.china.huawei.com (10.1.198.148) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Mon, 7 Jun 2021 10:43:12 +0800 Received: from linux-lmwb.huawei.com (10.175.103.112) by dggemi762-chm.china.huawei.com (10.1.198.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Mon, 7 Jun 2021 10:43:12 +0800 From: Zou Wei To: , , , , CC: , , Zou Wei Subject: [PATCH -next] macintosh: Use for_each_child_of_node() macro Date: Mon, 7 Jun 2021 11:01:48 +0800 Message-ID: <1623034908-30525-1-git-send-email-zou_wei@huawei.com> X-Mailer: git-send-email 2.6.2 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.103.112] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggemi762-chm.china.huawei.com (10.1.198.148) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use for_each_child_of_node() macro instead of open coding it. Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/macintosh/macio_asic.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c index 49af60b..f552c7c 100644 --- a/drivers/macintosh/macio_asic.c +++ b/drivers/macintosh/macio_asic.c @@ -474,7 +474,7 @@ static void macio_pci_add_devices(struct macio_chip *chip) root_res = &rdev->resource[0]; /* First scan 1st level */ - for (np = NULL; (np = of_get_next_child(pnode, np)) != NULL;) { + for_each_child_of_node(pnode, np) { if (macio_skip_device(np)) continue; of_node_get(np); @@ -491,7 +491,7 @@ static void macio_pci_add_devices(struct macio_chip *chip) /* Add media bay devices if any */ if (mbdev) { pnode = mbdev->ofdev.dev.of_node; - for (np = NULL; (np = of_get_next_child(pnode, np)) != NULL;) { + for_each_child_of_node(pnode, np) { if (macio_skip_device(np)) continue; of_node_get(np); @@ -504,7 +504,7 @@ static void macio_pci_add_devices(struct macio_chip *chip) /* Add serial ports if any */ if (sdev) { pnode = sdev->ofdev.dev.of_node; - for (np = NULL; (np = of_get_next_child(pnode, np)) != NULL;) { + for_each_child_of_node(pnode, np) { if (macio_skip_device(np)) continue; of_node_get(np); -- 2.6.2