Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4722483ioa; Wed, 27 Apr 2022 09:40:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3oYsqkhVsZtwOJZUSMnosoIB6XN7RvSms5DnDGlsD9IEx9ioxnfsuIHzwnAQL1XMUs8xC X-Received: by 2002:a17:902:f70a:b0:153:88c7:774 with SMTP id h10-20020a170902f70a00b0015388c70774mr29294178plo.166.1651077611572; Wed, 27 Apr 2022 09:40:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651077611; cv=none; d=google.com; s=arc-20160816; b=hvIj651YzZ4H4chk5yroSPT0Mv1E1dfs78fzOJ0N+C5+tx2tmhaKxqlsi/thvepXym 4UT2fudG9nbLVzuDrihDBI54JErvbzmB9LkIEWgNANvbKW48NiM++UwfKhj3lLvHVGBw qkYg5BDDc8NL6deu3080l/vZAoiK+rfAb7bseUf0Q8c3Xy+vQEAq4BN3LTR9afx78odD wMY6p3KK9NyNWdsgN7loOgm97RfUBqtqiIe1WnoGxUGYJ1ReZ+TkyRZshz6jeenieYMo onP6MQqAjAqDddWwHX3CX5n6Q2MHwjb/s4M1AogAp2x3pI+L2yGVaxpd7ULzWBQ3QCBl 6Evg== 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:date:subject:cc:to:from :dkim-signature; bh=L7bydI8W7YKPMa0QpXcwp0iK03JxiA65XfYkLVk338s=; b=p2CsBm1kb6Y83Lj7fNEOMdHtIL0CWuyXLQtEVdzH3MqnrgkXl6KOMScErepLt/yQlv hzcaZLiIom9duloz6tLOmIOHouuhICWT5qXg/YNlI4BqWr44KJ2WKgzCGYMn/qzpMLFn gX34lceMFZDsOlIEoEIR2r32y0HkvjdgfM4n9QEgZiOfUvccjTBQY2yLTZZfyHoanemC arXt7im3Y1vu/2HHYRhAjjbyw2vIUBIVNlNHtUxZtNkluuX1FhvJMl2O1o6zzHhM+dT+ fbF/bmW9qRY29xfGDj5e4VpPrtsaEXvrYYQyPfcKMx/gAiHwDV4pGqwpYG4Ev8TbSfKb zjuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="me/CfCMU"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id 30-20020a63175e000000b00398d8b1871bsi2152470pgx.44.2022.04.27.09.40.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 09:40:11 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="me/CfCMU"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 910CD49FF82; Wed, 27 Apr 2022 09:09:37 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241610AbiD0QMa (ORCPT + 99 others); Wed, 27 Apr 2022 12:12:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241907AbiD0QLy (ORCPT ); Wed, 27 Apr 2022 12:11:54 -0400 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 048FD49027E; Wed, 27 Apr 2022 09:07:56 -0700 (PDT) Received: by mail-ej1-x62c.google.com with SMTP id y3so4325395ejo.12; Wed, 27 Apr 2022 09:07:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=L7bydI8W7YKPMa0QpXcwp0iK03JxiA65XfYkLVk338s=; b=me/CfCMUzGN50v7aHW31BqgSnLtBSZmfvAHp5J7/hmxJn1cJoAxJnDiUBPmp28ldHA +GqEMGf2wiZIuh3K2rqkDck0yOW+vzBJCFtMKxdknc1uVNxKJEZ4gxdJDskKAyWsUucb 6bMeInlzy6Of9d/Pc22rBibJlCHrw/7AAwcu0id7P82U2wisfojvpL4x2jLueBTGDEWj aa6wF7qFHEu5HxnjRJS6k8c6Bb86bjEUZA/Me25yzxMt+DdMujV13iTbg8BjgNoSGdRS x2cDpFPCekknCFLP4V5Ou6fIx7tnmJ9Us5hq32MYbmFhIFLrYWL0JQyecgu0p5TtMAPg CnBw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=L7bydI8W7YKPMa0QpXcwp0iK03JxiA65XfYkLVk338s=; b=Uz9LU/79sux3xVUaNjbXkAvK/r+w27p89eJW/9OiCWUYr+htDTFPyP1TNFEvTjX68D yMewtOZ93VC+bMF6WcMNQVWEL0++vsJ1wKhwTtE+L3aTKGPkgCJxBxXB4SgYGYlIfAoU ccVUxMeBybcC7r49ACp6EiunAYU1ZbUObxWEIW2JWQ3R14Mt9jMxxnbWnFHpO6UMbxYR qw9pNen9v6XC5RHCmVCrwsEZFEfrE+KHCxXAKc3H0bOtqMaH5EsS41QfwAK2DpxISs+Q qVwP+ZXFlOi21DP5e2ZYIGQxioQ7eDWvwNU1m4tDwQpJYLuqlAJGnsg1A+otVphNy6xx x1Yw== X-Gm-Message-State: AOAM531aF/4ZmeI8HpC4lmE3eROBqjYorUhyXDpLr4xFVe67RFeI+skt Mw74kUjIXUdjyfzynWQCtCI= X-Received: by 2002:a17:906:5d11:b0:6f3:722a:1fee with SMTP id g17-20020a1709065d1100b006f3722a1feemr21285729ejt.9.1651075639369; Wed, 27 Apr 2022 09:07:19 -0700 (PDT) Received: from localhost.localdomain (i130160.upc-i.chello.nl. [62.195.130.160]) by smtp.googlemail.com with ESMTPSA id n5-20020a170906378500b006efb4ab6f59sm6984098ejc.86.2022.04.27.09.07.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 09:07:19 -0700 (PDT) From: Jakob Koschel To: "David S. Miller" Cc: Jakub Kicinski , 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 , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Casper Andersson , Jakob Koschel , Arnd Bergmann , Jason Gunthorpe , Christophe JAILLET , Colin Ian King , Eric Dumazet , Xu Wang , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, bpf@vger.kernel.org, Mike Rapoport , "Brian Johannesmeyer" , Cristiano Giuffrida , "Bos, H.J." , Vladimir Oltean Subject: [PATCH net-next v5 04/18] net: dsa: sja1105: use list_add_tail(pos) instead of list_add(pos->prev) Date: Wed, 27 Apr 2022 18:06:21 +0200 Message-Id: <20220427160635.420492-5-jakobkoschel@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220427160635.420492-1-jakobkoschel@gmail.com> References: <20220427160635.420492-1-jakobkoschel@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE autolearn=no 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 From: Vladimir Oltean When passed a non-head list element, list_add_tail() actually adds the new element to its left, which is what we want. Despite the slightly confusing name, use the dedicated function which does the same thing as the open-coded list_add(pos->prev). Suggested-by: Jakub Kicinski Signed-off-by: Vladimir Oltean Signed-off-by: Jakob Koschel Reviewed-by: Florian Fainelli --- drivers/net/dsa/sja1105/sja1105_vl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/dsa/sja1105/sja1105_vl.c b/drivers/net/dsa/sja1105/sja1105_vl.c index e5ea8eb9ec4e..7fe9b18f1cbd 100644 --- a/drivers/net/dsa/sja1105/sja1105_vl.c +++ b/drivers/net/dsa/sja1105/sja1105_vl.c @@ -49,7 +49,7 @@ static int sja1105_insert_gate_entry(struct sja1105_gating_config *gating_cfg, e->rule = rule; e->gate_state = gate_state; e->interval = entry_time; - list_add(&e->list, pos->prev); + list_add_tail(&e->list, pos); gating_cfg->num_entries++; -- 2.25.1