Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3762941rdh; Tue, 28 Nov 2023 03:17:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IHFRNHTOfrc9wqpM28m6BbkqK9596w4qv7Cw6F4H4GI8bm+c4bV+0mr4EVD3i9sre5BoBLv X-Received: by 2002:a05:6a20:3944:b0:18b:3168:d1a1 with SMTP id r4-20020a056a20394400b0018b3168d1a1mr17113802pzg.46.1701170251613; Tue, 28 Nov 2023 03:17:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701170251; cv=none; d=google.com; s=arc-20160816; b=u5rup7Z/jnoOm556t0yzUg/EaM8fe0Khj9isU9D/M3iunOKdWe28h4rT89mK4r8oYq 2+bD0TbsAcyk89kJLfwk9JjIaBL5FqXam6HDUvQ56yqcFbnluTz9eCWuCgJ8TBNzMPy1 pQfVODmfhz45BzTF9U9TXsEFCHb4m/fvYCSLnHH4tTVR/lgDzoEsfJbqVLvKwbLOYfEJ geSKrJZCePX3yx66jntpOQ/iEcLwmnokacIfDJe9HieG5V4/Ij+O40haVZ+ZpfS7Kvpl /Q7CuK4Runl4MnKZ2avkzu5AvecnFr0lrI/tHRbfE9PLijazXQRX4v1ctthBEkMo8CCQ xDXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=XwvmjFErIGzwz5go6JPDHcyZkRWLzYD3EQT1Kkemfnk=; fh=2k3bnimT9JidQFtJldiwlq39/rg0DtpC9DSGaw5DYXE=; b=Qw+8QBugJfBQCob6teEzhrnoQXF1T9rPzxPkIfhBvHypM9xj76vg3cy8BPgkiLUbk3 0oTloFKOLadrRn/Z90rZTQusgEUkf580AVo2RbD4ldjScZDxTI66GW29NqiVQGfQZvby EcZ26l5Nj0cDWzGTAnKnnSl4b1iHoyEnaexz5Q9zfIKf13wrmyZu96E7eFmzxWIH1H2V Y5so8hTLMmPQQ3B3Hr2vPES042ioOl1IEaW/FqLehTKmP8kCNUmfRokkYxcDEKwgNA3a eKAPoKJs+YrqnBzyiLhz6K+1Cf9bnuwSAPDI+YzYaG9uy41eQPOMpqiw4gfcNCR3kXSF U+KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=R5ipbPuS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id g18-20020a056a000b9200b006cd8b66565esi5023704pfj.282.2023.11.28.03.17.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 03:17:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=R5ipbPuS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 7F0B3809B9CD; Tue, 28 Nov 2023 03:15:54 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344124AbjK1LPa (ORCPT + 99 others); Tue, 28 Nov 2023 06:15:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344466AbjK1LP0 (ORCPT ); Tue, 28 Nov 2023 06:15:26 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FB93D45 for ; Tue, 28 Nov 2023 03:15:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701170132; 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: in-reply-to:in-reply-to:references:references; bh=XwvmjFErIGzwz5go6JPDHcyZkRWLzYD3EQT1Kkemfnk=; b=R5ipbPuSxoGIKeAJBMo23ZqzY10ucnIO0/ZLyl4sYD5KCVqCgwZH6qTTsIEQyEeGnY//Ot qdFPmHA7qVikz9FvVDmgJcFGiGfGl4eEbVEc88Cg+xbsioTdQi7lf4f3bxJtnpdXbz8fhF LikeIomTseoMFt4B+TZ3KunrK/RpqoY= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-146-Vw6gbMdWNmKimPGBH-G8Xg-1; Tue, 28 Nov 2023 06:15:31 -0500 X-MC-Unique: Vw6gbMdWNmKimPGBH-G8Xg-1 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-40b38501d82so27972075e9.3 for ; Tue, 28 Nov 2023 03:15:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701170130; x=1701774930; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=XwvmjFErIGzwz5go6JPDHcyZkRWLzYD3EQT1Kkemfnk=; b=A7TaBLhtDr9DRgRDdgso8XhmAQLflcRBxQClP7UCdV59u1eMuexXsmKy6m4Or9Vz4u 8wUFDJi1n2Rim5F0TO+2ASd42ALPwBuPsDG1bA50PjQHg9RzNa4cpN7HQl8AD/Xi2trF IOLU7EM/CkhxKGtvixAADrzOKl0dke1e5n3qUwHmQV4f14/+3aYuojYtNRbxkzs4XO66 lZOrX/D66PzuelIeW6SvFjwogy4ftmZ9Gd/zRP3zlbS7ue0BvmukHeCJMNxWzJsaPztr 6LVaodkCL0zX/bPGptf1o33BIoRHOuBpnpbP6OG6NUqT0fCbwsIymDtRUvjCIvVa9ugx TxQQ== X-Gm-Message-State: AOJu0Yy3KdU5YpBqoxAAOwEB2AANAQLxdHtBfE3bsZOGGyhTPBrUcykW 4/rbt/fPzFIX4QExXqEVfW8fTq5WcrFT2Fa7oFRWcJy2B5oc8NtWHc/YfmAX+aUw2/jgVS3gzcs pf7Ykt/J4vpkjzwxuC13USJ1R X-Received: by 2002:a05:600c:46ce:b0:405:37bb:d942 with SMTP id q14-20020a05600c46ce00b0040537bbd942mr11304279wmo.4.1701170129913; Tue, 28 Nov 2023 03:15:29 -0800 (PST) X-Received: by 2002:a05:600c:46ce:b0:405:37bb:d942 with SMTP id q14-20020a05600c46ce00b0040537bbd942mr11304257wmo.4.1701170129524; Tue, 28 Nov 2023 03:15:29 -0800 (PST) Received: from localhost (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id m8-20020a05600c4f4800b0040b347d90d0sm17744555wmq.12.2023.11.28.03.15.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 03:15:29 -0800 (PST) From: Javier Martinez Canillas To: Marco Pagani , Brendan Higgins , David Gow , Rae Moar , Jinjie Ruan , Shuah Khan Cc: Marco Pagani , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] kunit: run test suites only after module initialization completes In-Reply-To: <20231128101627.65399-1-marpagan@redhat.com> References: <20231128101627.65399-1-marpagan@redhat.com> Date: Tue, 28 Nov 2023 12:15:28 +0100 Message-ID: <878r6icenj.fsf@minerva.mail-host-address-is-not-set> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Tue, 28 Nov 2023 03:15:54 -0800 (PST) Marco Pagani writes: Hello Marco, [...] > @@ -737,12 +738,14 @@ static void kunit_module_exit(struct module *mod) > }; > const char *action = kunit_action(); > > + if (!suite_set.start || !virt_addr_valid(suite_set.start)) > + return; > + I would add a comment here explaining why this condition is checked and what it means. Maybe something like the following ? + /* + * Check if the kunit test suite start address is a virtual + * address or a direct mapping address. This is used as an + * indication of whether the kunit_filter_suites() was used + * to filter the kunit test suite or not. + * + * If is not a virtual address, then this means that the + * kunit_module_init() function was not called and the kunit + * suite was not filtered. Let's just bail out in that case. + */ + if (!suite_set.start || !virt_addr_valid(suite_set.start)) + return; The patch makes sense to me though and agree that is a better approach. Reviewed-by: Javier Martinez Canillas -- Best regards, Javier Martinez Canillas Core Platforms Red Hat