Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1026192ybl; Fri, 24 Jan 2020 14:04:25 -0800 (PST) X-Google-Smtp-Source: APXvYqxHfHEYL0bgRcJVHE+WeBbonm7AANVHO9BBHn/y+71dbymIU8VggGvey7pme3nFmYBFDpLU X-Received: by 2002:a05:6830:18ce:: with SMTP id v14mr4264066ote.36.1579903465595; Fri, 24 Jan 2020 14:04:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579903465; cv=none; d=google.com; s=arc-20160816; b=D1OWZCAjUD2KJSVZLHhv7JJ646QLecmtr48bh3yjIGkj2k9ub+Z+DXpSRifT5kt1/P kiSV5e/borO2lk3NqBTKdkTpu+bxY3SfkHq6d4gvbA7Gt7T+aDBnO8Od/zsSbPg+929B 7ir6y58O5h/y1UKrKti7wayl/mOrQXqtLiUEQVcODt2SDnO0Te/XzN+2B6h8rTiYZQke /4Bd9krHrS6a9vAEbauinFG8emIX1s+G+uzKXOoNHZ9n4a69wWmjYlDfTsVIafivfKO4 2t/51/6094zSZ3K9LB6ov1/Xoa14cUqaY6W7RFw6IYv5DZJiV70Xs/tVP3/x++d2A+hl bN+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=BFmViv0LWpYCZmRZzBXX+e0FCAJTM0WkywcL3e5bisU=; b=oA180uSkNzqHqC9RyR2iTbHt0U8/xurqbzB/WsX7+nh244rTQZdx6+AlCtyBCIttvl DCwoySRaSs23h2wlOdoKL3shCKr9CQ9QWz1tJNB9SN6zBAk6KDgasKHFnRlnKimQh27K 2hzCe41L4V5SYM3hlzGuTl7BODjpK/azj96MKMGfwfwuECuQZcZZSpHQRaMnv/97vC5N /YO6JHFKnHBjkGQ6Mzt0aN771PfTYNADhM1T7zVx6HA7zaMnmtjDEElyBM8F6rPPc4QP guB+SVx8ojEb99SkN7aeKTwzxE5m11Jj9+/MRDBplYo7m2l9AlbgH3ugWjrRiLh/+9Kt M4Jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=VKO5iySR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v20si402779oia.159.2020.01.24.14.04.12; Fri, 24 Jan 2020 14:04:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=VKO5iySR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728921AbgAXWBq (ORCPT + 99 others); Fri, 24 Jan 2020 17:01:46 -0500 Received: from mail-pj1-f67.google.com ([209.85.216.67]:34352 "EHLO mail-pj1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725821AbgAXWBq (ORCPT ); Fri, 24 Jan 2020 17:01:46 -0500 Received: by mail-pj1-f67.google.com with SMTP id f2so880571pjq.1 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=NVtVHQ9eaugSzo4fKYLuQlcaDo8VhFjw7IteYBYV1S1FbCrXrSUkQ8X/gNZs0z3wGA ubuNCdzX6cwU59zl+2y+Ywahk5tuT9DlA87WNwdn1yKHexiwmR6+SPaA1QffoFhxmina BSTtbFTlrp3Nk0LrinO4zyei8vcIEMTI0bu7KxX2Lm+d/88STcCw9IUSpBz/atNhpuk4 3hOTSozMhqMEP1idhDkHbA8Q4ordgEUN/XUOWcQcfnLbwv6ADGtJ0d0+J9JmdVbOkgrq hctpp9jfJFLZGbvDoOrDZ0ipCD+FIISBa/zFkimevKelRZbhDNsUo2yfg41X4ZAvvyby l6iA== X-Gm-Message-State: APjAAAUqyTQ9/wjawnDuyDr3ZqInT4aB6DBBfTCW/lsdc8WLb8GB1Any nwGFV2ij/+p1V8kdS/QFmBk0NA2UxuljxHlNhc7mDw== 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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!