From patchwork Thu Sep 14 22:15:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13386111 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0FA7BEEAA78 for ; Thu, 14 Sep 2023 22:15:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 805236B02E8; Thu, 14 Sep 2023 18:15:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7B44F6B02E9; Thu, 14 Sep 2023 18:15:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 655426B02F6; Thu, 14 Sep 2023 18:15:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 5049B6B02E8 for ; Thu, 14 Sep 2023 18:15:41 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 2507D1CA18A for ; Thu, 14 Sep 2023 22:15:41 +0000 (UTC) X-FDA: 81236610882.04.710C073 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf16.hostedemail.com (Postfix) with ESMTP id 704DD18001B for ; Thu, 14 Sep 2023 22:15:38 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Ku8q+LFf; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf16.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1694729738; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=71Btu3XYwWZK+FmqHCgDmjFCfU/69a0+IvtQoWaiN/g=; b=wtn52NCItygLtP5BYT4rUan39gxIgAY+XtWpFQKzLnND4FVoQzD+PjpFtuUrniw+F67osO QNTgu4Aaravow1CLNCzgv8gZC/Yz2Bdl0DKWmbha6OpMmCeNc2Yqt1P6HLGYi5f1TBX+BU pXjBT+qp9wMt73xU6uAJbZZ2LC+z+hg= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Ku8q+LFf; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf16.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1694729738; a=rsa-sha256; cv=none; b=58F4RQIjmZvD72smBtoVZWV9w5Ji8FSkBEWZcXvH3bq5qDDIZOmKv8qBYqFffnx95fqg3b 154tOge0VfiWBdCP5zDXkJdIQNxycwcpsQBuDj5zRFLtCgTUf/cALYJ2Ea3ftV0i2ltQ9/ iLuUD6WisJ2dm7Tlj19WrdfqZNdwbec= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694729737; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=71Btu3XYwWZK+FmqHCgDmjFCfU/69a0+IvtQoWaiN/g=; b=Ku8q+LFfY5xzlWUlePguhZr+JBhHZ3+i+Z86yCvX5fZ2wi3FaubilLgfmviTsiq9BkUaU+ qIDHTY5q+AUezEpXP2MmKum+A8dL1DB2O2iOVRakM8AieqWv7A/esBXoTd1jjb9LLbXTl8 xQsrmmWjWSWlV+maLrO7D3LZsfISWGM= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-611-xSilx-EINMK-s9yGWPKnCA-1; Thu, 14 Sep 2023 18:15:34 -0400 X-MC-Unique: xSilx-EINMK-s9yGWPKnCA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 855E3857A9C; Thu, 14 Sep 2023 22:15:33 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.216]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2331E2026D4B; Thu, 14 Sep 2023 22:15:31 +0000 (UTC) From: David Howells To: Al Viro , Linus Torvalds Cc: David Howells , Jens Axboe , Christoph Hellwig , Christian Brauner , David Laight , Matthew Wilcox , Brendan Higgins , David Gow , linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org, Johannes Thumshirn , Christian Brauner , David Hildenbrand , John Hubbard Subject: [RFC PATCH 1/9] iov_iter: Fix some checkpatch complaints in kunit tests Date: Thu, 14 Sep 2023 23:15:18 +0100 Message-ID: <20230914221526.3153402-2-dhowells@redhat.com> In-Reply-To: <20230914221526.3153402-1-dhowells@redhat.com> References: <20230914221526.3153402-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Rspamd-Queue-Id: 704DD18001B X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: qk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GFmFdqsmbQj8WyLEiAdpzgTfNLF8KwPAKkLgqJOQG+acduRJOHXygndr5AR3ktXHV/bxTiqQLz0E/PD/7zLxhf6IcUxsg17Z5Bg/HqZ00efv1D44jUdl28IEgZXM18Jb1Dh46USbcZik5IK7GWBBbnXgsSHz503le928TT4Y/aeCz6THfwpeJmbk8dSUY/glOErdqJfiuqo595EhbFIe/9vJJvCFHrJyEPRdWWyKgjse1mBCTYjvtD8rvfIqZDLUOCNZ7NT6H5CoorOGTuQuPIp0eixg02+Gtc/LyJOTqw8wjhIxS0Cd9p4LShJvCPq+65fAPlMc79wK4lVSzLCzVZcgDBnz88bcjbAuRp64pw84LpaNpOv2VAeaPUcmYNAuGB/WRdlkjTURRwr2fPSx+vwxRME046KVGhfqN0vpbm1t95OMo9Ats8VQglTofLnMfIGeqR2vHKIbbkAh4/Q0JVOaOcoipquN6Hm1uxL2wX4oHCCzGNDYrGJTqD5v4qC0+oBdPvQqhOSRQDGbA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Fix some checkpatch complaints in the new iov_iter kunit tests: (1) Some lines had eight spaces instead of a tab at the start. (2) Checkpatch doesn't like (void*)(unsigned long)0xnnnnnULL, so switch to using POISON_POINTER_DELTA plus an offset instead. Reported-by: Johannes Thumshirn Signed-off-by: David Howells cc: Christoph Hellwig cc: Christian Brauner cc: Jens Axboe cc: Al Viro cc: David Hildenbrand cc: John Hubbard cc: Brendan Higgins cc: David Gow cc: linux-kselftest@vger.kernel.org cc: kunit-dev@googlegroups.com cc: linux-mm@kvack.org cc: linux-fsdevel@vger.kernel.org --- lib/kunit_iov_iter.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/kunit_iov_iter.c b/lib/kunit_iov_iter.c index 859b67c4d697..4a6c0efd33f5 100644 --- a/lib/kunit_iov_iter.c +++ b/lib/kunit_iov_iter.c @@ -53,7 +53,7 @@ static void *__init iov_kunit_create_buffer(struct kunit *test, void *buffer; pages = kunit_kcalloc(test, npages, sizeof(struct page *), GFP_KERNEL); - KUNIT_ASSERT_NOT_ERR_OR_NULL(test, pages); + KUNIT_ASSERT_NOT_ERR_OR_NULL(test, pages); *ppages = pages; got = alloc_pages_bulk_array(GFP_KERNEL, npages, pages); @@ -63,7 +63,7 @@ static void *__init iov_kunit_create_buffer(struct kunit *test, } buffer = vmap(pages, npages, VM_MAP | VM_MAP_PUT_PAGES, PAGE_KERNEL); - KUNIT_ASSERT_NOT_ERR_OR_NULL(test, buffer); + KUNIT_ASSERT_NOT_ERR_OR_NULL(test, buffer); kunit_add_action_or_reset(test, iov_kunit_unmap, buffer); return buffer; @@ -548,7 +548,7 @@ static void __init iov_kunit_extract_pages_kvec(struct kunit *test) size_t offset0 = LONG_MAX; for (i = 0; i < ARRAY_SIZE(pagelist); i++) - pagelist[i] = (void *)(unsigned long)0xaa55aa55aa55aa55ULL; + pagelist[i] = (void *)POISON_POINTER_DELTA + 0x5a; len = iov_iter_extract_pages(&iter, &pages, 100 * 1024, ARRAY_SIZE(pagelist), 0, &offset0); @@ -626,7 +626,7 @@ static void __init iov_kunit_extract_pages_bvec(struct kunit *test) size_t offset0 = LONG_MAX; for (i = 0; i < ARRAY_SIZE(pagelist); i++) - pagelist[i] = (void *)(unsigned long)0xaa55aa55aa55aa55ULL; + pagelist[i] = (void *)POISON_POINTER_DELTA + 0x5a; len = iov_iter_extract_pages(&iter, &pages, 100 * 1024, ARRAY_SIZE(pagelist), 0, &offset0); @@ -709,7 +709,7 @@ static void __init iov_kunit_extract_pages_xarray(struct kunit *test) size_t offset0 = LONG_MAX; for (i = 0; i < ARRAY_SIZE(pagelist); i++) - pagelist[i] = (void *)(unsigned long)0xaa55aa55aa55aa55ULL; + pagelist[i] = (void *)POISON_POINTER_DELTA + 0x5a; len = iov_iter_extract_pages(&iter, &pages, 100 * 1024, ARRAY_SIZE(pagelist), 0, &offset0);