From patchwork Thu Nov 17 13:28:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Horatiu Vultur X-Patchwork-Id: 13046882 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 53BA0C4332F for ; Thu, 17 Nov 2022 13:25:30 +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: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:In-Reply-To:References: List-Owner; bh=jGt+a0RbjNGslCk42NErPx4ooUs7H4nXzaOMjfKnicM=; b=sAgoFTP/lILhPk SFSlxE8nYiM9vJyaRUaX2BppPIstY0uT8ZLxtLUMlUF3miDd2pVftSr7iIr4dmFwkn6qaPorW57AN 4HZ/+Xsr66cxtowLEqXawtZX+cwAj1zAc9tEGShwQhlcTLPBGV+HsPBkiyrR3uHdEXOGQA+D93Q/G GmfZ2pMeBdAwuXnSyOdxAQlHYMQkQUp/jiISEzRx5JLjAQu7y5jSQ8jeQXx79MAB0CTobZfOZHyIN m35hpGR5VH7qyxLM/JIhCeErmeRCL/8F7IyzZ7CMF8j+49Vv4iR43C7anviXRsstgJLinR67ZcoOq a1qxU7Y4nILplVELcDDA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ovesN-00EE5D-GC; Thu, 17 Nov 2022 13:24:19 +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 1oves1-00EDlp-J8 for linux-arm-kernel@lists.infradead.org; Thu, 17 Nov 2022 13:23:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1668691437; x=1700227437; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Mva3irCZtbU/n4ixfR3IHzyqvcagg8EtGCdeTzm6YVk=; b=pM6ucBSRpoD1kpqqdnSuoYqOIEM47+daC8+VSTFAMSb9k4+j05rR+9GJ JusdeztNjI290KgcCatAOEvjs+rdCgWe0GA7UQj8eZuiV0fglgpQwQ9J3 XbB4XX55Bik/KoHIsRWQrOPwtnJQ/QWVcevLXnUIhtNKEMS/6BW37Qsf0 SEbrZaD4P5mtt9onqDYDCYXMPbgrGRRYYSfliexnzGqW4sN61pEl8It7i eSw1rCuEAnCVW060h2X0AKSPJhrX222/WMlJoFIhkMOsFk4ssJnLbVVT5 E1VGBDVRjU7dPg2jErr29kbKf6GErFZPGlsrYTSIJ5S2Oa7hEeIpPyjtU w==; X-IronPort-AV: E=Sophos;i="5.96,171,1665471600"; d="scan'208";a="189423565" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 17 Nov 2022 06:23:56 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) 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.12; Thu, 17 Nov 2022 06:23:56 -0700 Received: from soft-dev3-1.microsemi.net (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Thu, 17 Nov 2022 06:23:54 -0700 From: Horatiu Vultur To: , , CC: , , , , , , , , Horatiu Vultur Subject: [PATCH net-next] net: microchip: sparx5: kunit test: Fix compile warnings. Date: Thu, 17 Nov 2022 14:28:12 +0100 Message-ID: <20221117132812.2105718-1-horatiu.vultur@microchip.com> X-Mailer: git-send-email 2.38.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221117_052357_738231_434FA571 X-CRM114-Status: UNSURE ( 9.44 ) 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 When VCAP_KUNIT_TEST is enabled the following warnings are generated: drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c:257:34: warning: Using plain integer as NULL pointer drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c:258:41: warning: Using plain integer as NULL pointer drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c:342:23: warning: Using plain integer as NULL pointer drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c:359:23: warning: Using plain integer as NULL pointer drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c:1327:34: warning: Using plain integer as NULL pointer drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c:1328:41: warning: Using plain integer as NULL pointer Therefore fix this. Fixes: dccc30cc4906 ("net: microchip: sparx5: Add KUNIT test of counters and sorted rules") Fixes: c956b9b318d9 ("net: microchip: sparx5: Adding KUNIT tests of key/action values in VCAP API") Fixes: 67d637516fa9 ("net: microchip: sparx5: Adding KUNIT test for the VCAP API") Signed-off-by: Horatiu Vultur --- drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c b/drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c index 6858e44ce4a55..194734cadf8b4 100644 --- a/drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c +++ b/drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c @@ -254,8 +254,8 @@ test_vcap_xn_rule_creator(struct kunit *test, int cid, enum vcap_user user, u16 priority, int id, int size, int expected_addr) { - struct vcap_rule *rule = 0; - struct vcap_rule_internal *ri = 0; + struct vcap_rule *rule; + struct vcap_rule_internal *ri; enum vcap_keyfield_set keyset = VCAP_KFS_NO_VALUE; enum vcap_actionfield_set actionset = VCAP_AFS_NO_VALUE; int ret; @@ -339,7 +339,7 @@ static void vcap_api_set_bit_1_test(struct kunit *test) .sw_width = 52, .reg_idx = 1, .reg_bitpos = 20, - .tg = 0 + .tg = NULL, }; u32 stream[2] = {0}; @@ -356,7 +356,7 @@ static void vcap_api_set_bit_0_test(struct kunit *test) .sw_width = 52, .reg_idx = 2, .reg_bitpos = 11, - .tg = 0 + .tg = NULL, }; u32 stream[3] = {~0, ~0, ~0}; @@ -1324,8 +1324,8 @@ static void vcap_api_encode_rule_test(struct kunit *test) .actionstream = actdata, }, }; - struct vcap_rule *rule = 0; - struct vcap_rule_internal *ri = 0; + struct vcap_rule *rule; + struct vcap_rule_internal *ri; int vcap_chain_id = 10005; enum vcap_user user = VCAP_USER_VCAP_UTIL; u16 priority = 10;