From patchwork Tue Jan 17 08:55:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steen Hegelund X-Patchwork-Id: 13104340 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 6BC05C63797 for ; Tue, 17 Jan 2023 08:59:49 +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=Jy/sVGvtjmiSWpKvrwjJrQhQ8GPhGcmIySQwnUrSBRg=; b=MyMX2muXJM3Cn1 5zbrvvVenfkeHDwLgOgwGpgRwdOvQqQSrsdRwI5nu1NR49F6fWDxlvkjRpx78jGx4n+TdEIdzKIoM 93Hlu+JO3DWaNOSMIbMDYguz5BDqvQfd9+L60PnZzx6y0TKcv9zVwBJlrWOD150XHSnr0H2Csry+P f1lfvCW0W8iM0h8R7Vjq7d63zVWcVd2AQ0ssceT2OqNsRLK75p/sesRr0K+BMuBzcHwUCzphTu54A U8GLxn+l4TMaOJRyDOeRO3BipmvuCEtlk46fQbfz8hd0ua6S9Q/of2KtMsYTPCjvOO/EBBJEdspiv IwOP68/e56ipouXXtmLQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pHhnT-00DRG9-EZ; Tue, 17 Jan 2023 08:58:23 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pHhlN-00DQIc-3T for linux-arm-kernel@lists.infradead.org; Tue, 17 Jan 2023 08:56:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1673945773; x=1705481773; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qQNh55ZgYhBc07wztLVkY1eS2Pi1LYlQR49lenb2Z8M=; b=tsQiqlzfPXRZdexBcqSxUmKP7TzuKRYIlxu9hhZGsekIXYT0794Xmf7h j5PiOWnXh8mpWosN0bQUOPilkyUpU2ItReRIRBma1id/VcBjGWvvCCHxL XwdHUzVeDJTNG7gWTZgtiUr+sm9wGcNIkdu9iq7O/jaXZAqauS2hvg3dh PSdErVIRq3KvNiSqbzdIxQTzEm/LmVd86eNolJnhUUEwHCHM3cvPhrg9z qL+FkYWJcnhourE5w1GD2Y5FtYnkntPkTqivmFiOdwKofmtOLuo4cVvhm hiuslVj6IvGuhg+NggnK3mitCJNXc0VQxTEbqkMfF9Zcd1szk18Peq184 Q==; X-IronPort-AV: E=Sophos;i="5.97,222,1669100400"; d="scan'208";a="208096731" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 17 Jan 2023 01:56:10 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 17 Jan 2023 01:56:09 -0700 Received: from den-dk-m31857.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; Tue, 17 Jan 2023 01:56:06 -0700 From: Steen Hegelund To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni CC: Steen Hegelund , , Randy Dunlap , "Casper Andersson" , Russell King , Wan Jiabing , "Nathan Huckleberry" , , , , "Steen Hegelund" , Daniel Machon , Horatiu Vultur , Lars Povlsen , Dan Carpenter , Michael Walle Subject: [PATCH net-next 5/5] net: microchip: sparx5: Add lock initialization to the KUNIT tests Date: Tue, 17 Jan 2023 09:55:44 +0100 Message-ID: <20230117085544.591523-6-steen.hegelund@microchip.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230117085544.591523-1-steen.hegelund@microchip.com> References: <20230117085544.591523-1-steen.hegelund@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230117_005613_227648_41B12D78 X-CRM114-Status: UNSURE ( 9.70 ) X-CRM114-Notice: Please train this message. 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 Ensure that the KUNIT tests lock instance is initialized before the test is executed. Signed-off-by: Steen Hegelund --- drivers/net/ethernet/microchip/vcap/vcap_api_debugfs_kunit.c | 1 + drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/net/ethernet/microchip/vcap/vcap_api_debugfs_kunit.c b/drivers/net/ethernet/microchip/vcap/vcap_api_debugfs_kunit.c index 9211cb453a3d..cbf7e0f110b8 100644 --- a/drivers/net/ethernet/microchip/vcap/vcap_api_debugfs_kunit.c +++ b/drivers/net/ethernet/microchip/vcap/vcap_api_debugfs_kunit.c @@ -246,6 +246,7 @@ static void vcap_test_api_init(struct vcap_admin *admin) INIT_LIST_HEAD(&admin->list); INIT_LIST_HEAD(&admin->rules); INIT_LIST_HEAD(&admin->enabled); + mutex_init(&admin->lock); list_add_tail(&admin->list, &test_vctrl.list); memset(test_updateaddr, 0, sizeof(test_updateaddr)); test_updateaddridx = 0; diff --git a/drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c b/drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c index 22690c669028..82981176218c 100644 --- a/drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c +++ b/drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c @@ -236,6 +236,7 @@ static void vcap_test_api_init(struct vcap_admin *admin) INIT_LIST_HEAD(&admin->list); INIT_LIST_HEAD(&admin->rules); INIT_LIST_HEAD(&admin->enabled); + mutex_init(&admin->lock); list_add_tail(&admin->list, &test_vctrl.list); memset(test_updateaddr, 0, sizeof(test_updateaddr)); test_updateaddridx = 0;