Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1364737pxb; Fri, 21 Jan 2022 16:36:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJxYDmciH+Wn05oIBOlpxTwj1FJAtPLMU/UmKPiom0bwAhMM8uj/l1Uzze/xE9MV8xXcvuVu X-Received: by 2002:a05:6a00:2442:b0:4c5:75b4:d53e with SMTP id d2-20020a056a00244200b004c575b4d53emr5553002pfj.49.1642811800876; Fri, 21 Jan 2022 16:36:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642811800; cv=none; d=google.com; s=arc-20160816; b=Ojzk0QrdgtXKNZ461Jd5qWFzhqJ3SaD5uK3k62JPN6hJaZ1FIxRFxjx0bFnKnhT0nM jBk4O0/QoEphc1KCrvUek8cdNZu0nbcE0TjBCNs6K4uvhTn8HLbwGGsKLszd+/9j49e0 rJPYtvncf+xl8QkIMV0KmKHwGXNF+sZ8ylAGs3BErTU9JhIDDAdCHOlWc/3bzy8UDpam KDdJeQj9Svj7mhoLfdnyRbouJTSLq/ZpEXyeuJWBiv21zbQoJy5i8Ce+lmC8rMKiv94n rsFRnAv5d9/o/e2YGidLg+k+Mb4rn83ioZj5HMn31VJFwzeuvB7T37xeLRbL6mfCIMYv WqNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=3CrLAhHri6cW7ge5sJ5mw2A/ImHNlJKr/VuNGqWz4kw=; b=sBuCeUm3JkO6ZuQ7b96FN4JSZczKb4nGpwqvHCuh4c53NRufI6LhxCxD4jamoUL4R5 Ht6vXa90PMD9hX5RM1oF+W+uNbdPJRsbeT/Hf3PmhrATmSaovtZtonv9XxezY+9CKIsE 6rg/YsMuU29kH36BcsHMMEcx3JucovAQbZFaOWDKU9G+tH+9/SRyY0GzOwzO6/6dGhDB hJ+hwQmeJ68/Os265d/uT70nzLbkYwe5FeOlLn7937GiZdAcsiKGroHWmbldSErF7j6e DA7SCoJzmFH8EWzXbxvpa+3pVGGLU7tgDGD9fig5/+saaULEBYITEQelSqQw7PAN2pa5 VAog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=m5S5VWVh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d13si7955162pfj.20.2022.01.21.16.36.27; Fri, 21 Jan 2022 16:36:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=m5S5VWVh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378944AbiAUHWA (ORCPT + 99 others); Fri, 21 Jan 2022 02:22:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378912AbiAUHV5 (ORCPT ); Fri, 21 Jan 2022 02:21:57 -0500 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BBC3C06173F for ; Thu, 20 Jan 2022 23:21:56 -0800 (PST) Received: by mail-wm1-x331.google.com with SMTP id o1-20020a1c4d01000000b0034d95625e1fso12468141wmh.4 for ; Thu, 20 Jan 2022 23:21:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3CrLAhHri6cW7ge5sJ5mw2A/ImHNlJKr/VuNGqWz4kw=; b=m5S5VWVhb+cg0vapaRftt4gkZ1W0KfvP07ZZ1t0HTKbr9d+dFs2IgWRGb6TbEK2e1L zUzxbtW1kQO6YAfwDI+xp8libeaa23DDtRwFC6WT0jCuv2u/lq2waA/MpljtzyHALje4 mTvAjdLHL2cs7nuhbt0GJKTLZVaXT4loISsejC0yURPHQxdBAnqxaOe1FDvmc44UFRnt a6Yoitgr8DYqw1bosKyXya7LAZQFUq4gcPyjoHo3GI751r7QufdK8u+ECHuqJMHdZM9c U99OeA2cvsBp5/m645kRNB0gNGNdee0l99CLSjsQsETTPZK6sm1IfuENFbpngA9yfNTt 0WNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3CrLAhHri6cW7ge5sJ5mw2A/ImHNlJKr/VuNGqWz4kw=; b=WnvxzutFsrcp8XBVuK5Z4dKvrfj8ONSYe8macIzSCwltVWLD2D0Fm6mO8otEWmt1VY y0DUVnnQTFsa4ByEwdoTkp0/gix1dAjLFbg9YYAyIzDHLn33/RERxIyKP1g3LLVVY3uG SU/bkm1nJ+dXhsQOZ4kMh9emmAY69jy7FP17AJwS1ESkBWQBkb9Y+CACnD9wGwSpFIXk EnLULZ0/hV3zc//t7v0nCJivyyR+rpnQ6UPxT6+/guaEioXYbD3smQ6vgJ5gKpL1v20c D9KsbHfVSSs06UNB81r1y16+JWdH60p4NH0uGmzj7JrI07KznGVyFeXGCZDyVP49YLGd rMcA== X-Gm-Message-State: AOAM532/NUIhsuYCF25OPuLgwnTgd9WykQYqcZWQJgz/zFzms/F+hrg6 fdtCqVVOY1cGR4PPSY77JDcgr6889dFKA3zBzFBGig== X-Received: by 2002:a5d:6d85:: with SMTP id l5mr2682374wrs.447.1642749715107; Thu, 20 Jan 2022 23:21:55 -0800 (PST) MIME-Version: 1.0 References: <20220118223506.1701553-1-dlatypov@google.com> <20220118223506.1701553-3-dlatypov@google.com> In-Reply-To: <20220118223506.1701553-3-dlatypov@google.com> From: David Gow Date: Fri, 21 Jan 2022 15:21:42 +0800 Message-ID: Subject: Re: [PATCH 2/5] kunit: drop unused intermediate macros for ptr inequality checks To: Daniel Latypov Cc: Brendan Higgins , Linux Kernel Mailing List , KUnit Development , "open list:KERNEL SELFTEST FRAMEWORK" , Shuah Khan Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 19, 2022 at 6:35 AM 'Daniel Latypov' via KUnit Development wrote: > > We have the intermediate macros for KUNIT_EXPECT_PTR_GT() and friends, > but these macros don't exist. > > I can see niche usecases for these macros existing, but since we've been > fine without them for so long, let's drop this dead code. > > Users can instead cast the pointers and use the other GT/LT macros. > > Signed-off-by: Daniel Latypov > --- Agreed: while I can sort-of see why one might want to use something like this for bounds checking, casting to an integer is definitely acceptable (and we've got things like KASAN and fortify-source for many bounds-checking cases anyway). Also, many languages explicitly treat pointers as not being comparable this way anyway, and rely on casting to integer, which is a trend worth following, I think. Reviewed-by: David Gow Cheers, -- David > include/kunit/test.h | 60 -------------------------------------------- > 1 file changed, 60 deletions(-) > > diff --git a/include/kunit/test.h b/include/kunit/test.h > index b032dd6816d2..c021945a75e3 100644 > --- a/include/kunit/test.h > +++ b/include/kunit/test.h > @@ -1044,21 +1044,6 @@ do { \ > fmt, \ > ##__VA_ARGS__) > > -#define KUNIT_BINARY_PTR_LT_MSG_ASSERTION(test, \ > - assert_type, \ > - left, \ > - right, \ > - fmt, \ > - ...) \ > - KUNIT_BASE_LT_MSG_ASSERTION(test, \ > - kunit_binary_ptr_assert, \ > - KUNIT_INIT_BINARY_PTR_ASSERT_STRUCT, \ > - assert_type, \ > - left, \ > - right, \ > - fmt, \ > - ##__VA_ARGS__) > - > #define KUNIT_BINARY_LE_MSG_ASSERTION(test, assert_type, left, right, fmt, ...)\ > KUNIT_BASE_LE_MSG_ASSERTION(test, \ > kunit_binary_assert, \ > @@ -1069,21 +1054,6 @@ do { \ > fmt, \ > ##__VA_ARGS__) > > -#define KUNIT_BINARY_PTR_LE_MSG_ASSERTION(test, \ > - assert_type, \ > - left, \ > - right, \ > - fmt, \ > - ...) \ > - KUNIT_BASE_LE_MSG_ASSERTION(test, \ > - kunit_binary_ptr_assert, \ > - KUNIT_INIT_BINARY_PTR_ASSERT_STRUCT, \ > - assert_type, \ > - left, \ > - right, \ > - fmt, \ > - ##__VA_ARGS__) > - > #define KUNIT_BINARY_GT_MSG_ASSERTION(test, assert_type, left, right, fmt, ...)\ > KUNIT_BASE_GT_MSG_ASSERTION(test, \ > kunit_binary_assert, \ > @@ -1094,21 +1064,6 @@ do { \ > fmt, \ > ##__VA_ARGS__) > > -#define KUNIT_BINARY_PTR_GT_MSG_ASSERTION(test, \ > - assert_type, \ > - left, \ > - right, \ > - fmt, \ > - ...) \ > - KUNIT_BASE_GT_MSG_ASSERTION(test, \ > - kunit_binary_ptr_assert, \ > - KUNIT_INIT_BINARY_PTR_ASSERT_STRUCT, \ > - assert_type, \ > - left, \ > - right, \ > - fmt, \ > - ##__VA_ARGS__) > - > #define KUNIT_BINARY_GE_MSG_ASSERTION(test, assert_type, left, right, fmt, ...)\ > KUNIT_BASE_GE_MSG_ASSERTION(test, \ > kunit_binary_assert, \ > @@ -1119,21 +1074,6 @@ do { \ > fmt, \ > ##__VA_ARGS__) > > -#define KUNIT_BINARY_PTR_GE_MSG_ASSERTION(test, \ > - assert_type, \ > - left, \ > - right, \ > - fmt, \ > - ...) \ > - KUNIT_BASE_GE_MSG_ASSERTION(test, \ > - kunit_binary_ptr_assert, \ > - KUNIT_INIT_BINARY_PTR_ASSERT_STRUCT, \ > - assert_type, \ > - left, \ > - right, \ > - fmt, \ > - ##__VA_ARGS__) > - > #define KUNIT_BINARY_STR_ASSERTION(test, \ > assert_type, \ > left, \ > -- > 2.34.1.703.g22d0c6ccf7-goog > > -- > You received this message because you are subscribed to the Google Groups "KUnit Development" group. > To unsubscribe from this group and stop receiving emails from it, send an email to kunit-dev+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/kunit-dev/20220118223506.1701553-3-dlatypov%40google.com.