[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CABVgOSnTpn+qJPcXfZ4o=fP=+NrL+WO2TyHhpdMLzGj-g5M_rA@mail.gmail.com>
Date: Mon, 6 Nov 2023 10:08:04 -0800
From: David Gow <davidgow@...gle.com>
To: Richard Fitzgerald <rf@...nsource.cirrus.com>
Cc: brendan.higgins@...ux.dev, rmoar@...gle.com,
linux-kselftest@...r.kernel.org, kunit-dev@...glegroups.com,
linux-kernel@...r.kernel.org, patches@...nsource.cirrus.com,
kernel test robot <lkp@...el.com>
Subject: Re: [PATCH v2] kunit: test: Avoid cast warning when adding kfree() as
an action
On Mon, 6 Nov 2023 at 09:26, Richard Fitzgerald
<rf@...nsource.cirrus.com> wrote:
>
> In kunit_log_test() pass the kfree_wrapper() function to kunit_add_action()
> instead of directly passing kfree().
>
> This prevents a cast warning:
>
> lib/kunit/kunit-test.c:565:25: warning: cast from 'void (*)(const void *)'
> to 'kunit_action_t *' (aka 'void (*)(void *)') converts to incompatible
> function type [-Wcast-function-type-strict]
>
> 564 full_log = string_stream_get_string(test->log);
> > 565 kunit_add_action(test, (kunit_action_t *)kfree, full_log);
>
> Signed-off-by: Richard Fitzgerald <rf@...nsource.cirrus.com>
> Reported-by: kernel test robot <lkp@...el.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202311070041.kWVYx7YP-lkp@intel.com/
> Fixes: 05e2006ce493 ("kunit: Use string_stream for test log")
> ---
Looks good to me, thanks!
Reviewed-by: David Gow <davidgow@...gle.com>
Cheers,
-- David
Download attachment "smime.p7s" of type "application/pkcs7-signature" (4003 bytes)
Powered by blists - more mailing lists