]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
cpufreq: qcom-nvmem: fix compilation warning for qcom_cpufreq_ipq806x_match_list
authorChristian Marangi <ansuelsmth@gmail.com>
Thu, 20 Nov 2025 13:35:02 +0000 (14:35 +0100)
committerViresh Kumar <viresh.kumar@linaro.org>
Fri, 21 Nov 2025 04:51:13 +0000 (10:21 +0530)
If CONFIG_OF is not enabled, of_match_node() is set as NULL and
qcom_cpufreq_ipq806x_match_list won't be used causing a compilation
warning.

Flag qcom_cpufreq_ipq806x_match_list as __maybe_unused to fix the
compilation warning.

While at it also flag as __initconst as it's used only in probe contest
and can be freed after probe.

This follows the pattern of the usual of_device_id variables.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202511202119.6zvvFMup-lkp@intel.com/
Fixes: 58f5d39d5ed8 ("cpufreq: qcom-nvmem: add compatible fallback for ipq806x for no SMEM")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
[ Viresh: Drop __initconst ]
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/cpufreq/qcom-cpufreq-nvmem.c

index d5af74bf71c6e719990ea0bc549cdf07adeeca58..81e16b5a0245aba3bde76d80498185fc317b0f79 100644 (file)
@@ -256,7 +256,7 @@ len_error:
        return ret;
 }
 
-static const struct of_device_id qcom_cpufreq_ipq806x_match_list[] = {
+static const struct of_device_id qcom_cpufreq_ipq806x_match_list[] __maybe_unused = {
        { .compatible = "qcom,ipq8062", .data = (const void *)QCOM_ID_IPQ8062 },
        { .compatible = "qcom,ipq8064", .data = (const void *)QCOM_ID_IPQ8064 },
        { .compatible = "qcom,ipq8065", .data = (const void *)QCOM_ID_IPQ8065 },