Received: by 2002:a05:6a10:144:0:0:0:0 with SMTP id 4csp737567pxw; Fri, 8 Apr 2022 21:51:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDfUxa3MwXFrc37YzASteQL/IpcMFFyoktSyX1FZnwOaRlUa5nX6jFiCbzNNNooRbd2zrW X-Received: by 2002:a17:902:db0f:b0:156:9bf0:952d with SMTP id m15-20020a170902db0f00b001569bf0952dmr22584798plx.52.1649479900427; Fri, 08 Apr 2022 21:51:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649479900; cv=none; d=google.com; s=arc-20160816; b=HgLSMysLFY4Vx5ID7FhqSQSCzwEFUDECmmYT3wTWbifg9KLFCBHVZzNyukdiV+SpuO 1VYeUA5jj4df4TWsldPjd/akJ8AXvYRywisd72BFB//lFwtZhRAuBvfMNYUaHJDqMB17 /DAZaI6oSXFLddDSnZUjsnOlk+ljYvmSEeK2cp5H5wFGcIOM1b2W0cGlXBWGcOOxO5Nj q0qb1gLiRWMOiUGhycTpgyrRdsNssq8UphvGgFWlN2WL/yQC5PxqDcE/0l0Sg2Ic7mDu v+vEJPr4M4ivyqhv1kTxnYFJI3IXo4Png9B1taBChYh4kn78Dg1bNZZGxOQFPp5FLhKj cTRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=21jtzEJbz8CXG5TvZ6CXa+Hmlx1NAai/O+bXOsjOQP4=; b=rFtBQAuukJuxV+Q6Z1+e5NmtJLNuieiOPXza6fsUFbwbP7ShhvHHkqnhE0+XuZjDfX iPeBGTiuXtq6sQgHCxu/JDpzOIoO6KFiqc0essXp/hEbJuYhSflnjz5Y21Z0hm+Hnbc5 efzxtLJmBq4GJ6pmqGCfrFS65IRMeTVhh7s4qikn4b/WGcL/Vxirt5+yZW335UK9cZIl +8g2w+JQGB3R7NqBBvTTtdwwu8GwjRQsyjkTUIas86aPttZuq3O8VzYgbHJbCNyjG4U6 FkVzUaVKBGH6kNQDi3sN7IJSyLkzBHZhs4tsWson6TpkKJfbFVQ+v1b9E2ltMKwUeoDU vndA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AwBP3ICs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i4-20020aa79084000000b004fe543a9e60si2677575pfa.156.2022.04.08.21.51.26; Fri, 08 Apr 2022 21:51:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AwBP3ICs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238476AbiDIAGi (ORCPT + 99 others); Fri, 8 Apr 2022 20:06:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233045AbiDIAGe (ORCPT ); Fri, 8 Apr 2022 20:06:34 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E3151EDA3B; Fri, 8 Apr 2022 17:04:28 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 0F168B821FB; Sat, 9 Apr 2022 00:04:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 892C8C385A3; Sat, 9 Apr 2022 00:04:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649462665; bh=bd8rzBS+vEc4ttPjaHAQjZ7XjvJdbi78cn8u1jcSgnY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=AwBP3ICswtwn4xr9uXInDJ4nqqlw/9l7rsH7J5AmSQ38K7fhTXA/NIsNkI3Cku5LF UyOlYbhACeeY/VSub9qNl02fo6GS4pMScAhZgzr371jyLskztqeh5z1ZItO+hxfMLV /aPzSIUVhfVwrmhDdf/FLz7WbjqYG23kHHCcNWNodIQ4ejDS5PdzQ/dHAtIGLry+hQ ir5v8brOrIClr3cwwWDmp3wWYO8brZ/IyRy3D1ItZTpXVEm//sr5Cwr/s/1cBmrtEG x7Tt7OnYb+8u5jUHUvv635ozDpZ13jxsnG+j3lNWF2SHpwUVQ3yLXRLZgCTH9fQ3Ku rHHyHCSlsR/Ww== Date: Fri, 8 Apr 2022 17:04:23 -0700 From: Jakub Kicinski To: Jakob Koschel Cc: "David S. Miller" , Paolo Abeni , Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , Lars Povlsen , Steen Hegelund , UNGLinuxDriver@microchip.com, Ariel Elior , Manish Chopra , Edward Cree , Martin Habets , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Jiri Pirko , Casper Andersson , Bjarni Jonasson , Colin Ian King , Michael Walle , Christophe JAILLET , Arnd Bergmann , Eric Dumazet , Di Zhu , Xu Wang , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, Mike Rapoport , Brian Johannesmeyer , Cristiano Giuffrida , "Bos, H.J." Subject: Re: [PATCH net-next 02/15] net: dsa: sja1105: Remove usage of iterator for list_add() after loop Message-ID: <20220408170423.35b379d9@kernel.org> In-Reply-To: References: <20220407102900.3086255-1-jakobkoschel@gmail.com> <20220407102900.3086255-3-jakobkoschel@gmail.com> <20220407205426.6a31e4b2@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 9 Apr 2022 01:58:29 +0200 Jakob Koschel wrote: > > This turns a pretty slick piece of code into something ugly :( > > I'd rather you open coded the iteration here than make it more > > complex to satisfy "safe coding guidelines". > > I'm not entirely sure I understand what you mean with > "open coded the iteration". But maybe the solution proposed by Vladimir [1] > works for you? Yup, that's what I meant! > I'm planning to rewrite the cases in that way for the relevant ones. > > > Also the list_add() could be converted to list_add_tail(). > > Good point, I wasn't sure if that's considered as something that should be > done as a separate change. I'm happy to include it in v2. Ack, separate patch would be better for that. I guess Vladimir may have used .prev on purpose, since _tail() doesn't intuitively scream _after() Anyway, not important.