[PATCH 3/3] PCI: microchip: Remove cast between incompatible function type

Conor Dooley conor at kernel.org
Thu Jun 29 13:30:55 PDT 2023


On Thu, Jun 29, 2023 at 04:59:56PM +0000, Krzysztof Wilczyński wrote:
> Rather than casting void(*)(struct clk *) to void (*)(void *), that
> forces conversion to an incompatible function type, replace the cast
> with a small local stub function with a signature that matches what
> the devm_add_action_or_reset() function expects.
> 
> The sub function takes a void *, then passes it directly to
> clk_disable_unprepare(), which handles the more specific type.
> 
> Reported by clang when building with warnings enabled:
> 
>   drivers/pci/controller/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,
>                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> No functional changes are intended.
> 
> Fixes: 6f15a9c9f941 ("PCI: microchip: Add Microchip PolarFire PCIe controller driver")
> Co-developed-by: Daire McNamara <daire.mcnamara at microchip.com>
> Signed-off-by: Daire McNamara <daire.mcnamara at microchip.com>
> Co-developed-by: Simon Horman <horms at kernel.org>
> Signed-off-by: Simon Horman <horms at kernel.org>
> Signed-off-by: Krzysztof Wilczyński <kwilczynski at kernel.org>

This looks to be the same content wise as the patch I previously acked &
effectively the same as the one I previously reviewed - you could have
picked up either of those tags from the other submissions tbh.

Acked-by: Conor Dooley <conor.dooley at microchip.com>

Cheers,
Conor.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-riscv/attachments/20230629/f077d79a/attachment.sig>


More information about the linux-riscv mailing list