[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1jv7s21d8y.fsf@starbuckisacylon.baylibre.com>
Date: Fri, 21 Mar 2025 18:53:49 +0100
From: Jerome Brunet <jbrunet@...libre.com>
To: Stephen Boyd <sboyd@...nel.org>
Cc: Kevin Hilman <khilman@...libre.com>, Martin Blumenstingl
<martin.blumenstingl@...glemail.com>, Michael Turquette
<mturquette@...libre.com>, Neil Armstrong <neil.armstrong@...aro.org>,
linux-clk@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-amlogic@...ts.infradead.org, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v3 1/4] clk: add a clk_hw helpers to get the clock
device or device_node
On Wed 26 Feb 2025 at 17:01, Stephen Boyd <sboyd@...nel.org> wrote:
>> +static void clk_hw_get_of_node_test(struct kunit *test)
>> +{
>> + struct device_node *np;
>> + struct clk_hw *hw;
>> +
>> + hw = kunit_kzalloc(test, sizeof(*hw), GFP_KERNEL);
>> + KUNIT_ASSERT_NOT_ERR_OR_NULL(test, hw);
>> +
>> + np = of_find_compatible_node(NULL, NULL, "test,clk-dummy-device");
>> + hw->init = CLK_HW_INIT_NO_PARENT("test_get_of_node",
>> + &clk_dummy_rate_ops, 0);
>> + of_node_put_kunit(test, np);
>> +
>> + KUNIT_ASSERT_EQ(test, 0, of_clk_hw_register_kunit(test, np, hw));
>
> The stuff before the expectation should likely go to the init function.
> Or it can use the genparams stuff so we can set some struct members to
> indicate if the pointer should be NULL or not and then twist through the
> code a couple times.
>
I'm trying to address all your comments but I'm starting to wonder if
this isn't going a bit too far ? The functions tested are one line
returns. Is it really worth all this ?
I do understand the idea for things that actually do something, such as
reparenting, setting rates or what not ... But this ? It feels like a
lot of test code for very little added value, don't you think ?
--
Jerome
Powered by blists - more mailing lists