linux-hyperv.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] PCI: hv: Make some functions static
@ 2020-07-06 13:52 Wei Yongjun
  2020-07-28 10:23 ` Lorenzo Pieralisi
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2020-07-06 13:52 UTC (permalink / raw)
  To: Hulk Robot, K. Y. Srinivasan, Haiyang Zhang, Stephen Hemminger,
	Wei Liu, Lorenzo Pieralisi, Bjorn Helgaas
  Cc: Wei Yongjun, linux-hyperv, linux-pci

sparse report build warning as follows:

drivers/pci/controller/pci-hyperv.c:941:5: warning:
 symbol 'hv_read_config_block' was not declared. Should it be static?
drivers/pci/controller/pci-hyperv.c:1021:5: warning:
 symbol 'hv_write_config_block' was not declared. Should it be static?
drivers/pci/controller/pci-hyperv.c:1090:5: warning:
 symbol 'hv_register_block_invalidate' was not declared. Should it be static?

Those functions are not used outside of this file, so mark them static.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/pci/controller/pci-hyperv.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c
index bf40ff09c99d..5c496b93cea9 100644
--- a/drivers/pci/controller/pci-hyperv.c
+++ b/drivers/pci/controller/pci-hyperv.c
@@ -938,8 +938,9 @@ static void hv_pci_read_config_compl(void *context, struct pci_response *resp,
  *
  * Return: 0 on success, -errno on failure
  */
-int hv_read_config_block(struct pci_dev *pdev, void *buf, unsigned int len,
-			 unsigned int block_id, unsigned int *bytes_returned)
+static int hv_read_config_block(struct pci_dev *pdev, void *buf,
+				unsigned int len, unsigned int block_id,
+				unsigned int *bytes_returned)
 {
 	struct hv_pcibus_device *hbus =
 		container_of(pdev->bus->sysdata, struct hv_pcibus_device,
@@ -1018,8 +1019,8 @@ static void hv_pci_write_config_compl(void *context, struct pci_response *resp,
  *
  * Return: 0 on success, -errno on failure
  */
-int hv_write_config_block(struct pci_dev *pdev, void *buf, unsigned int len,
-			  unsigned int block_id)
+static int hv_write_config_block(struct pci_dev *pdev, void *buf,
+				unsigned int len, unsigned int block_id)
 {
 	struct hv_pcibus_device *hbus =
 		container_of(pdev->bus->sysdata, struct hv_pcibus_device,
@@ -1087,9 +1088,9 @@ int hv_write_config_block(struct pci_dev *pdev, void *buf, unsigned int len,
  *
  * Return: 0 on success, -errno on failure
  */
-int hv_register_block_invalidate(struct pci_dev *pdev, void *context,
-				 void (*block_invalidate)(void *context,
-							  u64 block_mask))
+static int hv_register_block_invalidate(struct pci_dev *pdev, void *context,
+					void (*block_invalidate)(void *context,
+								 u64 block_mask))
 {
 	struct hv_pcibus_device *hbus =
 		container_of(pdev->bus->sysdata, struct hv_pcibus_device,


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] PCI: hv: Make some functions static
  2020-07-06 13:52 [PATCH -next] PCI: hv: Make some functions static Wei Yongjun
@ 2020-07-28 10:23 ` Lorenzo Pieralisi
  0 siblings, 0 replies; 2+ messages in thread
From: Lorenzo Pieralisi @ 2020-07-28 10:23 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Hulk Robot, K. Y. Srinivasan, Haiyang Zhang, Stephen Hemminger,
	Wei Liu, Bjorn Helgaas, linux-hyperv, linux-pci

On Mon, Jul 06, 2020 at 09:52:34PM +0800, Wei Yongjun wrote:
> sparse report build warning as follows:
> 
> drivers/pci/controller/pci-hyperv.c:941:5: warning:
>  symbol 'hv_read_config_block' was not declared. Should it be static?
> drivers/pci/controller/pci-hyperv.c:1021:5: warning:
>  symbol 'hv_write_config_block' was not declared. Should it be static?
> drivers/pci/controller/pci-hyperv.c:1090:5: warning:
>  symbol 'hv_register_block_invalidate' was not declared. Should it be static?
> 
> Those functions are not used outside of this file, so mark them static.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/pci/controller/pci-hyperv.c | 15 ++++++++-------
>  1 file changed, 8 insertions(+), 7 deletions(-)

Applied to pci/hv, thanks.

Lorenzo

> diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c
> index bf40ff09c99d..5c496b93cea9 100644
> --- a/drivers/pci/controller/pci-hyperv.c
> +++ b/drivers/pci/controller/pci-hyperv.c
> @@ -938,8 +938,9 @@ static void hv_pci_read_config_compl(void *context, struct pci_response *resp,
>   *
>   * Return: 0 on success, -errno on failure
>   */
> -int hv_read_config_block(struct pci_dev *pdev, void *buf, unsigned int len,
> -			 unsigned int block_id, unsigned int *bytes_returned)
> +static int hv_read_config_block(struct pci_dev *pdev, void *buf,
> +				unsigned int len, unsigned int block_id,
> +				unsigned int *bytes_returned)
>  {
>  	struct hv_pcibus_device *hbus =
>  		container_of(pdev->bus->sysdata, struct hv_pcibus_device,
> @@ -1018,8 +1019,8 @@ static void hv_pci_write_config_compl(void *context, struct pci_response *resp,
>   *
>   * Return: 0 on success, -errno on failure
>   */
> -int hv_write_config_block(struct pci_dev *pdev, void *buf, unsigned int len,
> -			  unsigned int block_id)
> +static int hv_write_config_block(struct pci_dev *pdev, void *buf,
> +				unsigned int len, unsigned int block_id)
>  {
>  	struct hv_pcibus_device *hbus =
>  		container_of(pdev->bus->sysdata, struct hv_pcibus_device,
> @@ -1087,9 +1088,9 @@ int hv_write_config_block(struct pci_dev *pdev, void *buf, unsigned int len,
>   *
>   * Return: 0 on success, -errno on failure
>   */
> -int hv_register_block_invalidate(struct pci_dev *pdev, void *context,
> -				 void (*block_invalidate)(void *context,
> -							  u64 block_mask))
> +static int hv_register_block_invalidate(struct pci_dev *pdev, void *context,
> +					void (*block_invalidate)(void *context,
> +								 u64 block_mask))
>  {
>  	struct hv_pcibus_device *hbus =
>  		container_of(pdev->bus->sysdata, struct hv_pcibus_device,
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-07-28 10:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-06 13:52 [PATCH -next] PCI: hv: Make some functions static Wei Yongjun
2020-07-28 10:23 ` Lorenzo Pieralisi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).