* [PATCH v2] PCI: endpoint: reduce several globals to statics
@ 2022-06-30 21:05 Tom Rix
2022-06-30 21:09 ` [EXT] " Frank Li
2022-07-04 10:19 ` Manivannan Sadhasivam
0 siblings, 2 replies; 3+ messages in thread
From: Tom Rix @ 2022-06-30 21:05 UTC (permalink / raw)
To: kishon, lpieralisi, kw, bhelgaas, Frank.Li, jdmason
Cc: linux-pci, linux-kernel, Tom Rix
sparse reports
drivers/pci/endpoint/functions/pci-epf-vntb.c:956:10: warning: symbol 'pci_space' was not declared. Should it be static?
drivers/pci/endpoint/functions/pci-epf-vntb.c:975:5: warning: symbol 'pci_read' was not declared. Should it be static?
drivers/pci/endpoint/functions/pci-epf-vntb.c:984:5: warning: symbol 'pci_write' was not declared. Should it be static?
drivers/pci/endpoint/functions/pci-epf-vntb.c:989:16: warning: symbol 'vpci_ops' was not declared. Should it be static?
These functions and variables are only used in pci-epf-vntb.c, so their storage
class specifiers should be static.
Fixes: ff32fac00d97 ("NTB: EPF: support NTB transfer between PCI RC and EP connection")
Signed-off-by: Tom Rix <trix@redhat.com>
---
v2 : Change commit prefix
---
drivers/pci/endpoint/functions/pci-epf-vntb.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/pci/endpoint/functions/pci-epf-vntb.c b/drivers/pci/endpoint/functions/pci-epf-vntb.c
index ebf7e243eefa..6f0775b1fec3 100644
--- a/drivers/pci/endpoint/functions/pci-epf-vntb.c
+++ b/drivers/pci/endpoint/functions/pci-epf-vntb.c
@@ -953,7 +953,7 @@ static struct config_group *epf_ntb_add_cfs(struct pci_epf *epf,
#define VPCI_BUS_NUM 0x10
-uint32_t pci_space[] = {
+static uint32_t pci_space[] = {
(VNTB_VID | (VNTB_PID << 16)), //DeviceID, Vendor ID
0, // status, Command
0xffffffff, // Class code, subclass, prog if, revision id
@@ -972,7 +972,7 @@ uint32_t pci_space[] = {
0, //Max Lat, Min Gnt, interrupt pin, interrupt line
};
-int pci_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *val)
+static int pci_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *val)
{
if (devfn == 0) {
memcpy(val, ((uint8_t *)pci_space) + where, size);
@@ -981,12 +981,12 @@ int pci_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *
return -1;
}
-int pci_write(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val)
+static int pci_write(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val)
{
return 0;
}
-struct pci_ops vpci_ops = {
+static struct pci_ops vpci_ops = {
.read = pci_read,
.write = pci_write,
};
--
2.27.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [EXT] [PATCH v2] PCI: endpoint: reduce several globals to statics
2022-06-30 21:05 [PATCH v2] PCI: endpoint: reduce several globals to statics Tom Rix
@ 2022-06-30 21:09 ` Frank Li
2022-07-04 10:19 ` Manivannan Sadhasivam
1 sibling, 0 replies; 3+ messages in thread
From: Frank Li @ 2022-06-30 21:09 UTC (permalink / raw)
To: Tom Rix, kishon, lpieralisi, kw, bhelgaas, jdmason
Cc: linux-pci, linux-kernel, ntb
> -----Original Message-----
> From: Tom Rix <trix@redhat.com>
> Sent: Thursday, June 30, 2022 4:05 PM
> To: kishon@ti.com; lpieralisi@kernel.org; kw@linux.com;
> bhelgaas@google.com; Frank Li <frank.li@nxp.com>; jdmason@kudzu.us
> Cc: linux-pci@vger.kernel.org; linux-kernel@vger.kernel.org; Tom Rix
> <trix@redhat.com>
> Subject: [EXT] [PATCH v2] PCI: endpoint: reduce several globals to statics
Added ntb mail list ntb@lists.linux.dev
>
> Caution: EXT Email
>
> sparse reports
> drivers/pci/endpoint/functions/pci-epf-vntb.c:956:10: warning: symbol
> 'pci_space' was not declared. Should it be static?
> drivers/pci/endpoint/functions/pci-epf-vntb.c:975:5: warning: symbol
> 'pci_read' was not declared. Should it be static?
> drivers/pci/endpoint/functions/pci-epf-vntb.c:984:5: warning: symbol
> 'pci_write' was not declared. Should it be static?
> drivers/pci/endpoint/functions/pci-epf-vntb.c:989:16: warning: symbol
> 'vpci_ops' was not declared. Should it be static?
>
> These functions and variables are only used in pci-epf-vntb.c, so their storage
> class specifiers should be static.
>
> Fixes: ff32fac00d97 ("NTB: EPF: support NTB transfer between PCI RC and EP
> connection")
> Signed-off-by: Tom Rix <trix@redhat.com>
> ---
> v2 : Change commit prefix
Acked-by: Frank Li <Frank.Li@nxp.com>
>
> ---
> drivers/pci/endpoint/functions/pci-epf-vntb.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/pci/endpoint/functions/pci-epf-vntb.c
> b/drivers/pci/endpoint/functions/pci-epf-vntb.c
> index ebf7e243eefa..6f0775b1fec3 100644
> --- a/drivers/pci/endpoint/functions/pci-epf-vntb.c
> +++ b/drivers/pci/endpoint/functions/pci-epf-vntb.c
> @@ -953,7 +953,7 @@ static struct config_group *epf_ntb_add_cfs(struct
> pci_epf *epf,
>
> #define VPCI_BUS_NUM 0x10
>
> -uint32_t pci_space[] = {
> +static uint32_t pci_space[] = {
> (VNTB_VID | (VNTB_PID << 16)), //DeviceID, Vendor ID
> 0, // status, Command
> 0xffffffff, // Class code, subclass, prog if, revision id
> @@ -972,7 +972,7 @@ uint32_t pci_space[] = {
> 0, //Max Lat, Min Gnt, interrupt pin, interrupt line
> };
>
> -int pci_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32
> *val)
> +static int pci_read(struct pci_bus *bus, unsigned int devfn, int where, int
> size, u32 *val)
> {
> if (devfn == 0) {
> memcpy(val, ((uint8_t *)pci_space) + where, size);
> @@ -981,12 +981,12 @@ int pci_read(struct pci_bus *bus, unsigned int
> devfn, int where, int size, u32 *
> return -1;
> }
>
> -int pci_write(struct pci_bus *bus, unsigned int devfn, int where, int size, u32
> val)
> +static int pci_write(struct pci_bus *bus, unsigned int devfn, int where, int
> size, u32 val)
> {
> return 0;
> }
>
> -struct pci_ops vpci_ops = {
> +static struct pci_ops vpci_ops = {
> .read = pci_read,
> .write = pci_write,
> };
> --
> 2.27.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] PCI: endpoint: reduce several globals to statics
2022-06-30 21:05 [PATCH v2] PCI: endpoint: reduce several globals to statics Tom Rix
2022-06-30 21:09 ` [EXT] " Frank Li
@ 2022-07-04 10:19 ` Manivannan Sadhasivam
1 sibling, 0 replies; 3+ messages in thread
From: Manivannan Sadhasivam @ 2022-07-04 10:19 UTC (permalink / raw)
To: Tom Rix
Cc: kishon, lpieralisi, kw, bhelgaas, Frank.Li, jdmason, linux-pci,
linux-kernel
On Thu, Jun 30, 2022 at 05:05:17PM -0400, Tom Rix wrote:
> sparse reports
> drivers/pci/endpoint/functions/pci-epf-vntb.c:956:10: warning: symbol 'pci_space' was not declared. Should it be static?
> drivers/pci/endpoint/functions/pci-epf-vntb.c:975:5: warning: symbol 'pci_read' was not declared. Should it be static?
> drivers/pci/endpoint/functions/pci-epf-vntb.c:984:5: warning: symbol 'pci_write' was not declared. Should it be static?
> drivers/pci/endpoint/functions/pci-epf-vntb.c:989:16: warning: symbol 'vpci_ops' was not declared. Should it be static?
>
> These functions and variables are only used in pci-epf-vntb.c, so their storage
> class specifiers should be static.
>
> Fixes: ff32fac00d97 ("NTB: EPF: support NTB transfer between PCI RC and EP connection")
> Signed-off-by: Tom Rix <trix@redhat.com>
Commit subject should include "pci-epf-vntb" prefix. Otherwise it is not
possible to guess which driver this patch touches (unless one reads commit
description).
With that fixed,
Acked-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Thanks,
Mani
> ---
> v2 : Change commit prefix
>
> ---
> drivers/pci/endpoint/functions/pci-epf-vntb.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/pci/endpoint/functions/pci-epf-vntb.c b/drivers/pci/endpoint/functions/pci-epf-vntb.c
> index ebf7e243eefa..6f0775b1fec3 100644
> --- a/drivers/pci/endpoint/functions/pci-epf-vntb.c
> +++ b/drivers/pci/endpoint/functions/pci-epf-vntb.c
> @@ -953,7 +953,7 @@ static struct config_group *epf_ntb_add_cfs(struct pci_epf *epf,
>
> #define VPCI_BUS_NUM 0x10
>
> -uint32_t pci_space[] = {
> +static uint32_t pci_space[] = {
> (VNTB_VID | (VNTB_PID << 16)), //DeviceID, Vendor ID
> 0, // status, Command
> 0xffffffff, // Class code, subclass, prog if, revision id
> @@ -972,7 +972,7 @@ uint32_t pci_space[] = {
> 0, //Max Lat, Min Gnt, interrupt pin, interrupt line
> };
>
> -int pci_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *val)
> +static int pci_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *val)
> {
> if (devfn == 0) {
> memcpy(val, ((uint8_t *)pci_space) + where, size);
> @@ -981,12 +981,12 @@ int pci_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *
> return -1;
> }
>
> -int pci_write(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val)
> +static int pci_write(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val)
> {
> return 0;
> }
>
> -struct pci_ops vpci_ops = {
> +static struct pci_ops vpci_ops = {
> .read = pci_read,
> .write = pci_write,
> };
> --
> 2.27.0
>
--
மணிவண்ணன் சதாசிவம்
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-07-04 10:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-30 21:05 [PATCH v2] PCI: endpoint: reduce several globals to statics Tom Rix
2022-06-30 21:09 ` [EXT] " Frank Li
2022-07-04 10:19 ` Manivannan Sadhasivam
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).