Skip to content

Commit 7a65316

Browse files
committed
PCI: keembay: Remove cast between incompatible function type
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/dwc/pcie-keembay.c:172:12: warning: cast from 'void (*)(struct clk *)' to 'void (*)(void *)' converts to incompatible function type [-Wcast-function-type-strict] (void(*)(void *))clk_disable_unprepare, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ No functional changes are intended. Fixes: 0c87f90 ("PCI: keembay: Add support for Intel Keem Bay") Link: https://lore.kernel.org/linux-pci/20230629165956.237832-2-kwilczynski@kernel.org Acked-by: Srikanth Thokala <srikanth.thokala@intel.com> Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
1 parent 1a8bf35 commit 7a65316

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

drivers/pci/controller/dwc/pcie-keembay.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,13 @@ static const struct dw_pcie_ops keembay_pcie_ops = {
148148
.stop_link = keembay_pcie_stop_link,
149149
};
150150

151+
static inline void keembay_pcie_disable_clock(void *data)
152+
{
153+
struct clk *clk = data;
154+
155+
clk_disable_unprepare(clk);
156+
}
157+
151158
static inline struct clk *keembay_pcie_probe_clock(struct device *dev,
152159
const char *id, u64 rate)
153160
{
@@ -168,9 +175,7 @@ static inline struct clk *keembay_pcie_probe_clock(struct device *dev,
168175
if (ret)
169176
return ERR_PTR(ret);
170177

171-
ret = devm_add_action_or_reset(dev,
172-
(void(*)(void *))clk_disable_unprepare,
173-
clk);
178+
ret = devm_add_action_or_reset(dev, keembay_pcie_disable_clock, clk);
174179
if (ret)
175180
return ERR_PTR(ret);
176181

0 commit comments

Comments
 (0)