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=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable 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 DB2FBC48BE8 for ; Mon, 14 Jun 2021 06:42:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AAB0B60FE4 for ; Mon, 14 Jun 2021 06:42:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232390AbhFNGoM (ORCPT ); Mon, 14 Jun 2021 02:44:12 -0400 Received: from verein.lst.de ([213.95.11.211]:42971 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232096AbhFNGoK (ORCPT ); Mon, 14 Jun 2021 02:44:10 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 7AC2D67373; Mon, 14 Jun 2021 08:42:05 +0200 (CEST) Date: Mon, 14 Jun 2021 08:42:05 +0200 From: Christoph Hellwig To: =?iso-8859-1?Q?Andr=E9?= Almeida Cc: Christoph Hellwig , Andy Shevchenko , linux-kernel@vger.kernel.org, Brendan Higgins , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Shuah Khan , ~lkcamp/patches@lists.sr.ht, nfraprado@collabora.com, leandro.ribeiro@collabora.com, Vitor Massaru Iha , lucmaga@gmail.com, David Gow , Daniel Latypov , tales.aparecida@gmail.com Subject: Re: [PATCH v3 1/1] lib: Convert UUID runtime test to KUnit Message-ID: <20210614064205.GA29220@lst.de> References: <20210610163959.71634-1-andrealmeid@collabora.com> <20210610163959.71634-2-andrealmeid@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210610163959.71634-2-andrealmeid@collabora.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > +config UUID_KUNIT_TEST > + tristate "Unit test for UUID" if !KUNIT_ALL_TESTS > + depends on KUNIT > + default KUNIT_ALL_TESTS > + help > + This builds the UUID unit test. Does this first help line really add any value if we have this second line: > + Tests parsing functions for UUID/GUID strings. ? > + If unsure, say N. Not specific to this case, but IMHO we can drop this line for all kunit tests as it is completely obvious. > @@ -354,5 +353,6 @@ obj-$(CONFIG_LIST_KUNIT_TEST) += list-test.o > obj-$(CONFIG_LINEAR_RANGES_TEST) += test_linear_ranges.o > obj-$(CONFIG_BITS_TEST) += test_bits.o > obj-$(CONFIG_CMDLINE_KUNIT_TEST) += cmdline_kunit.o > +obj-$(CONFIG_UUID_KUNIT_TEST) += test_uuid.o Another meta-comment on the kunit tests: Wouldn't it make more sense to name them all as CONFIG_KUNIT_TEST_FOO to allow for easier grepping? > -struct test_uuid_data { > +struct test_data { > const char *uuid; > guid_t le; > uuid_t be; > }; > > -static const struct test_uuid_data test_uuid_test_data[] = { > +static const struct test_data correct_data[] = { What is the reason for these renames? Is this a pattern used for other kunit tests? > +static void uuid_correct_le(struct kunit *test) > { > + guid_t le; > + const struct test_data *data = (const struct test_data *)(test->param_value); Overly long line. But as far as I can tell there is no need for the case that causes this mess anyway given that param_value is a "const void *". Same for all the other instances of this. > +static void uuid_wrong_le(struct kunit *test) > { > guid_t le; > + const char **data = (const char **)(test->param_value); No need for the second pair of braces. Same for various other instances.