Message ID | 20190829091713.27130-1-kw@linux.com (mailing list archive) |
---|---|
State | Mainlined, archived |
Delegated to: | Lorenzo Pieralisi |
Headers | show |
Series | [v3] PCI: hv: Make functions static | expand |
> -----Original Message----- > From: Krzysztof Wilczynski <kswilczynski@gmail.com> On Behalf Of Krzysztof > Wilczynski > Sent: Thursday, August 29, 2019 2:17 AM > To: Bjorn Helgaas <helgaas@kernel.org> > Cc: KY Srinivasan <kys@microsoft.com>; Haiyang Zhang > <haiyangz@microsoft.com>; Stephen Hemminger > <sthemmin@microsoft.com>; Sasha Levin <sashal@kernel.org>; Lorenzo > Pieralisi <lorenzo.pieralisi@arm.com>; linux-pci@vger.kernel.org; linux- > kernel@vger.kernel.org; linux-hyperv@vger.kernel.org > Subject: [PATCH v3] PCI: hv: Make functions static > > Functions hv_read_config_block(), hv_write_config_block() and > hv_register_block_invalidate() are not used anywhere else and are local to > drivers/pci/controller/pci-hyperv.c, > and do not need to be in global scope, so make these static. > > Resolve following compiler warning that can be seen when building with > warnings enabled (W=1): > > drivers/pci/controller/pci-hyperv.c:933:5: warning: > no previous prototype for ‘hv_read_config_block’ > [-Wmissing-prototypes] > > drivers/pci/controller/pci-hyperv.c:1013:5: warning: > no previous prototype for ‘hv_write_config_block’ > [-Wmissing-prototypes] > > drivers/pci/controller/pci-hyperv.c:1082:5: warning: > no previous prototype for ‘hv_register_block_invalidate’ > [-Wmissing-prototypes] > > Signed-off-by: Krzysztof Wilczynski <kw@linux.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Thanks!
On Thu, Aug 29, 2019 at 03:50:47PM +0000, Haiyang Zhang wrote: > > > > -----Original Message----- > > From: Krzysztof Wilczynski <kswilczynski@gmail.com> On Behalf Of Krzysztof > > Wilczynski > > Sent: Thursday, August 29, 2019 2:17 AM > > To: Bjorn Helgaas <helgaas@kernel.org> > > Cc: KY Srinivasan <kys@microsoft.com>; Haiyang Zhang > > <haiyangz@microsoft.com>; Stephen Hemminger > > <sthemmin@microsoft.com>; Sasha Levin <sashal@kernel.org>; Lorenzo > > Pieralisi <lorenzo.pieralisi@arm.com>; linux-pci@vger.kernel.org; linux- > > kernel@vger.kernel.org; linux-hyperv@vger.kernel.org > > Subject: [PATCH v3] PCI: hv: Make functions static > > > > Functions hv_read_config_block(), hv_write_config_block() and > > hv_register_block_invalidate() are not used anywhere else and are local to > > drivers/pci/controller/pci-hyperv.c, > > and do not need to be in global scope, so make these static. > > > > Resolve following compiler warning that can be seen when building with > > warnings enabled (W=1): > > > > drivers/pci/controller/pci-hyperv.c:933:5: warning: > > no previous prototype for ‘hv_read_config_block’ > > [-Wmissing-prototypes] > > > > drivers/pci/controller/pci-hyperv.c:1013:5: warning: > > no previous prototype for ‘hv_write_config_block’ > > [-Wmissing-prototypes] > > > > drivers/pci/controller/pci-hyperv.c:1082:5: warning: > > no previous prototype for ‘hv_register_block_invalidate’ > > [-Wmissing-prototypes] > > > > Signed-off-by: Krzysztof Wilczynski <kw@linux.com> > > Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> This patch should go via the net tree - the code it is fixing is queued there, I will drop this patch from the PCI review queue. If it helps: Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Hello Lorenzo, [...] > This patch should go via the net tree - the code it is fixing > is queued there, I will drop this patch from the PCI review > queue. [...] Thank you! Appreciated. Krzysztof
diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c index f1f300218fab..ba988fe033b5 100644 --- a/drivers/pci/controller/pci-hyperv.c +++ b/drivers/pci/controller/pci-hyperv.c @@ -930,8 +930,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, @@ -1010,8 +1011,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, @@ -1079,9 +1080,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, @@ -1097,7 +1098,6 @@ int hv_register_block_invalidate(struct pci_dev *pdev, void *context, put_pcichild(hpdev); return 0; - } /* Interrupt management hooks */
Functions hv_read_config_block(), hv_write_config_block() and hv_register_block_invalidate() are not used anywhere else and are local to drivers/pci/controller/pci-hyperv.c, and do not need to be in global scope, so make these static. Resolve following compiler warning that can be seen when building with warnings enabled (W=1): drivers/pci/controller/pci-hyperv.c:933:5: warning: no previous prototype for ‘hv_read_config_block’ [-Wmissing-prototypes] drivers/pci/controller/pci-hyperv.c:1013:5: warning: no previous prototype for ‘hv_write_config_block’ [-Wmissing-prototypes] drivers/pci/controller/pci-hyperv.c:1082:5: warning: no previous prototype for ‘hv_register_block_invalidate’ [-Wmissing-prototypes] Signed-off-by: Krzysztof Wilczynski <kw@linux.com> --- Changes in v3: Commit message has been wrapped to fit 75 columns. Addressed formatting based on feedback from v2. Changes in v2: Update commit message to include compiler warning. drivers/pci/controller/pci-hyperv.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)