Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1906042rdb; Thu, 7 Dec 2023 12:01:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IFeNa6zGrcWnuPbqI8PK2ipj/qidRU6lpJfwOvFOGfdlCfWoESH/Vsx1O+DxqVP3KuZZJg2 X-Received: by 2002:a17:90b:3686:b0:286:6cc1:28d with SMTP id mj6-20020a17090b368600b002866cc1028dmr2892792pjb.88.1701979317315; Thu, 07 Dec 2023 12:01:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701979317; cv=none; d=google.com; s=arc-20160816; b=itPaFjZO5JqWN+01ccnf7dUTbUWhXyEGAG1vYAQB2vQkwPM6wZPXnV8gb3DEPPFaEV cv72R4P5TnjaHZv+0DUDq1EfKJ20a8s/54M6W5E2HLWbJQTdpU/8BsrQzWRi01OJuEMy uo8rqgEd05DymEbv83OrIVAYXi+a3abTI3qq31NGDfiGRe/L+wFwtk8dlcB5wa/ekqM/ t9OkZYRErmxE1xFvQsr9vxVCWLeBpWyUV6WuvrIwwPWNN50/POdzW8koHXqrvbImqeGF Xiz2v+ROoOR7O+OLSNID/u08fziFtwFY5vQvw6B9uE6YWa7mw0Pq8JDPSbDbT73cstUE WF7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=BxKQalM2XsdeZ6LbLxJy5cCkk6wpAYdzkOBgji/EH9U=; fh=BULYyMR2XGUmIte48OZ4FNENARqHFLJ1OgYe4PacFUQ=; b=aSJ6u4kN6MT8o5Uhc5WZZFlxQlN8TfqIBoqWGYSECKJy28lGxmgBUItNniAhC1UVIv yyEmn4uiEWY/5t7QaOCmrL7mc2oGpVM7Yizej8lptsVSioq9Jfe3pFZ+clfBtLgZLMZv j49QdXK2xQ0tW31PTd9wgszpArtSmG3JGCePA18eICL9oInsMCzX9q66nL4+w9q7XcSP 8y25T3xdOgn0kSe1AqKJL3Lmi9kQHb2v6W2l+SQxX09AmPL/lhaK7Fah+vmqNLUu+JGO e6ud0ZPVCJi+DqfVShlNzY0aRqAmiTwbz40fYBKcoGpGoOnJ+jM/X8sMF5JkNdNeeOmn jtYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=M3+sAbO4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id pi2-20020a17090b1e4200b00286a689f0e0si1642800pjb.1.2023.12.07.12.01.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 12:01:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=M3+sAbO4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id CCCA38083DC7; Thu, 7 Dec 2023 12:01:54 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230403AbjLGUBc (ORCPT + 99 others); Thu, 7 Dec 2023 15:01:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229541AbjLGUBb (ORCPT ); Thu, 7 Dec 2023 15:01:31 -0500 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3CC510F7; Thu, 7 Dec 2023 12:01:37 -0800 (PST) Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a1db6c63028so151999266b.2; Thu, 07 Dec 2023 12:01:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701979296; x=1702584096; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=BxKQalM2XsdeZ6LbLxJy5cCkk6wpAYdzkOBgji/EH9U=; b=M3+sAbO47F8/nZw15naHvPabJAA5sCwgIl9JssmMSOCImtRdnPxLqX630boLHzVbZ9 5ylt2/cfAtUYEwzUDN2LNPRG8yCv8oy1B4NJdFtmrILYGsqMD06Lx8UqEPSfiPlqzlpf 45vnBiWFXyDbtOmIqZZoewD2aCTp6X+pckrOMXnU8yxn5KwzsCUaX7BoVfzte0rjZP5d +SjQVa1VN6oU17j9gBkvUJFidutekc4j52PC17xhTQShq72ewPwwK/Tj6tHLsrNDiB3f /f5CpItUA2zAvkGW7nETL5EoFCvWTTQhl79+L+hs1MLp1Yqkce9tkEzy0yIxDRDaJKMN qYFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701979296; x=1702584096; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=BxKQalM2XsdeZ6LbLxJy5cCkk6wpAYdzkOBgji/EH9U=; b=VtLX7+8KPcme3ILX9LUPpcGQ9dwGfthB38WK30fJtev0HZm6ro3Em/fyLRoCzJBrxr M76LhWp8niRV0nD2q3PMOn0FuAK6Tva2vDnLFjXX0YIG0H86yvID6N6N5pE4efc0tFI4 n2ltekANdpobfXP7dAdWiUqw7FaPJiGeqySXkkS/DupzK73ogEx7CGeWnNOLJNtS2Fcp AqI3xORF8zrEBgwUpKKgEBCEV0h1Ehm4LJasQbMzMIKle2AjoBe/H6HZwuGmnxHup8nV PNSKaAcc6vEXgAn0MNkB+jAphbHojtg7UNSz6+/6X2SMOWycXlxGY0jgp+Kddjfz16Ov KeOQ== X-Gm-Message-State: AOJu0YzbT64rQO4InonWCSpOCXH5l4GwXfM/rMKi3038OwE1EIte5/yx tjfcfYsl7FHxm2LMprCQbBI= X-Received: by 2002:a17:906:5185:b0:a19:a19a:ea9a with SMTP id y5-20020a170906518500b00a19a19aea9amr1705134ejk.83.1701979295685; Thu, 07 Dec 2023 12:01:35 -0800 (PST) Received: from skbuf ([188.27.185.68]) by smtp.gmail.com with ESMTPSA id cu12-20020a170906ba8c00b00a10f3030e11sm141937ejd.1.2023.12.07.12.01.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 12:01:35 -0800 (PST) Date: Thu, 7 Dec 2023 22:01:32 +0200 From: Vladimir Oltean To: =?utf-8?B?QXLEsW7DpyDDnE5BTA==?= Cc: Dan Carpenter , Simon Horman , Daniel Golle , Landen Chao , DENG Qingfang , Sean Wang , Andrew Lunn , Florian Fainelli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Russell King , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Frank Wunderlich , Bartel Eerdekens , mithat.guner@xeront.com, erkin.bozoglu@xeront.com Subject: Re: [PATCH net-next 07/15] net: dsa: mt7530: do not run mt7530_setup_port5() if port 5 is disabled Message-ID: <20231207200132.772h3t3l6coan6ht@skbuf> References: <20231118123205.266819-1-arinc.unal@arinc9.com> <20231118123205.266819-8-arinc.unal@arinc9.com> <20231121185358.GA16629@kernel.org> <90fde560-054e-4188-b15c-df2e082d3e33@moroto.mountain> <20231207184015.u7uoyfhdxiyuw6hh@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231207184015.u7uoyfhdxiyuw6hh@skbuf> X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Thu, 07 Dec 2023 12:01:55 -0800 (PST) On Thu, Dec 07, 2023 at 08:40:15PM +0200, Vladimir Oltean wrote: > Also, reducing the indentation level of for_each_child_of_node() by one > can't be bad. Maybe even by more. There's this pattern: > > for_each_child_of_node(dn, mac_np) { > // do stuff with mac_np > break; > } > > aka we only care about the first child of dn. We could find the mac_np > as the only operation inside for_each_child_of_node(), break directly, > and "do stuff with mac_np" could be done outside, further reducing the > indentation by 1 level. I noticed just now that there is further filtering on the child OF node by of_device_is_compatible(). In that case, of_get_compatible_child() could be used to eliminate for_each_child_of_node() completely.