From patchwork Thu Jan 12 20:15:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Machon X-Patchwork-Id: 13099369 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EEBAEC61DB3 for ; Thu, 12 Jan 2023 20:30:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pySUTahyKb2ml+ZeraclQGuFFPccFEvXHjhFHRxwurM=; b=2ezN4y/aKS27+G TvxtAdj88FQJ3RbnaDxT80YQALUhIeF1UMGVP45/EBxJdk87CBDJhSoPYUhdsBg82usABVO5DgJT/ xEE0JRtHnrwWsN6U/nvoUZymF4Et2zfgK9Q++fYhyFU/NQdUTn50zr+tlU8sRNaIBEoyFAoXoD1LZ SVTNCtPJr8e2REbBK9iGrxUnLuJ2sA9rl2nQlaYioIG3yl+DYsBpSbvypRzIbUElGfqiiiTKbBQbD vS+KX8qWOiCY9UFEieaBhrUsft/ciptJjLT6IKrWWV/dF0gNd8lU21N91gHY1yE5AWoQJb/txahgp y0rx2nES2WJg9ZWQ/6oA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pG4CM-00GvD6-Ko; Thu, 12 Jan 2023 20:29:19 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pG3ns-00Gjzu-Hp for linux-arm-kernel@lists.infradead.org; Thu, 12 Jan 2023 20:04:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1673553840; x=1705089840; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vwtYbLrA2oTbDo1HOHwwRKLWlo8AMmLQ34Uv58yjfws=; b=suxeJMaPp7JV5Y5cj7G6fLWaBGPxRZWCiTuS2Y+7i68VxZ5xjqNfpMy9 J4kHxr/yrXpjTyt80Ao5i1SUQwE+GFWu8jPyJdwBxSB7sMSgGZBoYa8qo wfC1w1fABLdCFnWFpfXTcNSDoqtltTNYiCRHVe5Y1Be0Yg3orCZSYgRMB aUlTWrX5AMeyOZToaRj3zuIvta2G2ud0ByLVJQD96Vi+LF7VK+fSFKFSz fAW7jMcNEFRN1nV1Dx1N7A71mOFgrQyMf7Hk8fbCUEQ6M9jHyODL3Kp3Z +Vncoajx8CgSy+vo+Eg8GcRMaSdg5lYwAORgrh2khQjn7h5SLGFaXV8ch 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230112_120400_735186_7EF5BB5D X-CRM114-Status: GOOD ( 11.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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)