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: 44566 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1643837wrn; Tue, 17 Jan 2023 01:01:08 -0800 (PST) X-Google-Smtp-Source: AMrXdXviUtXTOO9PlPPf3cuxWVMvRuedcm/BMs3qaztFYmB5adMohC8yb190stQkzvgENaxcnKkE X-Received: by 2002:a17:902:a714:b0:189:ba1f:b168 with SMTP id w20-20020a170902a71400b00189ba1fb168mr2848125plq.1.1673946068518; Tue, 17 Jan 2023 01:01:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673946068; cv=none; d=google.com; s=arc-20160816; b=jvPFJhSULqQQIqgpfA/2SA4ZvQwKH+2qvTySvMMvwhwjQj9QiqvcZMPPMynQ1tuNDZ hm4QqzX1BaB0c/nCs2YjtqgA2BGC7cSIMOLnTwp+Yt9Zv17wqgBvC/vbKak8fMoJ8/Kf CHUl8Hvu7mhNpwNAhnD5Wn65NLWpWQosHVmerzLAUlSPmVhrKTmhchiHqRQg6QUHiUua YWBC/LXLNxF+LSk131C9Jz6V4E+T/qK/wtaX07iNZRoc6bh38MSL6cRo0fFtSZqI1rKm cezkZCpGyqoGBFdS+3Qxj5yL0ho40muz2kna+0RasGLR60tAl61gkIxLtCLYE7cWZGLR ITBg== 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=7SNRLQ28Mtiyl7/4saiYiCkiDayp+Xg11zc6TxSxsGg=; b=VawQF+8k300U7wCal/g238Kx6PXxkYRiz0rChjVk02P90mZ5pVwCDMjMxevmj2puhQ 80q4/OxoBe9zaFC4CWTX9s6e/Us3xNEhYsgOS8QlzZi5Sos8UkrZMCJZd1PATI0wrs0q p4E2IVE6c8nJ4OsQhrNlQ8VIZZPwS5/HL6oi7JkJESoPyV/SI8xAtcvxawbhql5DufYN XTkNg6ufS0pE6nhinWAIGO36/K8QZh4tsPwqos2xv7/1iWrWwTq8xUWMdzBPWzNqG/VV 82xjUpgtsKKWPgrEEc207izb1lExne0igTJNkfPHOfp6t7rDRvfggIoP8NeR/fCQKJnX St2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=JD1sTN5y; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a4-20020a170902ecc400b00189aab9cdbcsi34082700plh.605.2023.01.17.01.00.55; Tue, 17 Jan 2023 01:01:08 -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=JD1sTN5y; 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 S235796AbjAQI5L (ORCPT + 99 others); Tue, 17 Jan 2023 03:57:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234517AbjAQI4c (ORCPT ); Tue, 17 Jan 2023 03:56:32 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFB4410ABE; Tue, 17 Jan 2023 00:56:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1673945772; x=1705481772; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qQNh55ZgYhBc07wztLVkY1eS2Pi1LYlQR49lenb2Z8M=; b=JD1sTN5yeQN/UWlraeVKKZpD/TBSnMbmXVrXhlXo4tI+jGy5H0R3rnHt 4njkp4u9GitCsWZ82Do+S5t3cLteAZoOb8mOQm+HUx2bjc0HFxaypOBvq w67rKW+kWN2UT1tG6kr4Oct1XXs6/Uwx5QqEMMJWMWleA3YS95GdexDuH sivZixqCowzTy/dSsUfRRwcYhUyHudOrx7QCv+d9P9mem/8OI6dDgo/w8 Oc2K6Q4CxM3QVdHkq0hGL7GNgJouz2U/0OS7cFkdtz7KT5gZe50wYfcsQ gWbLkAgxggtbTfFisGSNfQXrWlSC2/D8q6hvotIURchyxpE8cwb4kSxn1 g==; 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-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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755259672816888502?= X-GMAIL-MSGID: =?utf-8?q?1755259672816888502?= 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;