From patchwork Mon Feb 7 18:33:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 540631 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 8BD4AC43217 for ; Mon, 7 Feb 2022 18:37:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233896AbiBGSgw (ORCPT ); Mon, 7 Feb 2022 13:36:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240853AbiBGSdO (ORCPT ); Mon, 7 Feb 2022 13:33:14 -0500 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12778C0401D9 for ; Mon, 7 Feb 2022 10:33:14 -0800 (PST) Received: by mail-ed1-x52d.google.com with SMTP id cn6so9361420edb.5 for ; Mon, 07 Feb 2022 10:33:13 -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=ssHaNiY3LReYl3MVuJ+ePd9JHdf9OG1Dd7zZJ3nge2k=; b=Y04HjLPsZkYdoFCeBvut+f8CXidNVJOGkPxikLhixK501IvyPyXIzekoWjSlmrF8OX u03ERTnhW8DE58bhyNSXTsd2whnjJBZ4aIpR0gDNddM7XqB+9jop/3FmKpHHKtBg7Lc+ Cf23LyG18ool9UQz6QmgP8iyLNerW26JbfoaI= 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=ssHaNiY3LReYl3MVuJ+ePd9JHdf9OG1Dd7zZJ3nge2k=; b=Y4rAOdiGROBcs7Mpiv+hhUx+8t2CE6oqItXYCeBgO34zVBt8vAUKHSTHk+V/AsGb35 7V69OWbgmqvJk/4TN3z+CDJY0P6wKEBGvejLqxUTTbP/aQXd5cq2ceazqM44rgau0WGm qO/QqVl7+eMBvZGwrhA6AaF1bKFPAb0KeDW+N+laSzBBT+6EH1KhOPcYrnwkpKBOXWk4 4w2w/8KYvKbkXDdLS6OM+Mf9t7GKjm8Jy8ZQmI2f3a5/Lh8HhMGy9gIeq4YH+81GnuAq gvesAiSwmbsIgKtS2/Z7Nvx3ag9yRldj5Jp+M6ejX1pN15PWihof/YYAlfN0ZVAePzgT 5Vhg== X-Gm-Message-State: AOAM532U+HAL16NTGl87LjLDlvQDvWdOjOloFyfmDbtSlLKbgj7fU7LA 3TTfhIXe0e6RWZgAjbFKQdo1Xw== X-Google-Smtp-Source: ABdhPJwGN4VbnI4x7rDYfog/zY+635S5wcdgEYYlW6+Pp2dJwVNzXbvi5aUiiztSLaMEBlh2B8XjcQ== X-Received: by 2002:aa7:c043:: with SMTP id k3mr790601edo.184.1644258792671; Mon, 07 Feb 2022 10:33:12 -0800 (PST) Received: from alco.lan (80.71.134.83.ipv4.parknet.dk. [80.71.134.83]) by smtp.gmail.com with ESMTPSA id k15sm3045173eji.64.2022.02.07.10.33.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Feb 2022 10:33:12 -0800 (PST) From: Ricardo Ribalda To: kunit-dev@googlegroups.com, kasan-dev@googlegroups.com, linux-kselftest@vger.kernel.org, Brendan Higgins , Mika Westerberg Cc: Ricardo Ribalda Subject: [PATCH 3/6] kunit: use NULL macros Date: Mon, 7 Feb 2022 19:33:05 +0100 Message-Id: <20220207183308.1829495-3-ribalda@chromium.org> X-Mailer: git-send-email 2.35.0.263.gb82422642f-goog In-Reply-To: <20220207183308.1829495-1-ribalda@chromium.org> References: <20220207183308.1829495-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. Signed-off-by: Ricardo Ribalda --- lib/kunit/kunit-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/kunit/kunit-test.c b/lib/kunit/kunit-test.c index 555601d17f79..8e2fe083a549 100644 --- a/lib/kunit/kunit-test.c +++ b/lib/kunit/kunit-test.c @@ -435,7 +435,7 @@ static void kunit_log_test(struct kunit *test) KUNIT_EXPECT_NOT_ERR_OR_NULL(test, strstr(suite.log, "along with this.")); #else - KUNIT_EXPECT_PTR_EQ(test, test->log, (char *)NULL); + KUNIT_EXPECT_NULL(test, test->log); #endif } From patchwork Mon Feb 7 18:33:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 540630 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 9B803C4321E for ; Mon, 7 Feb 2022 18:37:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233817AbiBGSgw (ORCPT ); Mon, 7 Feb 2022 13:36:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240875AbiBGSdP (ORCPT ); Mon, 7 Feb 2022 13:33:15 -0500 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A671EC0401DF for ; Mon, 7 Feb 2022 10:33:14 -0800 (PST) Received: by mail-ej1-x635.google.com with SMTP id p15so44721579ejc.7 for ; Mon, 07 Feb 2022 10:33:14 -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=elxmE3zs5g2Y4x1nlwNY1X/XBfQO0VsIOMiC0QvhdRs=; b=ib7OInvnGb1390rQvsxx41sBLDlYlnymqB0W0z5ewFkH7jX1eD7AhbpgqSMOyBYVpB DLEad2S0PIUl8kXzhHS/oLN5pUStvOM0WPsxQeQHfedN29gpnGMXXeoh384vDq6//n2G RyjMwFGldPpDN29Jg+T3JflHK6vN4HiODJMbc= 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=elxmE3zs5g2Y4x1nlwNY1X/XBfQO0VsIOMiC0QvhdRs=; b=ofLzYhSr/1IMmomboPphGzM0Tpu3504o26IZeOdH73mKGiTD5E/mVrODUMYN3zmBaP j4cd4HYgGCt2UE0cSH0Xl8xRpXBqS+de6SWxKLiD0KPyRTFlt3KvozVt8HFdSMXQHJN7 quxbmMWoXGv6TwXqA4jR+5y2hs0fEZcZ1JPxzXWKsiWtEzVpXZ+Aw4LOulUDriJdEwTa 9nr+rK3SHq+AMI5uBXRdbzEA5dJmSEp4HZZdzyzgSP5ziAxuigozjFihvX5Y+2QkjDOt ZaIOJ5kVNvyj1sEoXp/WXnnWC3uhYE4lmS9t7uZg15734xuj4tx0/265x6v02cfUa3ka Yv2A== X-Gm-Message-State: AOAM533hD6vhXttOu/5M/pDFnprhcTf059Z+Tp/VVIbfU0R2Hc6mjaed CaKIgdUBi7dFvPdSRgvKF7s/BQ== X-Google-Smtp-Source: ABdhPJx2znfkJdWuVEfTJQm+QwhAab9EmEa5PLUcvF/yiqLO7zPWj6QRIx5XFn0ngzxpPzD5Fv6lpA== X-Received: by 2002:a17:906:9756:: with SMTP id o22mr807187ejy.448.1644258793323; Mon, 07 Feb 2022 10:33:13 -0800 (PST) Received: from alco.lan (80.71.134.83.ipv4.parknet.dk. [80.71.134.83]) by smtp.gmail.com with ESMTPSA id k15sm3045173eji.64.2022.02.07.10.33.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Feb 2022 10:33:13 -0800 (PST) From: Ricardo Ribalda To: kunit-dev@googlegroups.com, kasan-dev@googlegroups.com, linux-kselftest@vger.kernel.org, Brendan Higgins , Mika Westerberg Cc: Ricardo Ribalda Subject: [PATCH 4/6] kasan: test: Use NULL macros Date: Mon, 7 Feb 2022 19:33:06 +0100 Message-Id: <20220207183308.1829495-4-ribalda@chromium.org> X-Mailer: git-send-email 2.35.0.263.gb82422642f-goog In-Reply-To: <20220207183308.1829495-1-ribalda@chromium.org> References: <20220207183308.1829495-1-ribalda@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Replace PTR_EQ checks with the more idiomatic and specific NULL macros. Signed-off-by: Ricardo Ribalda --- lib/test_kasan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/test_kasan.c b/lib/test_kasan.c index 26a5c9007653..ae15f7bf7313 100644 --- a/lib/test_kasan.c +++ b/lib/test_kasan.c @@ -385,7 +385,7 @@ static void krealloc_uaf(struct kunit *test) kfree(ptr1); KUNIT_EXPECT_KASAN_FAIL(test, ptr2 = krealloc(ptr1, size2, GFP_KERNEL)); - KUNIT_ASSERT_PTR_EQ(test, (void *)ptr2, NULL); + KUNIT_ASSERT_NULL(test, ptr2); KUNIT_EXPECT_KASAN_FAIL(test, *(volatile char *)ptr1); } From patchwork Mon Feb 7 18:33:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 540632 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 16EAFC433FE for ; Mon, 7 Feb 2022 18:36:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232471AbiBGSgh (ORCPT ); Mon, 7 Feb 2022 13:36:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240926AbiBGSdQ (ORCPT ); Mon, 7 Feb 2022 13:33:16 -0500 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9E4FC0401DA for ; Mon, 7 Feb 2022 10:33:15 -0800 (PST) Received: by mail-ej1-x62d.google.com with SMTP id p15so44721756ejc.7 for ; Mon, 07 Feb 2022 10:33:15 -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=sQV3FF5mFgBVe7Tg/aDZitfy1ByGgWInZOonbxaNvNg=; b=l4qyatFZhyECRncPLcXL8VNkiMsmHadTVF8MBX9JntJrammN4JstK81tY9P8n6tvcL oGNyxh/lnCKWL1BNREH/G58qnyJ5uCKz+A19Az6Cz0BOiU6rL4qieFp6j0dME2DnFeXI fsaJdue9hmuH/oaqIUx4D/z+WsOVdJzhZPq0A= 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=sQV3FF5mFgBVe7Tg/aDZitfy1ByGgWInZOonbxaNvNg=; b=5Q29GIg/dDWqrOof45R9qOylFs8ZWkXvlgP2IRd78s1+TXN57k+Wp8NH14BmvF5j6+ /5N+hrPO29nG0AwsWdTMAI+9SmXbEVQ0r+mdVxkKgw7oaJ1WXMJzaCGEVqI2t97LxL2F Fd2dfmh1hbsFYrxFxyXtj9WJmrkgL0Se+dGhUi4bA04WvTyksocb7+GrEzUfxB9B3Q5j LvBcEek70Sh/Pw7lf8h0DKnp0bCjGshz2rBdcCZKDlds73rig2q50Imdd2NpxCoqY+ON pCOA7qiq8XxGlofDOsO9A6/z1dRJtRHBWcm/mY71sjx6aANGZIfQS9MvCNfbA5Aekwat QUkQ== X-Gm-Message-State: AOAM530ZCE4mcY7x+q8Iqm+LiHtFmqqoVvRwpD7TgYlNiJLc92MqUQ9S ZTmLv6UQLqiskNkMNEu32WgF8A== X-Google-Smtp-Source: ABdhPJzPyU4JY8Gr4F6U8ZniBFYs/FdtbhAwY6umKjMplE4ASnx4SFwbOXTYMvegEjdUmC5ceiR7dQ== X-Received: by 2002:a17:906:5a5c:: with SMTP id my28mr775731ejc.54.1644258794460; Mon, 07 Feb 2022 10:33:14 -0800 (PST) Received: from alco.lan (80.71.134.83.ipv4.parknet.dk. [80.71.134.83]) by smtp.gmail.com with ESMTPSA id k15sm3045173eji.64.2022.02.07.10.33.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Feb 2022 10:33:14 -0800 (PST) From: Ricardo Ribalda To: kunit-dev@googlegroups.com, kasan-dev@googlegroups.com, linux-kselftest@vger.kernel.org, Brendan Higgins , Mika Westerberg Cc: Ricardo Ribalda Subject: [PATCH 6/6] apparmor: test: Use NULL macros Date: Mon, 7 Feb 2022 19:33:08 +0100 Message-Id: <20220207183308.1829495-6-ribalda@chromium.org> X-Mailer: git-send-email 2.35.0.263.gb82422642f-goog In-Reply-To: <20220207183308.1829495-1-ribalda@chromium.org> References: <20220207183308.1829495-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. 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); }