From patchwork Mon Feb 7 20:27:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 540627 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 80360C433FE for ; Mon, 7 Feb 2022 20:30:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236251AbiBGUaI (ORCPT ); Mon, 7 Feb 2022 15:30:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242241AbiBGU1W (ORCPT ); Mon, 7 Feb 2022 15:27:22 -0500 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E43CCC0401E6 for ; Mon, 7 Feb 2022 12:27:19 -0800 (PST) Received: by mail-ed1-x52c.google.com with SMTP id b13so32687325edn.0 for ; Mon, 07 Feb 2022 12:27:19 -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=KXm+9Zz7kQqt2EFBwAfIC5XooSw7CB+RPRatZ+DKukY=; b=NlftQC1QAC85AVhg4e70haxCay1d5UaQ/sYrPd/Ykn5T4wsxmaS8Do2qnK4qoD6W8Z 7bQD4HbOh1JjJq2JbX3e+Vbs+W5y69+vEEb2Eq7iOECqiuIyVcl5Ivmo6cAJ/Wnx7tPn ETFG7OFiwue6SqY00x8m4JVuHsRnXituauObc= 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=KXm+9Zz7kQqt2EFBwAfIC5XooSw7CB+RPRatZ+DKukY=; b=6EeL5jouzWkjD7MzmDkY+f5KcbFrgjFuVK+ytjsdrbJj70r/1EnYt/7sHRx+KUrpGb qji+z++6RM4m1y3pzAVccopFyLHGvYVC5mEF+4MDDU3dQYfxkHbcpUUiMVVCLtMHPs1o QrNcwQmVr1fCHl7a+1d2hkBUj89QxBSbBaTuj6WZRjsk/m7YFebm5ZW8ErO7+lPEy4w0 csZeTZpAYVFEA8sTCrOaKzUIzamIKWNBS72HQOf0wNI1l2MEC7eltW/1IQ7CfwMZCIMw wgQl2LBbeIWFDYbEfA4nl1WDtDZVi+0wZH2/pngs/NBZ6/lUMGTUfYuUDbu6205qSjax qreA== X-Gm-Message-State: AOAM5303xgQoIO+RqkCk/sTlPRtVAbv+TY6i5XTWsmEiwBCdLC4wY/QU kGvGTud6tV5ynomaPpxL9L8BCA== X-Google-Smtp-Source: ABdhPJzlqQ6oN5LMYSCFOI0DUJfg+KXi1o6eA0wp31mozViPZLaZguKm6kPaK/6AZvov5UeEuUs9MQ== X-Received: by 2002:a05:6402:448f:: with SMTP id er15mr1246579edb.222.1644265638490; Mon, 07 Feb 2022 12:27:18 -0800 (PST) Received: from alco.lan (80.71.134.83.ipv4.parknet.dk. [80.71.134.83]) by smtp.gmail.com with ESMTPSA id t8sm787893eji.94.2022.02.07.12.27.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Feb 2022 12:27:18 -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 v2 4/6] kasan: test: Use NULL macros Date: Mon, 7 Feb 2022 21:27:12 +0100 Message-Id: <20220207202714.1890024-4-ribalda@chromium.org> X-Mailer: git-send-email 2.35.0.263.gb82422642f-goog In-Reply-To: <20220207202714.1890024-1-ribalda@chromium.org> References: <20220207202714.1890024-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 847cdbefab46..d680f46740b8 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 20:27:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 540628 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 92FD7C43219 for ; Mon, 7 Feb 2022 20:30:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233974AbiBGUaH (ORCPT ); Mon, 7 Feb 2022 15:30:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242227AbiBGU1W (ORCPT ); Mon, 7 Feb 2022 15:27:22 -0500 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84E7EC0401E7 for ; Mon, 7 Feb 2022 12:27:20 -0800 (PST) Received: by mail-ej1-x631.google.com with SMTP id y3so24771786ejf.2 for ; Mon, 07 Feb 2022 12:27:20 -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=COoBb1joui25djaKHvMRbQv4Mt4Thb8VpuVozeRERCg=; b=VSeSAlio7FB8hddPjGhLo211NvE6XCzT2LJAV6ROiWEcOAh1BFQUqKifxX2sEs+B25 MIXekCZe5nnABXNv6xIcR4wPDTTF3T1wzvBV7MyUmkkPvKppiTouxzBiQOHNSuIqKNWj 9mAqOGqzlNkebYwxR/AUQjOT7Io2R7FNlZQxU= 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=COoBb1joui25djaKHvMRbQv4Mt4Thb8VpuVozeRERCg=; b=n6+1hr2pbnEKsCNOqQZykCdNchhRFshCajNg6U5IxTacjyEOl6Ux6ZaO/KyHMn9zQO o13m/1CKrtr8lHWbJRc09XzGa+TLMWNBqTuW7akJC4STO+duTwvreqQOgfVqZD0rLawT TTUg6zLqRGhTEzKxse9NpOS5vgxBHcNtMQChQC0DgOiW85CnjLxCiQ+59wUr3FYBV9NQ GV1SmHxmhAyEjo3z3ef9QCIxhiCdOefC9w4DPI2BX2HZXIbx7zgMd/ZcUPCDTdyyYIUM 6TNGqghaBk0+gow+p20ZwLRjC+Q99tXmupQfVVh/fILe1iA6OniB5JSckBlVPeRhMZaS eMmw== X-Gm-Message-State: AOAM531vDUPrBJePnWgXT/J6RLHyPN32dybA2c9zv6AwOcps6lvmYC1m wD1BAMLK42ywC89Y4AI2OqoJmQ== X-Google-Smtp-Source: ABdhPJwxq5vsBYIvCeuX1CSIjGLgWBnKzjKg/K3tRDOOPsLqZxt6IT8qorePca+E3sURcJzbRWBInA== X-Received: by 2002:a17:907:9494:: with SMTP id dm20mr1097662ejc.148.1644265639140; Mon, 07 Feb 2022 12:27:19 -0800 (PST) Received: from alco.lan (80.71.134.83.ipv4.parknet.dk. [80.71.134.83]) by smtp.gmail.com with ESMTPSA id t8sm787893eji.94.2022.02.07.12.27.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Feb 2022 12:27:18 -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 v2 5/6] mctp: test: Use NULL macros Date: Mon, 7 Feb 2022 21:27:13 +0100 Message-Id: <20220207202714.1890024-5-ribalda@chromium.org> X-Mailer: git-send-email 2.35.0.263.gb82422642f-goog In-Reply-To: <20220207202714.1890024-1-ribalda@chromium.org> References: <20220207202714.1890024-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. 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 Mon Feb 7 20:27:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 540629 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 4B92CC433EF for ; Mon, 7 Feb 2022 20:30:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231761AbiBGUaG (ORCPT ); Mon, 7 Feb 2022 15:30:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242228AbiBGU1W (ORCPT ); Mon, 7 Feb 2022 15:27:22 -0500 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2413EC0401E9 for ; Mon, 7 Feb 2022 12:27:21 -0800 (PST) Received: by mail-ed1-x535.google.com with SMTP id s7so6058577edd.3 for ; Mon, 07 Feb 2022 12:27:21 -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=jaLc531Lfzn2CIV3hjJSKaDeRwXxJSGmK4s7rLQ1op80VPV2iUd3RuDz+EMbQkudBj Hv9XQPhoEK7+gB6QGHphiFjftE5yK+hJJ5W3aJHiQ5UW0SMWjutS5BTU/blvEG0wEOaR uJ/LUXY8sEG9yuIHa8cYRyExBL1cBc981TsmU= 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=sOy+LRJ6Ep/jjjnHyhwWE3vh+A5BQlAaBeJB+1p5USd/SzZQo8MI2lOZV/yoHjjQAn 74C3N6n9r3yktTBamNfbG8/O+749/HkzUxIJ2At5knB/DLZTcM96jTBmSUlfEteOfW9Y T8bsNuS9umbjT86kxJge/SU6mVwW0MeCo1fk4ZYyBLSmr9zsMFc6sLuzbKtWR3cNhfdJ qpuVYnb8vjxweVJlUFTMT9zvpdTbQZU5D3sprDakFVNOlMjwU6223YSlBlj7iVqDE3k3 sjzFDfp7NU/N5uo2kfdi6YlMr07EAN7bSu4EAZqidArH42rGwgRWrKc5ghPT2LMWTwfy /wcw== X-Gm-Message-State: AOAM532R7NkVeRjXzzOywV+o1JqBKC0tlDtHpDjatVxHZNgK4pnpMmzh MjWOLvm6N/JGf6tkzQU3cjpg1fS5HoJUOQ== X-Google-Smtp-Source: ABdhPJwr1EykwK0wYZzzVHs63PyiZ+KXMYLSa/HWcMvv57rHzdRsH7ALubADeRW2s/i7IhOUOmmknQ== X-Received: by 2002:a05:6402:2022:: with SMTP id ay2mr1198884edb.273.1644265639653; Mon, 07 Feb 2022 12:27:19 -0800 (PST) Received: from alco.lan (80.71.134.83.ipv4.parknet.dk. [80.71.134.83]) by smtp.gmail.com with ESMTPSA id t8sm787893eji.94.2022.02.07.12.27.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Feb 2022 12:27:19 -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 v2 6/6] apparmor: test: Use NULL macros Date: Mon, 7 Feb 2022 21:27:14 +0100 Message-Id: <20220207202714.1890024-6-ribalda@chromium.org> X-Mailer: git-send-email 2.35.0.263.gb82422642f-goog In-Reply-To: <20220207202714.1890024-1-ribalda@chromium.org> References: <20220207202714.1890024-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); }