From: Conor Dooley <conor@kernel.org>
To: Simon Horman <horms@kernel.org>
Cc: "Bjorn Helgaas" <bhelgaas@google.com>,
"Daire McNamara" <daire.mcnamara@microchip.com>,
"Conor Dooley" <conor.dooley@microchip.com>,
"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Krzysztof Wilczyński" <kw@linux.com>,
"Rob Herring" <robh@kernel.org>,
"Nathan Chancellor" <nathan@kernel.org>,
"Nick Desaulniers" <ndesaulniers@google.com>,
"Tom Rix" <trix@redhat.com>,
linux-riscv@lists.infradead.org, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org, llvm@lists.linux.dev
Subject: Re: [PATCH] PCI: microchip: Avoid cast to incompatible function type
Date: Thu, 11 May 2023 16:30:52 +0100 [thread overview]
Message-ID: <20230511-coming-saturate-a2ae32462a3a@spud> (raw)
In-Reply-To: <20230511-pci-microchip-clk-cast-v1-1-7674f4d4e218@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 2547 bytes --]
On Thu, May 11, 2023 at 05:24:18PM +0200, Simon Horman wrote:
> Rather than casting clk_disable_unprepare to an incompatible function type,
> update the type to match that expected by devm_add_action_or_reset.
>
> Reported by clang-16 with W-1:
>
> .../pcie-microchip-host.c:866:32: warning: cast from 'void (*)(struct clk *)' to 'void (*)(void *)' converts to incompatible function type [-Wcast-function-type-strict]
> devm_add_action_or_reset(dev, (void (*) (void *))clk_disable_unprepare,
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ./include/linux/device.h:265:38: note: expanded from macro 'devm_add_action_or_reset'
> __devm_add_action_or_reset(release, action, data, #action)
> ^~~~~~
> No functional change intended.
> Compile tested only.
>
Yeah, there's already a patch for this:
https://lore.kernel.org/linux-pci/20230111125323.1911373-3-daire.mcnamara@microchip.com/
The lads didn't want to pick any of that piecemeal & Daire hasn't been
able to get back to that work until this week.
I don't think we an ETA though on a v4, so:
Fixes: 6f15a9c9f941 ("PCI: microchip: Add Microchip PolarFire PCIe controller driver")
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
and I don't know if you wanna propagate the:
| Reported-by: kernel test robot <lkp@intel.com>
Thanks,
Conor.
> Signed-off-by: Simon Horman <horms@kernel.org>
> ---
> drivers/pci/controller/pcie-microchip-host.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/controller/pcie-microchip-host.c b/drivers/pci/controller/pcie-microchip-host.c
> index 5e710e485464..d8aa6e3cdbff 100644
> --- a/drivers/pci/controller/pcie-microchip-host.c
> +++ b/drivers/pci/controller/pcie-microchip-host.c
> @@ -848,6 +848,11 @@ static const struct irq_domain_ops event_domain_ops = {
> .map = mc_pcie_event_map,
> };
>
> +inline void mc_clk_disable_unprepare(void *data)
> +{
> + clk_disable_unprepare(data);
> +}
> +
> static inline struct clk *mc_pcie_init_clk(struct device *dev, const char *id)
> {
> struct clk *clk;
> @@ -863,8 +868,7 @@ static inline struct clk *mc_pcie_init_clk(struct device *dev, const char *id)
> if (ret)
> return ERR_PTR(ret);
>
> - devm_add_action_or_reset(dev, (void (*) (void *))clk_disable_unprepare,
> - clk);
> + devm_add_action_or_reset(dev, mc_clk_disable_unprepare, clk);
>
> return clk;
> }
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
prev parent reply other threads:[~2023-05-11 15:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-11 15:24 Simon Horman
2023-05-11 15:30 ` Conor Dooley [this message]
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=20230511-coming-saturate-a2ae32462a3a@spud \
--to=conor@kernel.org \
--cc=bhelgaas@google.com \
--cc=conor.dooley@microchip.com \
--cc=daire.mcnamara@microchip.com \
--cc=horms@kernel.org \
--cc=kw@linux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=llvm@lists.linux.dev \
--cc=lpieralisi@kernel.org \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=robh@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
all inboxes | Powered by JetHome®