The driver can be built on ACPI and its .of_match_table uses
of_match_ptr(), thus annotate the actual table as maybe unused.
Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/ufs/host/ufs-qcom.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
index a02cd866e2f8..82d02e7f3b4f 100644
--- a/drivers/ufs/host/ufs-qcom.c
+++ b/drivers/ufs/host/ufs-qcom.c
@@ -1693,7 +1693,7 @@ static int ufs_qcom_remove(struct platform_device *pdev)
return 0;
}
-static const struct of_device_id ufs_qcom_of_match[] = {
+static const struct of_device_id ufs_qcom_of_match[] __maybe_unused = {
{ .compatible = "qcom,ufshc"},
{},
};
--
2.34.1
The driver can match only via the DT table so the table should be always
used and the of_match_ptr does not have any sense (this also allows ACPI
matching via PRP0001, even though it is not relevant here).
drivers/ufs/host/ufs-exynos.c:1738:34: error: ‘exynos_ufs_of_match’ defined but not used [-Werror=unused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/ufs/host/ufs-exynos.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c
index 7c985fc38db1..0bf5390739e1 100644
--- a/drivers/ufs/host/ufs-exynos.c
+++ b/drivers/ufs/host/ufs-exynos.c
@@ -1761,7 +1761,7 @@ static struct platform_driver exynos_ufs_pltform = {
.driver = {
.name = "exynos-ufshc",
.pm = &exynos_ufs_pm_ops,
- .of_match_table = of_match_ptr(exynos_ufs_of_match),
+ .of_match_table = exynos_ufs_of_match,
},
};
module_platform_driver(exynos_ufs_pltform);
--
2.34.1
The driver can match only via the DT table so the table should be always
used and the of_match_ptr does not have any sense (this also allows ACPI
matching via PRP0001, even though it is not relevant here).
drivers/ufs/host/ufs-hisi.c:561:34: error: ‘ufs_hisi_of_match’ defined but not used [-Werror=unused-const-variable=]
Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/ufs/host/ufs-hisi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ufs/host/ufs-hisi.c b/drivers/ufs/host/ufs-hisi.c
index 2eed13bc82ca..4c423eba8aa9 100644
--- a/drivers/ufs/host/ufs-hisi.c
+++ b/drivers/ufs/host/ufs-hisi.c
@@ -597,7 +597,7 @@ static struct platform_driver ufs_hisi_pltform = {
.driver = {
.name = "ufshcd-hisi",
.pm = &ufs_hisi_pm_ops,
- .of_match_table = of_match_ptr(ufs_hisi_of_match),
+ .of_match_table = ufs_hisi_of_match,
},
};
module_platform_driver(ufs_hisi_pltform);
--
2.34.1
On 10.03.2023 22:44, Krzysztof Kozlowski wrote:
> The driver can be built on ACPI and its .of_match_table uses
> of_match_ptr(), thus annotate the actual table as maybe unused.
>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>
> ---
Reviewed-by: Konrad Dybcio <[email protected]>
Konrad
> drivers/ufs/host/ufs-qcom.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
> index a02cd866e2f8..82d02e7f3b4f 100644
> --- a/drivers/ufs/host/ufs-qcom.c
> +++ b/drivers/ufs/host/ufs-qcom.c
> @@ -1693,7 +1693,7 @@ static int ufs_qcom_remove(struct platform_device *pdev)
> return 0;
> }
>
> -static const struct of_device_id ufs_qcom_of_match[] = {
> +static const struct of_device_id ufs_qcom_of_match[] __maybe_unused = {
> { .compatible = "qcom,ufshc"},
> {},
> };
Hi Krzysztof,
> -----Original Message-----
> From: Krzysztof Kozlowski <[email protected]>
> Sent: Saturday, March 11, 2023 3:15 AM
> To: Alim Akhtar <[email protected]>; James E.J. Bottomley
> <[email protected]>; Martin K. Petersen <[email protected]>;
> Krzysztof Kozlowski <[email protected]>; Manivannan Sadhasivam
> <[email protected]>; Andy Gross <[email protected]>; Bjorn Andersson
> <[email protected]>; Konrad Dybcio <[email protected]>; linux-
> [email protected]; [email protected]; linux-samsung-
> [email protected]; [email protected]; linux-arm-
> [email protected]
> Subject: [PATCH 2/3] ufs: exynos: drop of_match_ptr for ID table
>
> The driver can match only via the DT table so the table should be always used
> and the of_match_ptr does not have any sense (this also allows ACPI matching
> via PRP0001, even though it is not relevant here).
>
> drivers/ufs/host/ufs-exynos.c:1738:34: error: ‘exynos_ufs_of_match’ defined
> but not used [-Werror=unused-const-variable=]
>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>
> ---
Reviewed-by: Alim Akhtar <[email protected]>
> drivers/ufs/host/ufs-exynos.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c index
> 7c985fc38db1..0bf5390739e1 100644
> --- a/drivers/ufs/host/ufs-exynos.c
> +++ b/drivers/ufs/host/ufs-exynos.c
> @@ -1761,7 +1761,7 @@ static struct platform_driver exynos_ufs_pltform = {
> .driver = {
> .name = "exynos-ufshc",
> .pm = &exynos_ufs_pm_ops,
> - .of_match_table = of_match_ptr(exynos_ufs_of_match),
> + .of_match_table = exynos_ufs_of_match,
> },
> };
> module_platform_driver(exynos_ufs_pltform);
> --
> 2.34.1
Krzysztof,
> The driver can be built on ACPI and its .of_match_table uses
> of_match_ptr(), thus annotate the actual table as maybe unused.
Applied #1-#3 to 6.4/scsi-staging, thanks!
--
Martin K. Petersen Oracle Linux Engineering
On Fri, 10 Mar 2023 22:44:33 +0100, Krzysztof Kozlowski wrote:
> The driver can be built on ACPI and its .of_match_table uses
> of_match_ptr(), thus annotate the actual table as maybe unused.
>
>
Applied to 6.4/scsi-queue, thanks!
[1/3] ufs: qcom: add __maybe_unused to OF ID table
https://git.kernel.org/mkp/scsi/c/dd3f53301181
[2/3] ufs: exynos: drop of_match_ptr for ID table
https://git.kernel.org/mkp/scsi/c/cd6a6893ac05
[3/3] ufs: hisi: drop of_match_ptr for ID table
https://git.kernel.org/mkp/scsi/c/d43250ed0fec
--
Martin K. Petersen Oracle Linux Engineering