From: Jerome Brunet <jbrunet@baylibre.com>
To: Stephen Boyd <sboyd@kernel.org>
Cc: Kevin Hilman <khilman@baylibre.com>,
Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
Michael Turquette <mturquette@baylibre.com>,
Neil Armstrong <neil.armstrong@linaro.org>,
linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-amlogic@lists.infradead.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v3 1/4] clk: add a clk_hw helpers to get the clock device or device_node
Date: Fri, 21 Mar 2025 18:53:49 +0100 [thread overview]
Message-ID: <1jv7s21d8y.fsf@starbuckisacylon.baylibre.com> (raw)
In-Reply-To: <508a5ee6c6b365e8d9cdefd5a9eec769.sboyd@kernel.org> (Stephen Boyd's message of "Wed, 26 Feb 2025 17:01:05 -0800")
On Wed 26 Feb 2025 at 17:01, Stephen Boyd <sboyd@kernel.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
next prev parent reply other threads:[~2025-03-21 17:53 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-20 17:15 [PATCH v3 0/4] clk: amlogic: drop clk_regmap tables Jerome Brunet
2025-01-20 17:15 ` [PATCH v3 1/4] clk: add a clk_hw helpers to get the clock device or device_node Jerome Brunet
2025-02-27 1:01 ` Stephen Boyd
2025-02-27 10:07 ` Jerome Brunet
2025-02-27 20:07 ` Stephen Boyd
2025-03-21 17:53 ` Jerome Brunet [this message]
2025-03-25 21:57 ` Stephen Boyd
2025-03-27 10:07 ` Jerome Brunet
2025-01-20 17:15 ` [PATCH v3 2/4] clk: amlogic: get regmap with clk_regmap_init Jerome Brunet
2025-01-22 11:28 ` Dmitry Rokosov
2025-01-20 17:15 ` [PATCH v3 3/4] clk: amlogic: drop clk_regmap tables Jerome Brunet
2025-01-22 11:27 ` Dmitry Rokosov
2025-01-20 17:15 ` [PATCH v3 4/4] clk: amlogic: s4: remove unused data Jerome Brunet
2025-01-21 2:49 ` Chuan Liu
2025-02-05 14:59 ` [PATCH v3 0/4] clk: amlogic: drop clk_regmap tables Jerome Brunet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1jv7s21d8y.fsf@starbuckisacylon.baylibre.com \
--to=jbrunet@baylibre.com \
--cc=khilman@baylibre.com \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.blumenstingl@googlemail.com \
--cc=mturquette@baylibre.com \
--cc=neil.armstrong@linaro.org \
--cc=sboyd@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox