From: Arnd Bergmann <arnd@kernel.org>
To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
Neil Armstrong <neil.armstrong@linaro.org>,
Kevin Hilman <khilman@baylibre.com>,
Jerome Brunet <jbrunet@baylibre.com>,
Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Bill Wendling <morbo@google.com>,
Justin Stitt <justinstitt@google.com>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
linux-arm-kernel@lists.infradead.org,
linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org,
llvm@lists.linux.dev
Subject: [PATCH] nvmem: meson-efuse: fix function pointer type mismatch
Date: Tue, 13 Feb 2024 11:15:47 +0100 [thread overview]
Message-ID: <20240213101607.460930-1-arnd@kernel.org> (raw)
From: Arnd Bergmann <arnd@arndb.de>
clang-16 warns about casting functions to incompatible types, as is done
here to call clk_disable_unprepare:
drivers/nvmem/meson-efuse.c:78:12: error: cast from 'void (*)(struct clk *)' to 'void (*)(void *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict]
78 | (void(*)(void *))clk_disable_unprepare,
Address this with a trivial helper function that adjusts the return code.
Fixes: 611fbca1c861 ("nvmem: meson-efuse: add peripheral clock")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/nvmem/meson-efuse.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/nvmem/meson-efuse.c b/drivers/nvmem/meson-efuse.c
index b922df99f9bc..3b9e31d7d073 100644
--- a/drivers/nvmem/meson-efuse.c
+++ b/drivers/nvmem/meson-efuse.c
@@ -38,6 +38,11 @@ static const struct of_device_id meson_efuse_match[] = {
};
MODULE_DEVICE_TABLE(of, meson_efuse_match);
+static void meson_efuse_clk_disable(void *clk)
+{
+ clk_disable_unprepare(clk);
+}
+
static int meson_efuse_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
@@ -74,9 +79,7 @@ static int meson_efuse_probe(struct platform_device *pdev)
return ret;
}
- ret = devm_add_action_or_reset(dev,
- (void(*)(void *))clk_disable_unprepare,
- clk);
+ ret = devm_add_action_or_reset(dev, meson_efuse_clk_disable, clk);
if (ret) {
dev_err(dev, "failed to add disable callback");
return ret;
--
2.39.2
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd@kernel.org>
To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
Neil Armstrong <neil.armstrong@linaro.org>,
Kevin Hilman <khilman@baylibre.com>,
Jerome Brunet <jbrunet@baylibre.com>,
Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Bill Wendling <morbo@google.com>,
Justin Stitt <justinstitt@google.com>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
linux-arm-kernel@lists.infradead.org,
linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org,
llvm@lists.linux.dev
Subject: [PATCH] nvmem: meson-efuse: fix function pointer type mismatch
Date: Tue, 13 Feb 2024 11:15:47 +0100 [thread overview]
Message-ID: <20240213101607.460930-1-arnd@kernel.org> (raw)
From: Arnd Bergmann <arnd@arndb.de>
clang-16 warns about casting functions to incompatible types, as is done
here to call clk_disable_unprepare:
drivers/nvmem/meson-efuse.c:78:12: error: cast from 'void (*)(struct clk *)' to 'void (*)(void *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict]
78 | (void(*)(void *))clk_disable_unprepare,
Address this with a trivial helper function that adjusts the return code.
Fixes: 611fbca1c861 ("nvmem: meson-efuse: add peripheral clock")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/nvmem/meson-efuse.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/nvmem/meson-efuse.c b/drivers/nvmem/meson-efuse.c
index b922df99f9bc..3b9e31d7d073 100644
--- a/drivers/nvmem/meson-efuse.c
+++ b/drivers/nvmem/meson-efuse.c
@@ -38,6 +38,11 @@ static const struct of_device_id meson_efuse_match[] = {
};
MODULE_DEVICE_TABLE(of, meson_efuse_match);
+static void meson_efuse_clk_disable(void *clk)
+{
+ clk_disable_unprepare(clk);
+}
+
static int meson_efuse_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
@@ -74,9 +79,7 @@ static int meson_efuse_probe(struct platform_device *pdev)
return ret;
}
- ret = devm_add_action_or_reset(dev,
- (void(*)(void *))clk_disable_unprepare,
- clk);
+ ret = devm_add_action_or_reset(dev, meson_efuse_clk_disable, clk);
if (ret) {
dev_err(dev, "failed to add disable callback");
return ret;
--
2.39.2
WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd@kernel.org>
To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
Neil Armstrong <neil.armstrong@linaro.org>,
Kevin Hilman <khilman@baylibre.com>,
Jerome Brunet <jbrunet@baylibre.com>,
Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Bill Wendling <morbo@google.com>,
Justin Stitt <justinstitt@google.com>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
linux-arm-kernel@lists.infradead.org,
linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org,
llvm@lists.linux.dev
Subject: [PATCH] nvmem: meson-efuse: fix function pointer type mismatch
Date: Tue, 13 Feb 2024 11:15:47 +0100 [thread overview]
Message-ID: <20240213101607.460930-1-arnd@kernel.org> (raw)
From: Arnd Bergmann <arnd@arndb.de>
clang-16 warns about casting functions to incompatible types, as is done
here to call clk_disable_unprepare:
drivers/nvmem/meson-efuse.c:78:12: error: cast from 'void (*)(struct clk *)' to 'void (*)(void *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict]
78 | (void(*)(void *))clk_disable_unprepare,
Address this with a trivial helper function that adjusts the return code.
Fixes: 611fbca1c861 ("nvmem: meson-efuse: add peripheral clock")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/nvmem/meson-efuse.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/nvmem/meson-efuse.c b/drivers/nvmem/meson-efuse.c
index b922df99f9bc..3b9e31d7d073 100644
--- a/drivers/nvmem/meson-efuse.c
+++ b/drivers/nvmem/meson-efuse.c
@@ -38,6 +38,11 @@ static const struct of_device_id meson_efuse_match[] = {
};
MODULE_DEVICE_TABLE(of, meson_efuse_match);
+static void meson_efuse_clk_disable(void *clk)
+{
+ clk_disable_unprepare(clk);
+}
+
static int meson_efuse_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
@@ -74,9 +79,7 @@ static int meson_efuse_probe(struct platform_device *pdev)
return ret;
}
- ret = devm_add_action_or_reset(dev,
- (void(*)(void *))clk_disable_unprepare,
- clk);
+ ret = devm_add_action_or_reset(dev, meson_efuse_clk_disable, clk);
if (ret) {
dev_err(dev, "failed to add disable callback");
return ret;
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2024-02-13 10:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-13 10:15 Arnd Bergmann [this message]
2024-02-13 10:15 ` [PATCH] nvmem: meson-efuse: fix function pointer type mismatch Arnd Bergmann
2024-02-13 10:15 ` Arnd Bergmann
2024-02-13 10:27 ` Neil Armstrong
2024-02-13 10:27 ` Neil Armstrong
2024-02-13 10:27 ` Neil Armstrong
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=20240213101607.460930-1-arnd@kernel.org \
--to=arnd@kernel.org \
--cc=arnd@arndb.de \
--cc=jbrunet@baylibre.com \
--cc=jernej.skrabec@gmail.com \
--cc=justinstitt@google.com \
--cc=khilman@baylibre.com \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=martin.blumenstingl@googlemail.com \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=neil.armstrong@linaro.org \
--cc=srinivas.kandagatla@linaro.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.