2012-05-03 00:12:33

by Hartley Sweeten

[permalink] [raw]
Subject: [PATCH] vme: vme_ca91cx42.c: local functions should not be exposed globally

Functions not referenced outside of a source file should be marked
static to prevent them from being exposed globally.

Quiets the sparse warnings:

warning: symbol 'ca91cx42_alloc_consistent' was not declared. Should it be static?
warning: symbol 'ca91cx42_free_consistent' was not declared. Should it be static?

Signed-off-by: H Hartley Sweeten <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Martyn Welch <[email protected]>

---

diff --git a/drivers/vme/bridges/vme_ca91cx42.c b/drivers/vme/bridges/vme_ca91cx42.c
index a3c0f84..e0df92e 100644
--- a/drivers/vme/bridges/vme_ca91cx42.c
+++ b/drivers/vme/bridges/vme_ca91cx42.c
@@ -1501,7 +1501,7 @@ static int ca91cx42_slot_get(struct vme_bridge *ca91cx42_bridge)

}

-void *ca91cx42_alloc_consistent(struct device *parent, size_t size,
+static void *ca91cx42_alloc_consistent(struct device *parent, size_t size,
dma_addr_t *dma)
{
struct pci_dev *pdev;
@@ -1512,8 +1512,8 @@ void *ca91cx42_alloc_consistent(struct device *parent, size_t size,
return pci_alloc_consistent(pdev, size, dma);
}

-void ca91cx42_free_consistent(struct device *parent, size_t size, void *vaddr,
- dma_addr_t dma)
+static void ca91cx42_free_consistent(struct device *parent, size_t size,
+ void *vaddr, dma_addr_t dma)
{
struct pci_dev *pdev;


2012-05-03 15:37:00

by Martyn Welch

[permalink] [raw]
Subject: Re: [PATCH] vme: vme_ca91cx42.c: local functions should not be exposed globally

On 03/05/12 01:12, H Hartley Sweeten wrote:
> Functions not referenced outside of a source file should be marked
> static to prevent them from being exposed globally.
>
> Quiets the sparse warnings:
>
> warning: symbol 'ca91cx42_alloc_consistent' was not declared. Should it be static?
> warning: symbol 'ca91cx42_free_consistent' was not declared. Should it be static?
>
> Signed-off-by: H Hartley Sweeten <[email protected]>
> Cc: Greg Kroah-Hartman <[email protected]>
> Cc: Martyn Welch <[email protected]>

Good catch,

Acked-by: Martyn Welch <[email protected]>

Martyn

>
> ---
>
> diff --git a/drivers/vme/bridges/vme_ca91cx42.c b/drivers/vme/bridges/vme_ca91cx42.c
> index a3c0f84..e0df92e 100644
> --- a/drivers/vme/bridges/vme_ca91cx42.c
> +++ b/drivers/vme/bridges/vme_ca91cx42.c
> @@ -1501,7 +1501,7 @@ static int ca91cx42_slot_get(struct vme_bridge *ca91cx42_bridge)
>
> }
>
> -void *ca91cx42_alloc_consistent(struct device *parent, size_t size,
> +static void *ca91cx42_alloc_consistent(struct device *parent, size_t size,
> dma_addr_t *dma)
> {
> struct pci_dev *pdev;
> @@ -1512,8 +1512,8 @@ void *ca91cx42_alloc_consistent(struct device *parent, size_t size,
> return pci_alloc_consistent(pdev, size, dma);
> }
>
> -void ca91cx42_free_consistent(struct device *parent, size_t size, void *vaddr,
> - dma_addr_t dma)
> +static void ca91cx42_free_consistent(struct device *parent, size_t size,
> + void *vaddr, dma_addr_t dma)
> {
> struct pci_dev *pdev;
>


--
Martyn Welch (Lead Software Engineer) | Registered in England and Wales
GE Intelligent Platforms | (3828642) at 100 Barbirolli Square
T +44(0)1327322748 | Manchester, M2 3AB
E [email protected] | VAT:GB 927559189