cpufreq: qcom-nvmem: fix compilation warning for qcom_cpufreq_ipq806x_match_list
Subsystems (3)
PATCH 1/1 cpufreq: qcom-nvmem: fix compilation warning for qcom_cpufreq_ipq806x_match_list
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.
--- drivers/cpufreq/qcom-cpufreq-nvmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpufreq/qcom-cpufreq-nvmem.c +1 -1
@@ -256,7 +256,7 @@ static int qcom_cpufreq_krait_name_version(struct device *cpu_dev,return ret; } -static const struct of_device_id qcom_cpufreq_ipq806x_match_list[] = { +static const struct of_device_id qcom_cpufreq_ipq806x_match_list[]__initconst __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 },
Signature · 1 line
2.51.0
Quoted 12 lines · Christian Marangi
If
CONFIG_OFis not enabled,of_match_node()is set as NULL andqcom_cpufreq_ipq806x_match_listwon't be used causing a compilation warning.Flag
qcom_cpufreq_ipq806x_match_listas__maybe_unusedto fix the compilation warning.While at it also flag as
__initconstas it's used only in probe contest and can be freed after probe.This follows the pattern of the usual
of_device_idvariables.
Quoted 7 lines
Reported-by kernel test robot <[email protected]>Fixes 58f5d39d5ed8 ("cpufreq: qcom-nvmem: add compatible fallback for ipq806x for no SMEM")Signed-off-by Christian Marangi <[email protected]>--- drivers/cpufreq/qcom-cpufreq-nvmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied. Thanks.
Signature · 1 line
viresh