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=-11.4 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no 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 61630C32771 for ; Fri, 24 Jan 2020 22:01:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 322C720838 for ; Fri, 24 Jan 2020 22:01:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="VKO5iySR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725821AbgAXWBt (ORCPT ); Fri, 24 Jan 2020 17:01:49 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:32801 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728731AbgAXWBq (ORCPT ); Fri, 24 Jan 2020 17:01:46 -0500 Received: by mail-pl1-f196.google.com with SMTP id ay11so1342470plb.0 for ; Fri, 24 Jan 2020 14:01:45 -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=BFmViv0LWpYCZmRZzBXX+e0FCAJTM0WkywcL3e5bisU=; b=VKO5iySR05BivpDQZf/VKaq5KXC/T0tXr1RXOxM2Cjjz+2DdsYlr12Q19jKOBereBA Nlu9+EGmJw2Ad+dKijIamnqzcecBWtEi2aukIVdIfiK8Fo9SXepfP1CpTyXrn24Ji8M0 66gHlAJsRUvJpWz/ElEPqWt7DwmZ0aSAfW9AAxSmDzZDKF12hx/+yw/GM4I7nm6Qz5Sz o8LNez99DjtBAxQJmSHleGfzM3RFP9Op2Apahq7HW79aRQzo9BYNWyqVYv//HPuTxJVp rAF2oyYaLC9GroGIKw30bqpSIMbPq8G9oboKRKYFkVUd4jLdJod1ttB346M86rIfwZLz dJmQ== 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=BFmViv0LWpYCZmRZzBXX+e0FCAJTM0WkywcL3e5bisU=; b=Go7bK6UyIYV+fvEyWtyeTbPVkNOVBN+d5eKzohTrVidApYkH7z4osIAgSMaowd3Uli fQYyIXqqbrs3Is5YI8S5GjV8D8wo5bDpVGQj4liNm6Uxp4ONJoEzEVDBKBg0MnS8N1It Kdeqq9q/9K0hDc4z0fhD+6F3FuyzOPkUbayckqdObSPl2fNolf44RZXcLZRqVnO5HLIj n5tIq1ckWhORNqrqIjHLYS3LdS/CJI+BlO//H9cD+6RYKiQIyrYfdINfLeGxynBrpV08 /dHSWVBbENN07nAHTxqgi2dHmJr2R85grjHAIbdUvr4U2pEvOqIpb66cg2iHJi0frLeL gIOQ== X-Gm-Message-State: APjAAAUbgnO771MMAfNcP/+JfkxItOu27u4Mo56FcTswV5E/8ijFVlKC NFf+umwkEOg2r6tLUoxL9N62J1Dn9ikqjVkfgnG+NQ== X-Google-Smtp-Source: APXvYqzLJ4DMJP4xsUJ7yoV9hJv9V84tY3jtbZITHm4QWVVh8MDBcRDMqpXCXdzorK9BUvIJ/Al7pvb/nzCerCcaAMg= X-Received: by 2002:a17:90a:c390:: with SMTP id h16mr1511151pjt.131.1579903305086; Fri, 24 Jan 2020 14:01:45 -0800 (PST) MIME-Version: 1.0 References: <20200124194507.34121-1-davidgow@google.com> In-Reply-To: <20200124194507.34121-1-davidgow@google.com> From: Brendan Higgins Date: Fri, 24 Jan 2020 14:01:34 -0800 Message-ID: Subject: Re: [PATCH] Fix linked-list KUnit test when run multiple times To: David Gow Cc: shuah , KUnit Development , "open list:KERNEL SELFTEST FRAMEWORK" , Linux Kernel Mailing List , Alan Maguire Content-Type: text/plain; charset="UTF-8" Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org On Fri, Jan 24, 2020 at 11:46 AM David Gow wrote: > > A few of the lists used in the linked-list KUnit tests (the > for_each_entry{,_reverse} tests) are declared 'static', and so are > not-reinitialised if the test runs multiple times. This was not a > problem when KUnit tests were run once on startup, but when tests are > able to be run manually (e.g. from debugfs[1]), this is no longer the > case. > > Making these lists no longer 'static' causes the lists to be > reinitialised, and the test passes each time it is run. While there may > be some value in testing that initialising static lists works, the > for_each_entry_* tests are unlikely to be the right place for it. Oh good, I am glad we are getting rid of those static variables. (I thought we already dropped those - whoops.) I think this drops this last of them, can you confirm David? Regardless, this patch looks good to me. > Signed-off-by: David Gow Reviewed-by: Brendan Higgins Thanks for taking care of this!