Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp3388526rwb; Mon, 16 Jan 2023 07:24:27 -0800 (PST) X-Google-Smtp-Source: AMrXdXuuFwVKroc17e+3gs0jSntqEFm5T+qQOAewNHnrLhntd4lfIohy6cebt/6u7XGxbG4bC81I X-Received: by 2002:a17:902:a5c1:b0:194:996e:3285 with SMTP id t1-20020a170902a5c100b00194996e3285mr2498plq.68.1673882667503; Mon, 16 Jan 2023 07:24:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673882667; cv=none; d=google.com; s=arc-20160816; b=NsTIu+n7i/jI0/0Hvp1rK9smR0rflZOUa6gERZSQTsHtwgByXb38hR/JZo5SfLPtc2 K3bI2YBucyCjuNZ0OlknS0Ja80w9wZ0704C2MB1sUyCdN2vB7zMSfOjCUKdX6zZN4qSm qhEjTWCRSClXSKSnmVIuMUbYtHWVIoP8n+sXdlxyOA/FYM83YueYZXS+q1duSIsWbXpL mow9P5E8BKdehf3ri+kxUaAsES2GCN4+JB/FRNhxRSf6a/hZhTR/MFsiNczPuysT0sg4 vUOGJpYWrLZ68Uh7UaK8optFh6r43YjzukIM9vcRbKRouttqUigLMt7E5HnDHeQ68WVL 3mWw== 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=kPR/r7quhsVdQZAF33O3BaGXBj0lkZ3bzFxDKB3aY9JnfDynFpQEPAPvvaz1pUeZrh YPWbFJJVOdJzKqWVuTgsi8SR2S3cKvkgta5E6adYdbxFL+gPVGEsns0wqZeE5cJRqV/b zPzpLGMoFG7JyKfz2unZqgN+EgLVryuxWe2HniVn9a5/hpV6ZiDsDOmMcBYfqR1ougTO RNSYDshplExeeG9r64Reh7PyvmxOpErWDfodBTPoIAJK1wzEhC3Seb+RBuuV1yB8HmVv tf9JdEeCoIk3tpJtUpPBuGuQToIrcR1UvyrT6nWyAKF42UTlhCRRFE6Exu8cq+t3S4/O UvkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b="YlLXbD/x"; 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 i13-20020a17090332cd00b00189db2e76f1si30781159plr.389.2023.01.16.07.24.21; Mon, 16 Jan 2023 07:24:27 -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="YlLXbD/x"; 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 S232988AbjAPPBF (ORCPT + 50 others); Mon, 16 Jan 2023 10:01:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232934AbjAPPAN (ORCPT ); Mon, 16 Jan 2023 10:00:13 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74406222CC; Mon, 16 Jan 2023 06:50:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1673880630; x=1705416630; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vwtYbLrA2oTbDo1HOHwwRKLWlo8AMmLQ34Uv58yjfws=; b=YlLXbD/xH8kgQTkLRr+JqKIq4TuKZXlbZIHxgkTu5vCDdLk4dwTsABmQ AeuYF6TBiiy6T0I1KMKlz4xfCjKe+GGFTLIr7xSGeJF6hGmvdJ3hElLEF 4XNPoK6pLIEzpHwSedvvoLSCcK1flJQ4APf8vwFUWkIggnIOrHLU72K8y LSPmKsDYmjApKJHoWfcsexl7ta3hAP7GbdSHuQrT0op44Eu9yy+vXdNxH hn/mDQg731eiNGebP//OejsTY+JjXE9gcm2hF+QQk98gFaqh4gW60BePD D/yfqeL3k7gSFIL3tRPGtUB6INH746et/jMqkI32RQWqq8DhKDM1wqzW0 A==; X-IronPort-AV: E=Sophos;i="5.97,221,1669100400"; d="scan'208";a="132549087" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 16 Jan 2023 07:49:09 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Mon, 16 Jan 2023 07:49:09 -0700 Received: from DEN-LT-70577.microchip.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Mon, 16 Jan 2023 07:49:05 -0700 From: Daniel Machon To: CC: , , , , , , , , , , , , , , , , Subject: [PATCH net-next v2 1/6] net: dcb: modify dcb_app_add to take list_head ptr as parameter Date: Mon, 16 Jan 2023 15:48:48 +0100 Message-ID: <20230116144853.2446315-2-daniel.machon@microchip.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230116144853.2446315-1-daniel.machon@microchip.com> References: <20230116144853.2446315-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