Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp870080rwb; Thu, 12 Jan 2023 13:31:12 -0800 (PST) X-Google-Smtp-Source: AMrXdXueVu7pdLO3MpwZzA+3xVKYiQhWxebmPO/5EKmGFCuudShXovOkztQHAnA23WwTqzg6yIvc X-Received: by 2002:a17:906:281b:b0:7c1:5863:f8c4 with SMTP id r27-20020a170906281b00b007c15863f8c4mr63553311ejc.21.1673559071837; Thu, 12 Jan 2023 13:31:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673559071; cv=none; d=google.com; s=arc-20160816; b=Vtenu8JGxyXVJfc4lYKpHyui71QjnU0UCgW2rTtjiLl/fEIGuOIT9uNc3DTLM8d/33 a2SKR7kErzZQw2Ar7Jv6yzAl8uiyvzrO9j0D2DMEG3r4kzYpKsn8J6pyQ5m/4WFCYYg5 4aDfOiCsT6UxUR5sMjbMZilxDT7YqnzwTjSgyaiLtfa34/+gzH+2GJR+C2u5Jw/CgfWA 4MWPWOzstPqqD48VTDh+3vmkFbRrHZkQf0aqb4QlD7l3BhS5VClfXCstOxq4t7F7j3Cr zZa8+fNPVRGCInwjwqNHzODesV0BQUVjcl52xbZmv769s2T8nkzCxEuumKgwp42k5uJp r2Bw== 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=Dz47vTH2YEVkAAjyYNZGCtk9r+L9045l46FXqQc4RyE=; b=UWS0tIqq2vuqiDBgoy71kzZ6HIcEqGEDCZjDlt9MXagBIYNQExnKhlYG1bS5TIF4/o yOuO+bSA4o+UD3fiTcFN6dCNmfjk+Sk+VLeh6lC1CFxOf0zJUXUh24AFRbAw/5wVoc+U OUFBdumrV3GPMeSKW7bAk+eoZYpXC0hLkIK7Dmf8Z3tBN2tgEuhGpEWsToCnP97DLFFD D1Fhu7CRpER+EdbgowBR1MvT5XsVsKtEbLOtPRpegT6DIX4Zc/7ZI9X+Jne+zpBlYn5U saiMykR39ZmVDonF8nMbj00iS8FQdvq30Ik6sQeJolnA9tWz8YxteTdxLKwDq5Neq/5Z lYHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=cCpRKYiO; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nb37-20020a1709071ca500b007c0e155ead2si20846423ejc.369.2023.01.12.13.30.37; Thu, 12 Jan 2023 13:31:11 -0800 (PST) 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=@microchip.com header.s=mchp header.b=cCpRKYiO; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234031AbjALUQC (ORCPT + 52 others); Thu, 12 Jan 2023 15:16:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240698AbjALUNk (ORCPT ); Thu, 12 Jan 2023 15:13:40 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4015DE8F; Thu, 12 Jan 2023 12:03:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1673553836; x=1705089836; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vwtYbLrA2oTbDo1HOHwwRKLWlo8AMmLQ34Uv58yjfws=; b=cCpRKYiOqBWUXHQsYKE+R3YQUFeTssBHMkIY9e2bGc4i7Is5uoXAFruO yUC2FwVtD3YWsm6gfzdv8ChVATMNCJlfruQLBIHwFT0SQ2Mz7PXwFcgJW kB7ra8spVWh1pJ6+pdo2cOa1z6W5SJJCwckQNnlFBO4zJm1uvwOJ2X8E8 iLVmPaTtoZSnmnm3H2cERWl+469WNGtqhjP8LIrxwTsZ3Hx8++IfGewB8 qaGia4sXFQyPAcWJhSS4+YbRt5edvToD7vYNCixUi8BUkNkf3xn0zi46H 3zyKKuAyWlVB7F9k3Igl83EPSgYEB0MQ7xRUZp3DgcsMiaoblowkUZruv A==; X-IronPort-AV: E=Sophos;i="5.97,211,1669100400"; d="scan'208";a="132084507" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 12 Jan 2023 13:03:55 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Thu, 12 Jan 2023 13:03:55 -0700 Received: from DEN-LT-70577.microchip.com (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Thu, 12 Jan 2023 13:03:52 -0700 From: Daniel Machon To: CC: , , , , , , , , , , , , , , , , Subject: [PATCH net-next 1/6] net: dcb: modify dcb_app_add to take list_head ptr as parameter Date: Thu, 12 Jan 2023 21:15:49 +0100 Message-ID: <20230112201554.752144-2-daniel.machon@microchip.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230112201554.752144-1-daniel.machon@microchip.com> References: <20230112201554.752144-1-daniel.machon@microchip.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS 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 In preparation to DCB rewrite. Modify dcb_app_add to take new struct list_head * as parameter, to make the used list configurable. This is done to allow reusing the function for adding rewrite entries to the rewrite table, which is introduced in a later patch. Signed-off-by: Daniel Machon --- net/dcb/dcbnl.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c index f9949e051f49..a76bdf6f0198 100644 --- a/net/dcb/dcbnl.c +++ b/net/dcb/dcbnl.c @@ -1955,7 +1955,8 @@ static struct dcb_app_type *dcb_app_lookup(const struct dcb_app *app, return NULL; } -static int dcb_app_add(const struct dcb_app *app, int ifindex) +static int dcb_app_add(struct list_head *list, const struct dcb_app *app, + int ifindex) { struct dcb_app_type *entry; @@ -1965,7 +1966,7 @@ static int dcb_app_add(const struct dcb_app *app, int ifindex) memcpy(&entry->app, app, sizeof(*app)); entry->ifindex = ifindex; - list_add(&entry->list, &dcb_app_list); + list_add(&entry->list, list); return 0; } @@ -2028,7 +2029,7 @@ int dcb_setapp(struct net_device *dev, struct dcb_app *new) } /* App type does not exist add new application type */ if (new->priority) - err = dcb_app_add(new, dev->ifindex); + err = dcb_app_add(&dcb_app_list, new, dev->ifindex); out: spin_unlock_bh(&dcb_lock); if (!err) @@ -2088,7 +2089,7 @@ int dcb_ieee_setapp(struct net_device *dev, struct dcb_app *new) goto out; } - err = dcb_app_add(new, dev->ifindex); + err = dcb_app_add(&dcb_app_list, new, dev->ifindex); out: spin_unlock_bh(&dcb_lock); if (!err) -- 2.34.1