From: Nathan Chancellor <nathan@kernel.org>
To: Simon Horman <horms@kernel.org>
Cc: Nishanth Menon <nm@ti.com>,
Santosh Shilimkar <ssantosh@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Tom Rix <trix@redhat.com>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, llvm@lists.linux.dev
Subject: Re: [PATCH] soc: ti: pruss: Avoid cast to incompatible function type
Date: Tue, 18 Apr 2023 11:44:55 -0700 [thread overview]
Message-ID: <20230418184455.GC2635379@dev-arch.thelio-3990X> (raw)
In-Reply-To: <20230418-pruss-clk-cb-v1-1-549a7e7febe4@kernel.org>
On Tue, Apr 18, 2023 at 01:41:48PM +0200, Simon Horman wrote:
> Rather than casting clk_unregister_mux to an incompatible function
> type provide a trivial wrapper with the correct signature for the
> use-case.
>
> Reported by clang-16 with W=1:
>
> drivers/soc/ti/pruss.c:158:38: error: cast from 'void (*)(struct clk *)' to 'void (*)(void *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict]
> ret = devm_add_action_or_reset(dev, (void(*)(void *))clk_unregister_mux,
>
> No functional change intended.
> Compile tested only.
>
> Signed-off-by: Simon Horman <horms@kernel.org>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
> ---
> drivers/soc/ti/pruss.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/soc/ti/pruss.c b/drivers/soc/ti/pruss.c
> index 6882c86b3ce5..e68441bd7b30 100644
> --- a/drivers/soc/ti/pruss.c
> +++ b/drivers/soc/ti/pruss.c
> @@ -38,6 +38,11 @@ static void pruss_of_free_clk_provider(void *data)
> of_node_put(clk_mux_np);
> }
>
> +static void pruss_clk_unregister_mux(void *data)
> +{
> + clk_unregister_mux(data);
> +}
> +
> static int pruss_clk_mux_setup(struct pruss *pruss, struct clk *clk_mux,
> char *mux_name, struct device_node *clks_np)
> {
> @@ -93,8 +98,7 @@ static int pruss_clk_mux_setup(struct pruss *pruss, struct clk *clk_mux,
> goto put_clk_mux_np;
> }
>
> - ret = devm_add_action_or_reset(dev, (void(*)(void *))clk_unregister_mux,
> - clk_mux);
> + ret = devm_add_action_or_reset(dev, pruss_clk_unregister_mux, clk_mux);
> if (ret) {
> dev_err(dev, "failed to add clkmux unregister action %d", ret);
> goto put_clk_mux_np;
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-04-18 18:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-18 11:41 [PATCH] soc: ti: pruss: Avoid cast to incompatible function type Simon Horman
2023-04-18 18:44 ` Nick Desaulniers
2023-04-19 5:45 ` Simon Horman
2023-04-18 18:44 ` Nathan Chancellor [this message]
2023-04-20 5:49 ` Md Danish Anwar
2023-05-17 17:55 ` Nishanth Menon
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=20230418184455.GC2635379@dev-arch.thelio-3990X \
--to=nathan@kernel.org \
--cc=horms@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=ndesaulniers@google.com \
--cc=nm@ti.com \
--cc=ssantosh@kernel.org \
--cc=trix@redhat.com \
/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