From mboxrd@z Thu Jan 1 00:00:00 1970 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 2702DC433F5 for ; Mon, 25 Apr 2022 13:45:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AD27F6B0074; Mon, 25 Apr 2022 09:45:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A7F2D6B0075; Mon, 25 Apr 2022 09:45:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 948AF6B0078; Mon, 25 Apr 2022 09:45:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.27]) by kanga.kvack.org (Postfix) with ESMTP id 8777B6B0074 for ; Mon, 25 Apr 2022 09:45:08 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id 2775E1219A7 for ; Mon, 25 Apr 2022 13:45:08 +0000 (UTC) X-FDA: 79395522696.28.32532F1 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf22.hostedemail.com (Postfix) with ESMTP id A397AC0028 for ; Mon, 25 Apr 2022 13:45:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650894306; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kjKl7LXWSDD258DvkdJkTnbtgI9iQSku/0RIww7gifA=; b=ECtOasKE3uyh00axE8ZoGWwqnAICrfhY7JztYZ5ouDAr4169zXY/ioMy3bjeITxjGQfwJL VbDwzpzNR9R7Hr4h60vB8NqJ/ZOwZJiYuvb3OqcmmeyoTCMDmftbOd9uY7/pbk7XX/LdHR ic0+MbA/iHLNUK2/REbaGjgrk2kuFCI= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-158-IWFfmqPAOG2Nog3VUWr37w-1; Mon, 25 Apr 2022 09:45:05 -0400 X-MC-Unique: IWFfmqPAOG2Nog3VUWr37w-1 Received: by mail-wm1-f70.google.com with SMTP id az19-20020a05600c601300b003914ac8efb8so7174594wmb.2 for ; Mon, 25 Apr 2022 06:45:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:organization:in-reply-to :content-transfer-encoding; bh=kjKl7LXWSDD258DvkdJkTnbtgI9iQSku/0RIww7gifA=; b=A/k57xCu2rYkMfuD+2IQWNLWj9VzE8BtQyV9LHpto1dXDmBjFM77QIb5tSqXd1XMD7 wFw7IZdJ8iUnXvrz2U1Soshy+FPGxDngM4a1PsICh8cqjP7Q3kA43e0Vlfbw9Y5vJoT/ OOWAzq1s75Jv3hXbbaCHugpXyC6uBoeK7JvepEcdBhR2x6CpeWOKhKqF5mgikTRaLavm uggrFFZXesOdLsxfQNeclsO5ZpI2OWMuWONtFPN9LJWyIFRr6jNOBlCafe7CmIQMyehr 31Sxy921xfFJPgHT87zzBcdL4+7WN853mr5a8FaSFLxTuRMyulZOvn0u22tcryH0NhZc hhng== X-Gm-Message-State: AOAM533Y419+rXnRKYmiL9zVwSrqCNTRaJm+eX6k6y0zX0MMl3mBbL8t c+BfHI+YbG1ow2VRe4RSwl+CHpc8+Css1mjKqA2ZaYNMnTLdfH1AJcgbuuJx9ukhwxtE5SgN0m7 E//5lIb5R57c= X-Received: by 2002:a1c:35c7:0:b0:38e:4c59:6788 with SMTP id c190-20020a1c35c7000000b0038e4c596788mr1346037wma.1.1650894304191; Mon, 25 Apr 2022 06:45:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkcdgm9Qu/INbawQ6bTu6jiAyghqOn6SgQHz2C+CRn/opFLVzJwiujddaOhsPHzma7sLYcFQ== X-Received: by 2002:a1c:35c7:0:b0:38e:4c59:6788 with SMTP id c190-20020a1c35c7000000b0038e4c596788mr1346033wma.1.1650894303862; Mon, 25 Apr 2022 06:45:03 -0700 (PDT) Received: from ?IPV6:2003:cb:c700:fc00:490d:ed6a:8b22:223a? (p200300cbc700fc00490ded6a8b22223a.dip0.t-ipconnect.de. [2003:cb:c700:fc00:490d:ed6a:8b22:223a]) by smtp.gmail.com with ESMTPSA id m1-20020a1ca301000000b003929c4bf250sm11859636wme.13.2022.04.25.06.45.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 25 Apr 2022 06:45:03 -0700 (PDT) Message-ID: Date: Mon, 25 Apr 2022 15:45:02 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 Subject: Re: [PATCH v3 3/5] memblock tests: update style of comments for memblock_remove_*() functions To: Rebecca Mckeever , outreachy@lists.linux.dev Cc: Mike Rapoport , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <3b83322c070bdd43a33c336d135f485244f107d3.1650633253.git.remckee0@gmail.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <3b83322c070bdd43a33c336d135f485244f107d3.1650633253.git.remckee0@gmail.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: A397AC0028 X-Stat-Signature: j48ud5sjcau5wkqewttzq76kdpc96taa X-Rspam-User: Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ECtOasKE; spf=none (imf22.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-HE-Tag: 1650894306-104123 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: On 22.04.22 15:33, Rebecca Mckeever wrote: > Update comments in memblock_remove_*() functions to match the style used > in tests/alloc_*.c by rewording to make the expected outcome more apparent > and, if more than one memblock is involved, adding a visual of the > memory blocks. > > If the comment has an extra column of spaces, remove the extra space at > the beginning of each line for consistency and to conform to Linux kernel > coding style. > > Signed-off-by: Rebecca Mckeever > --- > tools/testing/memblock/tests/basic_api.c | 101 +++++++++++++++++------ > 1 file changed, 75 insertions(+), 26 deletions(-) > > diff --git a/tools/testing/memblock/tests/basic_api.c b/tools/testing/memblock/tests/basic_api.c > index 75cd7479ee54..08847dc5065e 100644 > --- a/tools/testing/memblock/tests/basic_api.c > +++ b/tools/testing/memblock/tests/basic_api.c > @@ -550,14 +550,21 @@ static int memblock_reserve_checks(void) > return 0; > } > > - /* > - * A simple test that tries to remove the first entry of the array of > - * available memory regions. By "removing" a region we mean overwriting it > - * with the next region in memblock.memory. To check this is the case, the > - * test adds two memory blocks and verifies that the value of the latter > - * was used to erase r1 region. It also checks if the region counter and > - * total size were updated to expected values. > - */ > +/* > + * A simple test that tries to remove the first entry of the array of > + * with the next region in memblock.memory: I failed to parse this sentence "of the array of with". > + * > + * | ...... +----------------+ | > + * | : r1 : | r2 | | > + * +--+----+----------+----------------+--+ > + * ^ > + * | > + * rgn.base > + * > + * Expect to add two memory blocks r1 and r2 and then remove r1 region > + * so that r2 is the first available region. The region counter and > + * total size are updated. > + */ > static int memblock_remove_simple_check(void) > { > struct memblock_region *rgn; > @@ -587,11 +594,22 @@ static int memblock_remove_simple_check(void) > return 0; > } > > - /* > - * A test that tries to remove a region that was not registered as available > - * memory (i.e. has no corresponding entry in memblock.memory). It verifies > - * that array, regions counter and total size were not modified. > - */ > +/* > + * A test that tries to remove a region that was not registered as available > + * memory (i.e. has no corresponding entry in memblock.memory): > + * > + * +----------------+ > + * | r2 | > + * +----------------+ > + * | +----+ | > + * | | r1 | | > + * +--+----+------------------------------+ > + * ^ > + * | > + * rgn.base > + * > + * Expect the array, regions counter and total size to not be modified. > + */ > static int memblock_remove_absent_check(void) > { > struct memblock_region *rgn; > @@ -622,10 +640,21 @@ static int memblock_remove_absent_check(void) > > /* > * A test that tries to remove a region which overlaps with the beginning of Wonder if it makes sense to mention r2 here. ("a region r2 ...") -- to be precise, to always reference r1 and r2 accordingly instead of e.g., "the first entry". Same applies to the other function documentation you touch in this patch. -- Thanks, David / dhildenb