Fix the following sparse warning:
drivers/pci/controller/dwc/pcie-hisi.c:365:21: warning:
symbol 'hisi_pcie_platform_ops' was not declared. Should it be static?
Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Zou Wei <[email protected]>
---
drivers/pci/controller/dwc/pcie-hisi.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/controller/dwc/pcie-hisi.c b/drivers/pci/controller/dwc/pcie-hisi.c
index 6d9e1b2..b440f40 100644
--- a/drivers/pci/controller/dwc/pcie-hisi.c
+++ b/drivers/pci/controller/dwc/pcie-hisi.c
@@ -362,7 +362,8 @@ static int hisi_pcie_platform_init(struct pci_config_window *cfg)
return 0;
}
-struct pci_ecam_ops hisi_pcie_platform_ops = {
+static struct pci_ecam_ops hisi_pcie_platform_ops = {
+ }
.bus_shift = 20,
.init = hisi_pcie_platform_init,
.pci_ops = {
--
2.6.2
On 2020/4/22 17:47, Zou Wei wrote:
> Fix the following sparse warning:
>
> drivers/pci/controller/dwc/pcie-hisi.c:365:21: warning:
> symbol 'hisi_pcie_platform_ops' was not declared. Should it be static?
>
> Reported-by: Hulk Robot <[email protected]>
> Signed-off-by: Zou Wei <[email protected]>
> ---
> drivers/pci/controller/dwc/pcie-hisi.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pci/controller/dwc/pcie-hisi.c b/drivers/pci/controller/dwc/pcie-hisi.c
> index 6d9e1b2..b440f40 100644
> --- a/drivers/pci/controller/dwc/pcie-hisi.c
> +++ b/drivers/pci/controller/dwc/pcie-hisi.c
> @@ -362,7 +362,8 @@ static int hisi_pcie_platform_init(struct pci_config_window *cfg)
> return 0;
> }
>
> -struct pci_ecam_ops hisi_pcie_platform_ops = {
> +static struct pci_ecam_ops hisi_pcie_platform_ops = {
> + }
why adding "}"? BTW, static is OK here.
> .bus_shift = 20,
> .init = hisi_pcie_platform_init,
> .pci_ops = {
>
Hi Wang,
Thanks for your review and reply.
I will modify and send the v2 soon.
Thanks
Zou Wei
-----?ʼ?ԭ??-----
??????: Wangzhou (B)
????ʱ??: 2020??4??23?? 10:59
?ռ???: Zouwei (Samuel) <[email protected]>; [email protected]; [email protected]; [email protected]
????: [email protected]; [email protected]
????: Re: [PATCH -next] PCI: dwc: Make hisi_pcie_platform_ops static
On 2020/4/22 17:47, Zou Wei wrote:
> Fix the following sparse warning:
>
> drivers/pci/controller/dwc/pcie-hisi.c:365:21: warning:
> symbol 'hisi_pcie_platform_ops' was not declared. Should it be static?
>
> Reported-by: Hulk Robot <[email protected]>
> Signed-off-by: Zou Wei <[email protected]>
> ---
> drivers/pci/controller/dwc/pcie-hisi.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pci/controller/dwc/pcie-hisi.c b/drivers/pci/controller/dwc/pcie-hisi.c
> index 6d9e1b2..b440f40 100644
> --- a/drivers/pci/controller/dwc/pcie-hisi.c
> +++ b/drivers/pci/controller/dwc/pcie-hisi.c
> @@ -362,7 +362,8 @@ static int hisi_pcie_platform_init(struct pci_config_window *cfg)
> return 0;
> }
>
> -struct pci_ecam_ops hisi_pcie_platform_ops = {
> +static struct pci_ecam_ops hisi_pcie_platform_ops = {
> + }
why adding "}"? BTW, static is OK here.
> .bus_shift = 20,
> .init = hisi_pcie_platform_init,
> .pci_ops = {
>