Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp815334pxb; Tue, 12 Apr 2022 14:13:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXfN5WUg/UbNxA2WLOBllhumfIbn6P95eE2E7/h4XnH5W2Rle89Uo1GZgN7lJygzL+OG8m X-Received: by 2002:a05:6a00:1a91:b0:4fa:b21d:2ce with SMTP id e17-20020a056a001a9100b004fab21d02cemr6507296pfv.75.1649797984665; Tue, 12 Apr 2022 14:13:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649797984; cv=none; d=google.com; s=arc-20160816; b=Cx6r1kmXKusLtYhG0jSJRnWKQZZQZ4LpjXcG30lq1NOLa58DhLTooLIFfljC57+6tx RWDOMmoCXSx520u06vP0E32fmlsih8GNzagJcUZoHsmfky/TBSVr9XGQKpEnFbqmxItj m/it9dKG6RWquUcwsZlkW8H18seFHy7XthufO01HNoiK40pl3cfcMAiKSNh8INIZl3pP bpZLmvmegLeYqJtieDfIyYSuOc9AFdOfxbrsrS+zdZhUx+P27Ojrdzj5JZzKpcESS4Hg pHc5CxC3REDf//mCa9Q3OMXXFuvQzV9OFNj0QtkkllMZVhlZss/TPczlY8Fb4VGFsaH1 Sk6g== 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=esB5mepgr5nyvG9nrRmGTzzqc+m2Rur7gox62JB2JxA=; b=UYAZCEFSV8cPOBoo7J56NCTc2FzYYL7Zn2nBU/y670eEzJXyvQ9APzAd2PrNDt/gr/ QSrRcy9WDPcZXCntUIwZ+ruPvtdAj6vsI6LRF9ehaHIhe88SiudZTWitiTI9JkiPM7Zd cW7LFoyfMvga1BAxbLdEUE9z5lUaaJW/kSVMdn1HkSmNLJuO5UzRRnXqawJzP3qHEb7j W8SG03tGMTre0qzzLuHs3zjkaj+FFxUYFvZ0NMC2W4VZEgriGguwd6gzVmVlz/8iYOJC xbqzLhJhUksIMHel60+wzwE/A1i8qF1EfqbIKvFCvQ2mud4S5iJ2Ml8pZceAI6FZSqzz gqZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=PuvOlw8F; 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 k8-20020a63ff08000000b0039d68b7a689si1991484pgi.20.2022.04.12.14.13.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 14:13:04 -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=PuvOlw8F; 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 1FF7FE9CB9; Tue, 12 Apr 2022 13:28:40 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347463AbiDLMFN (ORCPT + 99 others); Tue, 12 Apr 2022 08:05:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351373AbiDLMCh (ORCPT ); Tue, 12 Apr 2022 08:02:37 -0400 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E24A7805D; Tue, 12 Apr 2022 03:58:58 -0700 (PDT) Received: by mail-ed1-x532.google.com with SMTP id c6so6729086edn.8; Tue, 12 Apr 2022 03:58:58 -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=esB5mepgr5nyvG9nrRmGTzzqc+m2Rur7gox62JB2JxA=; b=PuvOlw8FCBCG5e+EE/ntog+d+HeeY8K1lZiupPOEKAdCgqu2LkYctFFE46dcuaKWxD JqH+76Qb0X+BMNsfA9Q8hPEBX7h/TK52EayIDurkbi0ZXZFsbAEpG97HJRgmTx+tICGE lCvlWrFaheyN2vCP4qZCLM2U9CPNc/5RzLPcE9ceZCqgdyWliGLOkuRdsOz6o3J4ilD+ TbQcxAbbz+3lTN4E+LeC2njmuDn5Cn6HBynXRNM7hJygrqlMJHf3cKhdC3wl51iVwJOp 0ejiDVcQHPks45Uwbw/G/4tvBL/Muq1Ge9wW11L6vmzrxnOckDr79bjZ6ilLKC8GJuHB DezA== 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=esB5mepgr5nyvG9nrRmGTzzqc+m2Rur7gox62JB2JxA=; b=gBmZAzPWHFFw4H27IfKgUQaGYdp1os6V8L3uzpoRydj79usOrunuXdUspSCWAzBABB QU+aMHjx2UulIiE4WUJr//096z1oL/OuraV+7XHja4pCrPnCaMqO+k2MiZMxcwOjRo6J vPcPug0BHt+NurW/nZDx1Ox/xXIqpmN2gaUOe9M9SND0S07cCV6zJVSwlwG6AzEL+kQl A7iN/D6laFhrSnMQklknmjdSSRpkt3h81D+o60u6CURsgS6MMP1EmceT7PVbyJKjlpWc LjNJH499NDnztSb/H2nWCXfyQ0iKA+fydOiXkHQVKL5hkVSCPJMqPBz34G7/64/WGqr2 koKQ== X-Gm-Message-State: AOAM532/l5fr+roP00gFCx9yiba5gA7IKw8E9c8EOfhTf0Qcws1u72uK P9Q8wbS7OWTycyL3lptdjYU= X-Received: by 2002:a05:6402:5106:b0:419:45cd:7ab0 with SMTP id m6-20020a056402510600b0041945cd7ab0mr38052671edd.116.1649761136889; Tue, 12 Apr 2022 03:58:56 -0700 (PDT) Received: from localhost.localdomain (i130160.upc-i.chello.nl. [62.195.130.160]) by smtp.googlemail.com with ESMTPSA id f1-20020a056402194100b00416b174987asm16986370edz.35.2022.04.12.03.58.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 03:58:56 -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 , Colin Ian King , Arnd Bergmann , Michael Walle , Christophe JAILLET , 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 v2 04/18] net: dsa: sja1105: use list_add_tail(pos) instead of list_add(pos->prev) Date: Tue, 12 Apr 2022 12:58:16 +0200 Message-Id: <20220412105830.3495846-5-jakobkoschel@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220412105830.3495846-1-jakobkoschel@gmail.com> References: <20220412105830.3495846-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,T_SCC_BODY_TEXT_LINE 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 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: Jakob Koschel Signed-off-by: Vladimir Oltean --- 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