From patchwork Tue Feb 8 11:45:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 540974 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8FE2CC433F5 for ; Tue, 8 Feb 2022 11:51:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358514AbiBHLu6 (ORCPT ); Tue, 8 Feb 2022 06:50:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358035AbiBHLu2 (ORCPT ); Tue, 8 Feb 2022 06:50:28 -0500 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0786FC0048E5 for ; Tue, 8 Feb 2022 03:45:48 -0800 (PST) Received: by mail-ed1-x530.google.com with SMTP id w14so36918186edd.10 for ; Tue, 08 Feb 2022 03:45:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MonTwosc2l22/nLIwyPkP8TEQPCkDI6UQhawDn7ndXQ=; b=X1JeIxvrrWvv7e+rmQ/303+7ax0fz9G+FQZVSTF8107DdPHCcwj5pYylPIfWPtyPDV s2J/YYcy62bM32CZnWRvkSoxhaIdLVLG6dMMxXmOdM1VR0yWVUvysoTDM23Gai2HVV1N V4KTsirUxpxRumZ49fdQ6b7e2GiWp+/Hcntv4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MonTwosc2l22/nLIwyPkP8TEQPCkDI6UQhawDn7ndXQ=; b=XQ+sOR1TzBGQfpngZcEHygSwX3jLXbRJt2o0hVv9dFxYrRb7Yp4wJtH1RZOV9xoHRc Kj7nPz/R1N7qfs6+//QZPrWkzUVqLK726R/L7K8E7nmcRzAhhQRgu/rTBnt8ZujZuPkU qArSXEFCClXaHoLkz1kY3MWBgBcJQqXbEKYJKdKZkPbH0DVc1yIeTKTJvPtcoe4eTRCB wogNBapA5h+l9Co7EEj4obakwvuqaEWXmbU0XVcVcBkdt85qVTUQHZv8ydJjrnZfnWXI vS7QGqrQ1/VP5VnvDLG6bFuD0pPxtE3+BSCbTHtn+v48qiyI+ss1MGnSUnPMd4YYnrwl PDYw== X-Gm-Message-State: AOAM53386SN6BGCqNRenxbTlYX/mh6DDRpfeNjlxAO2QtIeJJLyhEcbL 5DGtmS8dOGeQJrJWRsGDdIl4gQ== X-Google-Smtp-Source: ABdhPJwWTEasv8X94W2sypR7r62yuGY+V5LW+LfNnG1KW4/Jtm0LnfO7DXadUZ0EsxMlPmpg1yff8Q== X-Received: by 2002:a05:6402:3514:: with SMTP id b20mr4051494edd.65.1644320746487; Tue, 08 Feb 2022 03:45:46 -0800 (PST) Received: from alco.corp.google.com ([2620:0:1059:10:5d0f:d242:ddbf:a8a6]) by smtp.gmail.com with ESMTPSA id y2sm4151902edt.54.2022.02.08.03.45.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 03:45:46 -0800 (PST) From: Ricardo Ribalda To: kunit-dev@googlegroups.com, kasan-dev@googlegroups.com, linux-kselftest@vger.kernel.org, Brendan Higgins , Mika Westerberg , Daniel Latypov Cc: Ricardo Ribalda Subject: [PATCH v4 3/6] thunderbolt: test: use NULL macros Date: Tue, 8 Feb 2022 12:45:38 +0100 Message-Id: <20220208114541.2046909-3-ribalda@chromium.org> X-Mailer: git-send-email 2.35.0.263.gb82422642f-goog In-Reply-To: <20220208114541.2046909-1-ribalda@chromium.org> References: <20220208114541.2046909-1-ribalda@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Replace the NULL checks with the more specific and idiomatic NULL macros. Reviewed-by: Daniel Latypov Signed-off-by: Ricardo Ribalda --- drivers/thunderbolt/test.c | 130 ++++++++++++++++++------------------- 1 file changed, 65 insertions(+), 65 deletions(-) diff --git a/drivers/thunderbolt/test.c b/drivers/thunderbolt/test.c index 1f69bab236ee..f5bf8d659db4 100644 --- a/drivers/thunderbolt/test.c +++ b/drivers/thunderbolt/test.c @@ -796,9 +796,9 @@ static void tb_test_path_not_connected(struct kunit *test) up = &dev2->ports[9]; path = tb_path_alloc(NULL, down, 8, up, 8, 0, "PCIe Down"); - KUNIT_ASSERT_TRUE(test, path == NULL); + KUNIT_ASSERT_NULL(test, path); path = tb_path_alloc(NULL, down, 8, up, 8, 1, "PCIe Down"); - KUNIT_ASSERT_TRUE(test, path == NULL); + KUNIT_ASSERT_NULL(test, path); } struct hop_expectation { @@ -847,7 +847,7 @@ static void tb_test_path_not_bonded_lane0(struct kunit *test) up = &dev->ports[9]; path = tb_path_alloc(NULL, down, 8, up, 8, 0, "PCIe Down"); - KUNIT_ASSERT_TRUE(test, path != NULL); + KUNIT_ASSERT_NOT_NULL(test, path); KUNIT_ASSERT_EQ(test, path->path_length, ARRAY_SIZE(test_data)); for (i = 0; i < ARRAY_SIZE(test_data); i++) { const struct tb_port *in_port, *out_port; @@ -909,7 +909,7 @@ static void tb_test_path_not_bonded_lane1(struct kunit *test) out = &dev->ports[13]; path = tb_path_alloc(NULL, in, 9, out, 9, 1, "Video"); - KUNIT_ASSERT_TRUE(test, path != NULL); + KUNIT_ASSERT_NOT_NULL(test, path); KUNIT_ASSERT_EQ(test, path->path_length, ARRAY_SIZE(test_data)); for (i = 0; i < ARRAY_SIZE(test_data); i++) { const struct tb_port *in_port, *out_port; @@ -989,7 +989,7 @@ static void tb_test_path_not_bonded_lane1_chain(struct kunit *test) out = &dev3->ports[13]; path = tb_path_alloc(NULL, in, 9, out, 9, 1, "Video"); - KUNIT_ASSERT_TRUE(test, path != NULL); + KUNIT_ASSERT_NOT_NULL(test, path); KUNIT_ASSERT_EQ(test, path->path_length, ARRAY_SIZE(test_data)); for (i = 0; i < ARRAY_SIZE(test_data); i++) { const struct tb_port *in_port, *out_port; @@ -1069,7 +1069,7 @@ static void tb_test_path_not_bonded_lane1_chain_reverse(struct kunit *test) out = &host->ports[5]; path = tb_path_alloc(NULL, in, 9, out, 9, 1, "Video"); - KUNIT_ASSERT_TRUE(test, path != NULL); + KUNIT_ASSERT_NOT_NULL(test, path); KUNIT_ASSERT_EQ(test, path->path_length, ARRAY_SIZE(test_data)); for (i = 0; i < ARRAY_SIZE(test_data); i++) { const struct tb_port *in_port, *out_port; @@ -1161,7 +1161,7 @@ static void tb_test_path_mixed_chain(struct kunit *test) out = &dev4->ports[13]; path = tb_path_alloc(NULL, in, 9, out, 9, 1, "Video"); - KUNIT_ASSERT_TRUE(test, path != NULL); + KUNIT_ASSERT_NOT_NULL(test, path); KUNIT_ASSERT_EQ(test, path->path_length, ARRAY_SIZE(test_data)); for (i = 0; i < ARRAY_SIZE(test_data); i++) { const struct tb_port *in_port, *out_port; @@ -1253,7 +1253,7 @@ static void tb_test_path_mixed_chain_reverse(struct kunit *test) out = &host->ports[5]; path = tb_path_alloc(NULL, in, 9, out, 9, 1, "Video"); - KUNIT_ASSERT_TRUE(test, path != NULL); + KUNIT_ASSERT_NOT_NULL(test, path); KUNIT_ASSERT_EQ(test, path->path_length, ARRAY_SIZE(test_data)); for (i = 0; i < ARRAY_SIZE(test_data); i++) { const struct tb_port *in_port, *out_port; @@ -1297,7 +1297,7 @@ static void tb_test_tunnel_pcie(struct kunit *test) down = &host->ports[8]; up = &dev1->ports[9]; tunnel1 = tb_tunnel_alloc_pci(NULL, up, down); - KUNIT_ASSERT_TRUE(test, tunnel1 != NULL); + KUNIT_ASSERT_NOT_NULL(test, tunnel1); KUNIT_EXPECT_EQ(test, tunnel1->type, TB_TUNNEL_PCI); KUNIT_EXPECT_PTR_EQ(test, tunnel1->src_port, down); KUNIT_EXPECT_PTR_EQ(test, tunnel1->dst_port, up); @@ -1312,7 +1312,7 @@ static void tb_test_tunnel_pcie(struct kunit *test) down = &dev1->ports[10]; up = &dev2->ports[9]; tunnel2 = tb_tunnel_alloc_pci(NULL, up, down); - KUNIT_ASSERT_TRUE(test, tunnel2 != NULL); + KUNIT_ASSERT_NOT_NULL(test, tunnel2); KUNIT_EXPECT_EQ(test, tunnel2->type, TB_TUNNEL_PCI); KUNIT_EXPECT_PTR_EQ(test, tunnel2->src_port, down); KUNIT_EXPECT_PTR_EQ(test, tunnel2->dst_port, up); @@ -1349,7 +1349,7 @@ static void tb_test_tunnel_dp(struct kunit *test) out = &dev->ports[13]; tunnel = tb_tunnel_alloc_dp(NULL, in, out, 0, 0); - KUNIT_ASSERT_TRUE(test, tunnel != NULL); + KUNIT_ASSERT_NOT_NULL(test, tunnel); KUNIT_EXPECT_EQ(test, tunnel->type, TB_TUNNEL_DP); KUNIT_EXPECT_PTR_EQ(test, tunnel->src_port, in); KUNIT_EXPECT_PTR_EQ(test, tunnel->dst_port, out); @@ -1395,7 +1395,7 @@ static void tb_test_tunnel_dp_chain(struct kunit *test) out = &dev4->ports[14]; tunnel = tb_tunnel_alloc_dp(NULL, in, out, 0, 0); - KUNIT_ASSERT_TRUE(test, tunnel != NULL); + KUNIT_ASSERT_NOT_NULL(test, tunnel); KUNIT_EXPECT_EQ(test, tunnel->type, TB_TUNNEL_DP); KUNIT_EXPECT_PTR_EQ(test, tunnel->src_port, in); KUNIT_EXPECT_PTR_EQ(test, tunnel->dst_port, out); @@ -1445,7 +1445,7 @@ static void tb_test_tunnel_dp_tree(struct kunit *test) out = &dev5->ports[13]; tunnel = tb_tunnel_alloc_dp(NULL, in, out, 0, 0); - KUNIT_ASSERT_TRUE(test, tunnel != NULL); + KUNIT_ASSERT_NOT_NULL(test, tunnel); KUNIT_EXPECT_EQ(test, tunnel->type, TB_TUNNEL_DP); KUNIT_EXPECT_PTR_EQ(test, tunnel->src_port, in); KUNIT_EXPECT_PTR_EQ(test, tunnel->dst_port, out); @@ -1510,7 +1510,7 @@ static void tb_test_tunnel_dp_max_length(struct kunit *test) out = &dev12->ports[13]; tunnel = tb_tunnel_alloc_dp(NULL, in, out, 0, 0); - KUNIT_ASSERT_TRUE(test, tunnel != NULL); + KUNIT_ASSERT_NOT_NULL(test, tunnel); KUNIT_EXPECT_EQ(test, tunnel->type, TB_TUNNEL_DP); KUNIT_EXPECT_PTR_EQ(test, tunnel->src_port, in); KUNIT_EXPECT_PTR_EQ(test, tunnel->dst_port, out); @@ -1566,7 +1566,7 @@ static void tb_test_tunnel_usb3(struct kunit *test) down = &host->ports[12]; up = &dev1->ports[16]; tunnel1 = tb_tunnel_alloc_usb3(NULL, up, down, 0, 0); - KUNIT_ASSERT_TRUE(test, tunnel1 != NULL); + KUNIT_ASSERT_NOT_NULL(test, tunnel1); KUNIT_EXPECT_EQ(test, tunnel1->type, TB_TUNNEL_USB3); KUNIT_EXPECT_PTR_EQ(test, tunnel1->src_port, down); KUNIT_EXPECT_PTR_EQ(test, tunnel1->dst_port, up); @@ -1581,7 +1581,7 @@ static void tb_test_tunnel_usb3(struct kunit *test) down = &dev1->ports[17]; up = &dev2->ports[16]; tunnel2 = tb_tunnel_alloc_usb3(NULL, up, down, 0, 0); - KUNIT_ASSERT_TRUE(test, tunnel2 != NULL); + KUNIT_ASSERT_NOT_NULL(test, tunnel2); KUNIT_EXPECT_EQ(test, tunnel2->type, TB_TUNNEL_USB3); KUNIT_EXPECT_PTR_EQ(test, tunnel2->src_port, down); KUNIT_EXPECT_PTR_EQ(test, tunnel2->dst_port, up); @@ -1628,7 +1628,7 @@ static void tb_test_tunnel_port_on_path(struct kunit *test) out = &dev5->ports[13]; dp_tunnel = tb_tunnel_alloc_dp(NULL, in, out, 0, 0); - KUNIT_ASSERT_TRUE(test, dp_tunnel != NULL); + KUNIT_ASSERT_NOT_NULL(test, dp_tunnel); KUNIT_EXPECT_TRUE(test, tb_tunnel_port_on_path(dp_tunnel, in)); KUNIT_EXPECT_TRUE(test, tb_tunnel_port_on_path(dp_tunnel, out)); @@ -1685,7 +1685,7 @@ static void tb_test_tunnel_dma(struct kunit *test) port = &host->ports[1]; tunnel = tb_tunnel_alloc_dma(NULL, nhi, port, 8, 1, 8, 1); - KUNIT_ASSERT_TRUE(test, tunnel != NULL); + KUNIT_ASSERT_NOT_NULL(test, tunnel); KUNIT_EXPECT_EQ(test, tunnel->type, TB_TUNNEL_DMA); KUNIT_EXPECT_PTR_EQ(test, tunnel->src_port, nhi); KUNIT_EXPECT_PTR_EQ(test, tunnel->dst_port, port); @@ -1728,7 +1728,7 @@ static void tb_test_tunnel_dma_rx(struct kunit *test) port = &host->ports[1]; tunnel = tb_tunnel_alloc_dma(NULL, nhi, port, -1, -1, 15, 2); - KUNIT_ASSERT_TRUE(test, tunnel != NULL); + KUNIT_ASSERT_NOT_NULL(test, tunnel); KUNIT_EXPECT_EQ(test, tunnel->type, TB_TUNNEL_DMA); KUNIT_EXPECT_PTR_EQ(test, tunnel->src_port, nhi); KUNIT_EXPECT_PTR_EQ(test, tunnel->dst_port, port); @@ -1765,7 +1765,7 @@ static void tb_test_tunnel_dma_tx(struct kunit *test) port = &host->ports[1]; tunnel = tb_tunnel_alloc_dma(NULL, nhi, port, 15, 2, -1, -1); - KUNIT_ASSERT_TRUE(test, tunnel != NULL); + KUNIT_ASSERT_NOT_NULL(test, tunnel); KUNIT_EXPECT_EQ(test, tunnel->type, TB_TUNNEL_DMA); KUNIT_EXPECT_PTR_EQ(test, tunnel->src_port, nhi); KUNIT_EXPECT_PTR_EQ(test, tunnel->dst_port, port); @@ -1811,7 +1811,7 @@ static void tb_test_tunnel_dma_chain(struct kunit *test) nhi = &host->ports[7]; port = &dev2->ports[3]; tunnel = tb_tunnel_alloc_dma(NULL, nhi, port, 8, 1, 8, 1); - KUNIT_ASSERT_TRUE(test, tunnel != NULL); + KUNIT_ASSERT_NOT_NULL(test, tunnel); KUNIT_EXPECT_EQ(test, tunnel->type, TB_TUNNEL_DMA); KUNIT_EXPECT_PTR_EQ(test, tunnel->src_port, nhi); KUNIT_EXPECT_PTR_EQ(test, tunnel->dst_port, port); @@ -1857,7 +1857,7 @@ static void tb_test_tunnel_dma_match(struct kunit *test) port = &host->ports[1]; tunnel = tb_tunnel_alloc_dma(NULL, nhi, port, 15, 1, 15, 1); - KUNIT_ASSERT_TRUE(test, tunnel != NULL); + KUNIT_ASSERT_NOT_NULL(test, tunnel); KUNIT_ASSERT_TRUE(test, tb_tunnel_match_dma(tunnel, 15, 1, 15, 1)); KUNIT_ASSERT_FALSE(test, tb_tunnel_match_dma(tunnel, 8, 1, 15, 1)); @@ -1873,7 +1873,7 @@ static void tb_test_tunnel_dma_match(struct kunit *test) tb_tunnel_free(tunnel); tunnel = tb_tunnel_alloc_dma(NULL, nhi, port, 15, 1, -1, -1); - KUNIT_ASSERT_TRUE(test, tunnel != NULL); + KUNIT_ASSERT_NOT_NULL(test, tunnel); KUNIT_ASSERT_TRUE(test, tb_tunnel_match_dma(tunnel, 15, 1, -1, -1)); KUNIT_ASSERT_TRUE(test, tb_tunnel_match_dma(tunnel, 15, -1, -1, -1)); KUNIT_ASSERT_TRUE(test, tb_tunnel_match_dma(tunnel, -1, 1, -1, -1)); @@ -1885,7 +1885,7 @@ static void tb_test_tunnel_dma_match(struct kunit *test) tb_tunnel_free(tunnel); tunnel = tb_tunnel_alloc_dma(NULL, nhi, port, -1, -1, 15, 11); - KUNIT_ASSERT_TRUE(test, tunnel != NULL); + KUNIT_ASSERT_NOT_NULL(test, tunnel); KUNIT_ASSERT_TRUE(test, tb_tunnel_match_dma(tunnel, -1, -1, 15, 11)); KUNIT_ASSERT_TRUE(test, tb_tunnel_match_dma(tunnel, -1, -1, 15, -1)); KUNIT_ASSERT_TRUE(test, tb_tunnel_match_dma(tunnel, -1, -1, -1, 11)); @@ -1910,7 +1910,7 @@ static void tb_test_credit_alloc_legacy_not_bonded(struct kunit *test) down = &host->ports[8]; up = &dev->ports[9]; tunnel = tb_tunnel_alloc_pci(NULL, up, down); - KUNIT_ASSERT_TRUE(test, tunnel != NULL); + KUNIT_ASSERT_NOT_NULL(test, tunnel); KUNIT_ASSERT_EQ(test, tunnel->npaths, (size_t)2); path = tunnel->paths[0]; @@ -1943,7 +1943,7 @@ static void tb_test_credit_alloc_legacy_bonded(struct kunit *test) down = &host->ports[8]; up = &dev->ports[9]; tunnel = tb_tunnel_alloc_pci(NULL, up, down); - KUNIT_ASSERT_TRUE(test, tunnel != NULL); + KUNIT_ASSERT_NOT_NULL(test, tunnel); KUNIT_ASSERT_EQ(test, tunnel->npaths, (size_t)2); path = tunnel->paths[0]; @@ -1976,7 +1976,7 @@ static void tb_test_credit_alloc_pcie(struct kunit *test) down = &host->ports[8]; up = &dev->ports[9]; tunnel = tb_tunnel_alloc_pci(NULL, up, down); - KUNIT_ASSERT_TRUE(test, tunnel != NULL); + KUNIT_ASSERT_NOT_NULL(test, tunnel); KUNIT_ASSERT_EQ(test, tunnel->npaths, (size_t)2); path = tunnel->paths[0]; @@ -2010,7 +2010,7 @@ static void tb_test_credit_alloc_dp(struct kunit *test) out = &dev->ports[14]; tunnel = tb_tunnel_alloc_dp(NULL, in, out, 0, 0); - KUNIT_ASSERT_TRUE(test, tunnel != NULL); + KUNIT_ASSERT_NOT_NULL(test, tunnel); KUNIT_ASSERT_EQ(test, tunnel->npaths, (size_t)3); /* Video (main) path */ @@ -2053,7 +2053,7 @@ static void tb_test_credit_alloc_usb3(struct kunit *test) down = &host->ports[12]; up = &dev->ports[16]; tunnel = tb_tunnel_alloc_usb3(NULL, up, down, 0, 0); - KUNIT_ASSERT_TRUE(test, tunnel != NULL); + KUNIT_ASSERT_NOT_NULL(test, tunnel); KUNIT_ASSERT_EQ(test, tunnel->npaths, (size_t)2); path = tunnel->paths[0]; @@ -2087,7 +2087,7 @@ static void tb_test_credit_alloc_dma(struct kunit *test) port = &dev->ports[3]; tunnel = tb_tunnel_alloc_dma(NULL, nhi, port, 8, 1, 8, 1); - KUNIT_ASSERT_TRUE(test, tunnel != NULL); + KUNIT_ASSERT_NOT_NULL(test, tunnel); KUNIT_ASSERT_EQ(test, tunnel->npaths, (size_t)2); /* DMA RX */ @@ -2141,7 +2141,7 @@ static void tb_test_credit_alloc_dma_multiple(struct kunit *test) * remaining 1 and then we run out of buffers. */ tunnel1 = tb_tunnel_alloc_dma(NULL, nhi, port, 8, 1, 8, 1); - KUNIT_ASSERT_TRUE(test, tunnel1 != NULL); + KUNIT_ASSERT_NOT_NULL(test, tunnel1); KUNIT_ASSERT_EQ(test, tunnel1->npaths, (size_t)2); path = tunnel1->paths[0]; @@ -2159,7 +2159,7 @@ static void tb_test_credit_alloc_dma_multiple(struct kunit *test) KUNIT_EXPECT_EQ(test, path->hops[1].initial_credits, 14U); tunnel2 = tb_tunnel_alloc_dma(NULL, nhi, port, 9, 2, 9, 2); - KUNIT_ASSERT_TRUE(test, tunnel2 != NULL); + KUNIT_ASSERT_NOT_NULL(test, tunnel2); KUNIT_ASSERT_EQ(test, tunnel2->npaths, (size_t)2); path = tunnel2->paths[0]; @@ -2177,7 +2177,7 @@ static void tb_test_credit_alloc_dma_multiple(struct kunit *test) KUNIT_EXPECT_EQ(test, path->hops[1].initial_credits, 1U); tunnel3 = tb_tunnel_alloc_dma(NULL, nhi, port, 10, 3, 10, 3); - KUNIT_ASSERT_TRUE(test, tunnel3 == NULL); + KUNIT_ASSERT_NULL(test, tunnel3); /* * Release the first DMA tunnel. That should make 14 buffers @@ -2186,7 +2186,7 @@ static void tb_test_credit_alloc_dma_multiple(struct kunit *test) tb_tunnel_free(tunnel1); tunnel3 = tb_tunnel_alloc_dma(NULL, nhi, port, 10, 3, 10, 3); - KUNIT_ASSERT_TRUE(test, tunnel3 != NULL); + KUNIT_ASSERT_NOT_NULL(test, tunnel3); path = tunnel3->paths[0]; KUNIT_ASSERT_EQ(test, path->path_length, 2); @@ -2216,7 +2216,7 @@ static struct tb_tunnel *TB_TEST_PCIE_TUNNEL(struct kunit *test, down = &host->ports[8]; up = &dev->ports[9]; pcie_tunnel = tb_tunnel_alloc_pci(NULL, up, down); - KUNIT_ASSERT_TRUE(test, pcie_tunnel != NULL); + KUNIT_ASSERT_NOT_NULL(test, pcie_tunnel); KUNIT_ASSERT_EQ(test, pcie_tunnel->npaths, (size_t)2); path = pcie_tunnel->paths[0]; @@ -2246,7 +2246,7 @@ static struct tb_tunnel *TB_TEST_DP_TUNNEL1(struct kunit *test, in = &host->ports[5]; out = &dev->ports[13]; dp_tunnel1 = tb_tunnel_alloc_dp(NULL, in, out, 0, 0); - KUNIT_ASSERT_TRUE(test, dp_tunnel1 != NULL); + KUNIT_ASSERT_NOT_NULL(test, dp_tunnel1); KUNIT_ASSERT_EQ(test, dp_tunnel1->npaths, (size_t)3); path = dp_tunnel1->paths[0]; @@ -2283,7 +2283,7 @@ static struct tb_tunnel *TB_TEST_DP_TUNNEL2(struct kunit *test, in = &host->ports[6]; out = &dev->ports[14]; dp_tunnel2 = tb_tunnel_alloc_dp(NULL, in, out, 0, 0); - KUNIT_ASSERT_TRUE(test, dp_tunnel2 != NULL); + KUNIT_ASSERT_NOT_NULL(test, dp_tunnel2); KUNIT_ASSERT_EQ(test, dp_tunnel2->npaths, (size_t)3); path = dp_tunnel2->paths[0]; @@ -2320,7 +2320,7 @@ static struct tb_tunnel *TB_TEST_USB3_TUNNEL(struct kunit *test, down = &host->ports[12]; up = &dev->ports[16]; usb3_tunnel = tb_tunnel_alloc_usb3(NULL, up, down, 0, 0); - KUNIT_ASSERT_TRUE(test, usb3_tunnel != NULL); + KUNIT_ASSERT_NOT_NULL(test, usb3_tunnel); KUNIT_ASSERT_EQ(test, usb3_tunnel->npaths, (size_t)2); path = usb3_tunnel->paths[0]; @@ -2350,7 +2350,7 @@ static struct tb_tunnel *TB_TEST_DMA_TUNNEL1(struct kunit *test, nhi = &host->ports[7]; port = &dev->ports[3]; dma_tunnel1 = tb_tunnel_alloc_dma(NULL, nhi, port, 8, 1, 8, 1); - KUNIT_ASSERT_TRUE(test, dma_tunnel1 != NULL); + KUNIT_ASSERT_NOT_NULL(test, dma_tunnel1); KUNIT_ASSERT_EQ(test, dma_tunnel1->npaths, (size_t)2); path = dma_tunnel1->paths[0]; @@ -2380,7 +2380,7 @@ static struct tb_tunnel *TB_TEST_DMA_TUNNEL2(struct kunit *test, nhi = &host->ports[7]; port = &dev->ports[3]; dma_tunnel2 = tb_tunnel_alloc_dma(NULL, nhi, port, 9, 2, 9, 2); - KUNIT_ASSERT_TRUE(test, dma_tunnel2 != NULL); + KUNIT_ASSERT_NOT_NULL(test, dma_tunnel2); KUNIT_ASSERT_EQ(test, dma_tunnel2->npaths, (size_t)2); path = dma_tunnel2->paths[0]; @@ -2496,50 +2496,50 @@ static void tb_test_property_parse(struct kunit *test) struct tb_property *p; dir = tb_property_parse_dir(root_directory, ARRAY_SIZE(root_directory)); - KUNIT_ASSERT_TRUE(test, dir != NULL); + KUNIT_ASSERT_NOT_NULL(test, dir); p = tb_property_find(dir, "foo", TB_PROPERTY_TYPE_TEXT); KUNIT_ASSERT_TRUE(test, !p); p = tb_property_find(dir, "vendorid", TB_PROPERTY_TYPE_TEXT); - KUNIT_ASSERT_TRUE(test, p != NULL); + KUNIT_ASSERT_NOT_NULL(test, p); KUNIT_EXPECT_STREQ(test, p->value.text, "Apple Inc."); p = tb_property_find(dir, "vendorid", TB_PROPERTY_TYPE_VALUE); - KUNIT_ASSERT_TRUE(test, p != NULL); + KUNIT_ASSERT_NOT_NULL(test, p); KUNIT_EXPECT_EQ(test, p->value.immediate, 0xa27); p = tb_property_find(dir, "deviceid", TB_PROPERTY_TYPE_TEXT); - KUNIT_ASSERT_TRUE(test, p != NULL); + KUNIT_ASSERT_NOT_NULL(test, p); KUNIT_EXPECT_STREQ(test, p->value.text, "Macintosh"); p = tb_property_find(dir, "deviceid", TB_PROPERTY_TYPE_VALUE); - KUNIT_ASSERT_TRUE(test, p != NULL); + KUNIT_ASSERT_NOT_NULL(test, p); KUNIT_EXPECT_EQ(test, p->value.immediate, 0xa); p = tb_property_find(dir, "missing", TB_PROPERTY_TYPE_DIRECTORY); KUNIT_ASSERT_TRUE(test, !p); p = tb_property_find(dir, "network", TB_PROPERTY_TYPE_DIRECTORY); - KUNIT_ASSERT_TRUE(test, p != NULL); + KUNIT_ASSERT_NOT_NULL(test, p); network_dir = p->value.dir; KUNIT_EXPECT_TRUE(test, uuid_equal(network_dir->uuid, &network_dir_uuid)); p = tb_property_find(network_dir, "prtcid", TB_PROPERTY_TYPE_VALUE); - KUNIT_ASSERT_TRUE(test, p != NULL); + KUNIT_ASSERT_NOT_NULL(test, p); KUNIT_EXPECT_EQ(test, p->value.immediate, 0x1); p = tb_property_find(network_dir, "prtcvers", TB_PROPERTY_TYPE_VALUE); - KUNIT_ASSERT_TRUE(test, p != NULL); + KUNIT_ASSERT_NOT_NULL(test, p); KUNIT_EXPECT_EQ(test, p->value.immediate, 0x1); p = tb_property_find(network_dir, "prtcrevs", TB_PROPERTY_TYPE_VALUE); - KUNIT_ASSERT_TRUE(test, p != NULL); + KUNIT_ASSERT_NOT_NULL(test, p); KUNIT_EXPECT_EQ(test, p->value.immediate, 0x1); p = tb_property_find(network_dir, "prtcstns", TB_PROPERTY_TYPE_VALUE); - KUNIT_ASSERT_TRUE(test, p != NULL); + KUNIT_ASSERT_NOT_NULL(test, p); KUNIT_EXPECT_EQ(test, p->value.immediate, 0x0); p = tb_property_find(network_dir, "deviceid", TB_PROPERTY_TYPE_VALUE); @@ -2558,7 +2558,7 @@ static void tb_test_property_format(struct kunit *test) int ret, i; dir = tb_property_parse_dir(root_directory, ARRAY_SIZE(root_directory)); - KUNIT_ASSERT_TRUE(test, dir != NULL); + KUNIT_ASSERT_NOT_NULL(test, dir); ret = tb_property_format_dir(dir, NULL, 0); KUNIT_ASSERT_EQ(test, ret, ARRAY_SIZE(root_directory)); @@ -2566,7 +2566,7 @@ static void tb_test_property_format(struct kunit *test) block_len = ret; block = kunit_kzalloc(test, block_len * sizeof(u32), GFP_KERNEL); - KUNIT_ASSERT_TRUE(test, block != NULL); + KUNIT_ASSERT_NOT_NULL(test, block); ret = tb_property_format_dir(dir, block, block_len); KUNIT_EXPECT_EQ(test, ret, 0); @@ -2584,10 +2584,10 @@ static void compare_dirs(struct kunit *test, struct tb_property_dir *d1, int n1, n2, i; if (d1->uuid) { - KUNIT_ASSERT_TRUE(test, d2->uuid != NULL); + KUNIT_ASSERT_NOT_NULL(test, d2->uuid); KUNIT_ASSERT_TRUE(test, uuid_equal(d1->uuid, d2->uuid)); } else { - KUNIT_ASSERT_TRUE(test, d2->uuid == NULL); + KUNIT_ASSERT_NULL(test, d2->uuid); } n1 = 0; @@ -2606,9 +2606,9 @@ static void compare_dirs(struct kunit *test, struct tb_property_dir *d1, p2 = NULL; for (i = 0; i < n1; i++) { p1 = tb_property_get_next(d1, p1); - KUNIT_ASSERT_TRUE(test, p1 != NULL); + KUNIT_ASSERT_NOT_NULL(test, p1); p2 = tb_property_get_next(d2, p2); - KUNIT_ASSERT_TRUE(test, p2 != NULL); + KUNIT_ASSERT_NOT_NULL(test, p2); KUNIT_ASSERT_STREQ(test, &p1->key[0], &p2->key[0]); KUNIT_ASSERT_EQ(test, p1->type, p2->type); @@ -2616,14 +2616,14 @@ static void compare_dirs(struct kunit *test, struct tb_property_dir *d1, switch (p1->type) { case TB_PROPERTY_TYPE_DIRECTORY: - KUNIT_ASSERT_TRUE(test, p1->value.dir != NULL); - KUNIT_ASSERT_TRUE(test, p2->value.dir != NULL); + KUNIT_ASSERT_NOT_NULL(test, p1->value.dir); + KUNIT_ASSERT_NOT_NULL(test, p2->value.dir); compare_dirs(test, p1->value.dir, p2->value.dir); break; case TB_PROPERTY_TYPE_DATA: - KUNIT_ASSERT_TRUE(test, p1->value.data != NULL); - KUNIT_ASSERT_TRUE(test, p2->value.data != NULL); + KUNIT_ASSERT_NOT_NULL(test, p1->value.data); + KUNIT_ASSERT_NOT_NULL(test, p2->value.data); KUNIT_ASSERT_TRUE(test, !memcmp(p1->value.data, p2->value.data, p1->length * 4) @@ -2631,8 +2631,8 @@ static void compare_dirs(struct kunit *test, struct tb_property_dir *d1, break; case TB_PROPERTY_TYPE_TEXT: - KUNIT_ASSERT_TRUE(test, p1->value.text != NULL); - KUNIT_ASSERT_TRUE(test, p2->value.text != NULL); + KUNIT_ASSERT_NOT_NULL(test, p1->value.text); + KUNIT_ASSERT_NOT_NULL(test, p2->value.text); KUNIT_ASSERT_STREQ(test, p1->value.text, p2->value.text); break; @@ -2654,10 +2654,10 @@ static void tb_test_property_copy(struct kunit *test) int ret, i; src = tb_property_parse_dir(root_directory, ARRAY_SIZE(root_directory)); - KUNIT_ASSERT_TRUE(test, src != NULL); + KUNIT_ASSERT_NOT_NULL(test, src); dst = tb_property_copy_dir(src); - KUNIT_ASSERT_TRUE(test, dst != NULL); + KUNIT_ASSERT_NOT_NULL(test, dst); /* Compare the structures */ compare_dirs(test, src, dst); @@ -2667,7 +2667,7 @@ static void tb_test_property_copy(struct kunit *test) KUNIT_ASSERT_EQ(test, ret, ARRAY_SIZE(root_directory)); block = kunit_kzalloc(test, sizeof(root_directory), GFP_KERNEL); - KUNIT_ASSERT_TRUE(test, block != NULL); + KUNIT_ASSERT_NOT_NULL(test, block); ret = tb_property_format_dir(dst, block, ARRAY_SIZE(root_directory)); KUNIT_EXPECT_TRUE(test, !ret); From patchwork Tue Feb 8 11:45:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 540973 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 02D38C433EF for ; Tue, 8 Feb 2022 12:00:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358115AbiBHLu4 (ORCPT ); Tue, 8 Feb 2022 06:50:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237835AbiBHLu2 (ORCPT ); Tue, 8 Feb 2022 06:50:28 -0500 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBA3CC0048E7 for ; Tue, 8 Feb 2022 03:45:49 -0800 (PST) Received: by mail-ej1-x634.google.com with SMTP id k25so51016526ejp.5 for ; Tue, 08 Feb 2022 03:45:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=34ZmyfAhOEYAooNo/xPVmg8jgekAv0axuEgwIeZSupk=; b=VWm2iwcQQkpnk65R4SmtbJhKVg2unvzMEnXszek1LqS/doZylu/IDpFQZdvgLiwYYW pWHY9vi8CVqd83iGgSIaKS91N+vakWK2dRGD1WTg/SlBWDXbslVHHVE+OiixHPKErXAo YpAG91FdGfQvIf7PJZ/PKuuqYihmj1LkduWRU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=34ZmyfAhOEYAooNo/xPVmg8jgekAv0axuEgwIeZSupk=; b=OkhiPhxJA1hUG0Gr8OfAWRDQVWki7kSUTM/jMf/72G25hPzMelWEr9H43MZjIgnd9j tZeB1s0WURiuqg5wJ0qXni8cbGe38mpP9bx+WocJEcPRMm+qJ+Wio9tZM5IOtyJYEz4J AFHOoanw6bTspQXvXOW1VpNHTJwuRE5IyaIL337TKQ+QVOBB9KqYYzVwwNh64g5vrYgF xL95dOQ77BASY155ZLos4aYPs4tX10HVMF9kDPXbf0Thqf1Q7e1vuV3C55DCrbyYkBsc svtIqadk/0cbXwvoixWN+h6eUW4FlyraLuvUpzwpyPVUEeGXOoyWNeQM3gTiyKLq2XZG 8R1w== X-Gm-Message-State: AOAM530H6zyw/7EgYjD4C2LhGF5m2zrhNeV5OeZIWotjWLTBY2OEboON XiBPjVXFWLi2sMXPw9xk7if18g== X-Google-Smtp-Source: ABdhPJzcIOqW4k13lO6xxbSRnY8WUE4J6Y9D4oo2fT5T0AbhgJTCz5acugMKk2ASIOmm0WpCivu35A== X-Received: by 2002:a17:907:961b:: with SMTP id gb27mr3185433ejc.444.1644320748441; Tue, 08 Feb 2022 03:45:48 -0800 (PST) Received: from alco.corp.google.com ([2620:0:1059:10:5d0f:d242:ddbf:a8a6]) by smtp.gmail.com with ESMTPSA id y2sm4151902edt.54.2022.02.08.03.45.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 03:45:48 -0800 (PST) From: Ricardo Ribalda To: kunit-dev@googlegroups.com, kasan-dev@googlegroups.com, linux-kselftest@vger.kernel.org, Brendan Higgins , Mika Westerberg , Daniel Latypov Cc: Ricardo Ribalda Subject: [PATCH v4 5/6] mctp: test: Use NULL macros Date: Tue, 8 Feb 2022 12:45:40 +0100 Message-Id: <20220208114541.2046909-5-ribalda@chromium.org> X-Mailer: git-send-email 2.35.0.263.gb82422642f-goog In-Reply-To: <20220208114541.2046909-1-ribalda@chromium.org> References: <20220208114541.2046909-1-ribalda@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Replace the PTR_EQ NULL checks wit the NULL macros. More idiomatic and specific. Reviewed-by: Daniel Latypov Signed-off-by: Ricardo Ribalda --- net/mctp/test/route-test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/mctp/test/route-test.c b/net/mctp/test/route-test.c index 750f9f9b4daf..eb70b524c78e 100644 --- a/net/mctp/test/route-test.c +++ b/net/mctp/test/route-test.c @@ -361,7 +361,7 @@ static void mctp_test_route_input_sk(struct kunit *test) } else { KUNIT_EXPECT_NE(test, rc, 0); skb2 = skb_recv_datagram(sock->sk, 0, 1, &rc); - KUNIT_EXPECT_PTR_EQ(test, skb2, NULL); + KUNIT_EXPECT_NULL(test, skb2); } __mctp_route_test_fini(test, dev, rt, sock); @@ -430,7 +430,7 @@ static void mctp_test_route_input_sk_reasm(struct kunit *test) skb_free_datagram(sock->sk, skb2); } else { - KUNIT_EXPECT_PTR_EQ(test, skb2, NULL); + KUNIT_EXPECT_NULL(test, skb2); } __mctp_route_test_fini(test, dev, rt, sock); From patchwork Tue Feb 8 11:45:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 540975 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 67A98C433EF for ; Tue, 8 Feb 2022 11:50:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355842AbiBHLuz (ORCPT ); Tue, 8 Feb 2022 06:50:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358060AbiBHLu3 (ORCPT ); Tue, 8 Feb 2022 06:50:29 -0500 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2AB7C0048EC for ; Tue, 8 Feb 2022 03:45:51 -0800 (PST) Received: by mail-ej1-x62b.google.com with SMTP id m4so51555333ejb.9 for ; Tue, 08 Feb 2022 03:45:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HihT2WHm5CL9KTfiGWQaowQJbGra0dr2IasABIBxyUw=; b=dIU94/X3NSIjW+rsZ/+s0eeBqfr3PvqsbVqXO6YiS3opCaDTgSHjBC6a5bzaVC+fmC 7hJY2+P8i+1tDD9eY6/IsSwD5g78d6XUSWGspQOlq5T/5LqyahFVFcIX1tf2Hq20QCFO XIOfuk4gjyKsHJT0PULu8IFwxLpabXqzpBy/Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HihT2WHm5CL9KTfiGWQaowQJbGra0dr2IasABIBxyUw=; b=KVOSUWRSFYMudWQ762n0EFTu9vKxTXRWNUMSndlOeo8ii/pCZ/l+jo2rKdW5StWmHR se6U9PCoRQwSc1ohURdZg6KC9/0ftsFUlY6POu9rCo4U6HkyOIUiRk6xup3Y7gI2Forg TtM5lK4/Y8qBvMq2WJP1hpOF1cPyAgnhh9Il9f0ZUKp1cyZgax8Id//qWDDFIS+6/H+i zjz1pB9xvur8cxIq0m0ZnI1j3zRrxN3E7hFdzVbZBJfP/mSu6y7D+EAw/TWop3GUv/ER HO2sHrPyPvHOcFoQPx0JUF4gdSAnle6bBsjN5qVXiPqRfxe2i2QSsgMm4EEs8oRWA9px psfw== X-Gm-Message-State: AOAM530qvNzJJ/nnSSIDVl3zdB1ichtRgvI5q9Pih4Mse0hnCIgS0JYp hwMSDz1BP7b4hY0WK6tbTl4Gfw== X-Google-Smtp-Source: ABdhPJzo1ehebUbL5Zza/R8qwmqZqxbxBXxGJPyv3pmwWAQvc2EDBDyYvTbVgE/7K50OuPHt4wmwXQ== X-Received: by 2002:a17:907:c27:: with SMTP id ga39mr3323524ejc.626.1644320749345; Tue, 08 Feb 2022 03:45:49 -0800 (PST) Received: from alco.corp.google.com ([2620:0:1059:10:5d0f:d242:ddbf:a8a6]) by smtp.gmail.com with ESMTPSA id y2sm4151902edt.54.2022.02.08.03.45.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 03:45:49 -0800 (PST) From: Ricardo Ribalda To: kunit-dev@googlegroups.com, kasan-dev@googlegroups.com, linux-kselftest@vger.kernel.org, Brendan Higgins , Mika Westerberg , Daniel Latypov Cc: Ricardo Ribalda Subject: [PATCH v4 6/6] apparmor: test: Use NULL macros Date: Tue, 8 Feb 2022 12:45:41 +0100 Message-Id: <20220208114541.2046909-6-ribalda@chromium.org> X-Mailer: git-send-email 2.35.0.263.gb82422642f-goog In-Reply-To: <20220208114541.2046909-1-ribalda@chromium.org> References: <20220208114541.2046909-1-ribalda@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Replace the PTR_EQ NULL checks with the more idiomatic and specific NULL macros. Reviewed-by: Daniel Latypov Signed-off-by: Ricardo Ribalda --- security/apparmor/policy_unpack_test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/security/apparmor/policy_unpack_test.c b/security/apparmor/policy_unpack_test.c index 533137f45361..5c18d2f19862 100644 --- a/security/apparmor/policy_unpack_test.c +++ b/security/apparmor/policy_unpack_test.c @@ -313,7 +313,7 @@ static void policy_unpack_test_unpack_strdup_out_of_bounds(struct kunit *test) size = unpack_strdup(puf->e, &string, TEST_STRING_NAME); KUNIT_EXPECT_EQ(test, size, 0); - KUNIT_EXPECT_PTR_EQ(test, string, (char *)NULL); + KUNIT_EXPECT_NULL(test, string); KUNIT_EXPECT_PTR_EQ(test, puf->e->pos, start); } @@ -409,7 +409,7 @@ static void policy_unpack_test_unpack_u16_chunk_out_of_bounds_1( size = unpack_u16_chunk(puf->e, &chunk); KUNIT_EXPECT_EQ(test, size, (size_t)0); - KUNIT_EXPECT_PTR_EQ(test, chunk, (char *)NULL); + KUNIT_EXPECT_NULL(test, chunk); KUNIT_EXPECT_PTR_EQ(test, puf->e->pos, puf->e->end - 1); } @@ -431,7 +431,7 @@ static void policy_unpack_test_unpack_u16_chunk_out_of_bounds_2( size = unpack_u16_chunk(puf->e, &chunk); KUNIT_EXPECT_EQ(test, size, (size_t)0); - KUNIT_EXPECT_PTR_EQ(test, chunk, (char *)NULL); + KUNIT_EXPECT_NULL(test, chunk); KUNIT_EXPECT_PTR_EQ(test, puf->e->pos, puf->e->start + TEST_U16_OFFSET); }