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 X-Spam-Level: X-Spam-Status: No, score=-23.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA380C433E0 for ; Tue, 12 Jan 2021 07:53:37 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6421022E00 for ; Tue, 12 Jan 2021 07:53:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6421022E00 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9DA008D006E; Tue, 12 Jan 2021 02:53:36 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 963158D0051; Tue, 12 Jan 2021 02:53:36 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 82ADC8D006E; Tue, 12 Jan 2021 02:53:36 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0176.hostedemail.com [216.40.44.176]) by kanga.kvack.org (Postfix) with ESMTP id 692058D0051 for ; Tue, 12 Jan 2021 02:53:36 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 337C1180AD806 for ; Tue, 12 Jan 2021 07:53:36 +0000 (UTC) X-FDA: 77696358432.26.screw08_5012fef27513 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin26.hostedemail.com (Postfix) with ESMTP id 1FD181804B667 for ; Tue, 12 Jan 2021 07:53:36 +0000 (UTC) X-HE-Tag: screw08_5012fef27513 X-Filterd-Recvd-Size: 4754 Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) by imf03.hostedemail.com (Postfix) with ESMTP for ; Tue, 12 Jan 2021 07:53:35 +0000 (UTC) Received: by mail-qk1-f177.google.com with SMTP id c7so1169191qke.1 for ; Mon, 11 Jan 2021 23:53:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mGCAtyq15j5iLbAyhIjgwA3t0EKUEm8gTtrvCf4O7jE=; b=VcB+5Bvj/ofJcXzkKhp77cob5rnsxkzexfwEJOngzvRnRecyLQUXAIbrwPwzj506Be y3L1S5y5m44HWw8JN3cmOpeJ8O+2+Wd0NLUmfAWCKak27ouvHG3G+AIUKAUtTrN0fppm +EtfI4ldLLfUQr2GU/G1KNEfw7qHhyuReFqwhzHU42ClLbGKQDpAQRWTbf7IxHfK2BZf GrTgZFqhs/xLCwOhvMeVU1NWhTQgMBMEl8jIzt4s4GWWZNnRW39B7RKu5G+7ivhHaOze MFxAoVdjzH4XQbx76qPwKDkemgIYI60UdlzBjKnVCyE73yLsZ9t6wKsH0aHil5eNfnul aviQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=mGCAtyq15j5iLbAyhIjgwA3t0EKUEm8gTtrvCf4O7jE=; b=iNfLEpKf8QzBApu68MmL4ZYguYDOeOmoil85CybU1mZVFcceKLpWuli8yjLHxLjsPl e00Igdn+a1iG7P5voOJdSR1KWSBLFfM3wt0J3TjteRtpocu42SUO2Bn+dVF8qLvu/EBi ejv2lwJHeK6VA3kRI6D3DjgganIVYb+LXf4Fbs54AB1UfOEQtakEjopUj2M2ihoNzzXI PVJe7CjisSNtBP4+O0RDQ5ZhCkA31ywJ6glf8WfN8zxPL6ie5mXLX9KTkbQlMreVqWyx eEXqiRKbIr8EcCfWLwBIVr9a15+Xap+p21RYUo3jWsaCJGzns+rPghfZuLllUlnLR+FG kQbA== X-Gm-Message-State: AOAM532ZsZrwFZnfCiZhs8IWSS5efyyb7XczIIGnlUgt0oXY01yS1gez h8qI1w0Ut9Qrt2aupvoTfeMeVISNNUV2IryH1HVD5g== X-Google-Smtp-Source: ABdhPJxKeO3yf8gX2ix6pPQZam2M1Q3zyFWoMsaCr5u8zLo/CrTR7MPDM49aEmBX/1ACLC6VwPF8L+gKK62yeZUuWHQ= X-Received: by 2002:a37:a747:: with SMTP id q68mr3233844qke.352.1610438014849; Mon, 11 Jan 2021 23:53:34 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Alexander Potapenko Date: Tue, 12 Jan 2021 08:53:22 +0100 Message-ID: Subject: Re: [PATCH 03/11] kasan: clean up comments in tests To: Andrey Konovalov Cc: Catalin Marinas , Vincenzo Frascino , Dmitry Vyukov , Marco Elver , Andrew Morton , Will Deacon , Andrey Ryabinin , Evgenii Stepanov , Branislav Rankov , Kevin Brodsky , kasan-dev , Linux ARM , Linux Memory Management List , LKML Content-Type: text/plain; charset="UTF-8" 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 Tue, Jan 5, 2021 at 7:28 PM Andrey Konovalov wrote: > > Clarify and update comments and info messages in KASAN tests. > > Signed-off-by: Andrey Konovalov > Link: https://linux-review.googlesource.com/id/I6c816c51fa1e0eb7aa3dead6bda1f339d2af46c8 > void *kasan_ptr_result; > int kasan_int_result; Shouldn't these two variables be static, by the way? > > @@ -39,14 +38,13 @@ static struct kunit_resource resource; > static struct kunit_kasan_expectation fail_data; > static bool multishot; > > +/* > + * Temporarily enable multi-shot mode. Otherwise, KASAN would only report the > + * first detected bug and panic the kernel if panic_on_warn is enabled. > + */ YMMV, but I think this comment was at its place already. > static int kasan_test_init(struct kunit *test) > { > - /* > - * Temporarily enable multi-shot mode and set panic_on_warn=0. > - * Otherwise, we'd only get a report for the first case. > - */ > multishot = kasan_save_enable_multi_shot(); Unrelated to this change, but have you considered storing test-specific data in test->priv instead of globals? > if (!IS_ENABLED(CONFIG_SLUB)) { > - kunit_info(test, "CONFIG_SLUB is not enabled."); > + kunit_info(test, "skipping, CONFIG_SLUB required"); > return; > } You may want to introduce a macro that takes a config name and prints the warning/returns if it's not enabled. Alex