Received: by 2002:ac8:1418:0:b0:3ab:920c:4c8b with SMTP id k24csp3126598qtj; Wed, 18 Jan 2023 13:29:17 -0800 (PST) X-Google-Smtp-Source: AMrXdXsbCwIdDFB5cGls/TIQrvRvoWDOJOl0+DUbLhWpOMGrofamOANATAAHcO3Be9F6EMHYoLFs X-Received: by 2002:a17:902:d64e:b0:194:8d95:a4dc with SMTP id y14-20020a170902d64e00b001948d95a4dcmr7659358plh.65.1674077357026; Wed, 18 Jan 2023 13:29:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674077357; cv=none; d=google.com; s=arc-20160816; b=hp98v58xZzn1quT8Yaux4taFupiCQwMVIaeksfj1smNl7lVkvYbPceuVrtxnhEO1TP iAeq1sXa3Y4i9T/uQg0238Kl8V9Ten7Lsh01XYHChXiPiauOnkquGkggEgKLk8K7KcDt Z0TdjqAZ3LPHJuiBiooMuxT7LtXGEqq6j8ynQtSQ4GsemLaQx1x9RA0jCyq/n5pplCJP HZPKdDKT/KwlULZJ5IsDy+rkwznWud/nRLRbMxarIJ8zjYe0nOkR+ZuBxX/6w+KBLX8h M1mInoirQkBg3CS3fKH+YMm1aQ6MumgUxTcJxaGex70USKM2kfN45MNlwZ4SmsjwerWe s9Ww== 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=GBH9y8+ahezf7AxLb9/kCRV0ymaTmS0UbIOSHV5gcmJKgNfaBFkvttK73/yJQjj4Qu 1R0+kBACFtZheoZj/Cn7493diW+Hp34HIGxCUYSuJCVtyU2Elah0wbu7pu26wxOEdiQv nddCAH1tAxZV2HPtXeVnNj20Ng8EXMwXqEd3pAisw3UylD0ycNykgBX0cjhzmeTDJjLN uO/qQ4N1CpOV+UOwPEWjdGeDFnskWCe/Bf4624iHinJdI/AojK2DzS4p58pf58YbattW y7/M/pIQE8krkY0y7TrqMTOBvP+98s5Q99f9v9do0eu2f68Bd/uZrd7x8o3KrsXb2CcK Z89A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=MQV7F+wY; 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 ja14-20020a170902efce00b0018f9d68f452si16465786plb.195.2023.01.18.13.29.10; Wed, 18 Jan 2023 13:29:17 -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=MQV7F+wY; 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 S230345AbjARVJE (ORCPT + 45 others); Wed, 18 Jan 2023 16:09:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230198AbjARVIz (ORCPT ); Wed, 18 Jan 2023 16:08:55 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 706AE58961; Wed, 18 Jan 2023 13:08:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1674076135; x=1705612135; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vwtYbLrA2oTbDo1HOHwwRKLWlo8AMmLQ34Uv58yjfws=; b=MQV7F+wYXY5Zbe2dVTEv/jGjCpzSTJ1GMT6M4cY8DrqGe/A5vFTrZIm0 hGnHHvGCmMBQckCwl2ezmCcIJ1eUIsxnQrAjk5Enm0wxeGcVOee6pL2J8 a6cjYd6UwkNJZLNlQdEPD+h/oAur8WWxGaVf81Z+JsIWJMt89s33P66Kc JnShQsjeprHOPyLgOsr3xOryn/AEzvMNZgDkwxiS52IEwkgzXczc0hmrV 80UOQjtYBft/CO9xmw36JVZ3XCJQKn70YE+G0Xulkr6ztp7+krPEDzufR N2ajZE2B/hd+zjTcKR36TUk/gLPawr/qVEgZ7SDHcI01zJOUEPnqy2HPb Q==; X-IronPort-AV: E=Sophos;i="5.97,226,1669100400"; d="scan'208";a="197370502" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 18 Jan 2023 14:08:55 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Wed, 18 Jan 2023 14:08:48 -0700 Received: from DEN-LT-70577.microchip.com (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Wed, 18 Jan 2023 14:08:44 -0700 From: Daniel Machon To: CC: , , , , , , , , , , , , , , , , Subject: [PATCH net-next v3 1/6] net: dcb: modify dcb_app_add to take list_head ptr as parameter Date: Wed, 18 Jan 2023 22:08:25 +0100 Message-ID: <20230118210830.2287069-2-daniel.machon@microchip.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230118210830.2287069-1-daniel.machon@microchip.com> References: <20230118210830.2287069-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