Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1490082 > unrolled thread

[PATCH] vme: fake: mark symbols static where possible

Started byBaoyou Xie <baoyou.xie@linaro.org>
First post2016-09-23 15:40 +0200
Last post2016-09-23 22:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] vme: fake: mark symbols static where possible Baoyou Xie <baoyou.xie@linaro.org> - 2016-09-23 15:40 +0200
    Re: [PATCH] vme: fake: mark symbols static where possible Martyn Welch <martyn@welchs.me.uk> - 2016-09-23 22:40 +0200

#1490082 — [PATCH] vme: fake: mark symbols static where possible

FromBaoyou Xie <baoyou.xie@linaro.org>
Date2016-09-23 15:40 +0200
Subject[PATCH] vme: fake: mark symbols static where possible
Message-ID<skyRP-4e3-1@gated-at.bofh.it>
We get 4 warnings when building kernel with W=1:
drivers/vme/bridges/vme_fake.c:384:6: warning: no previous prototype for 'fake_lm_check' [-Wmissing-prototypes]
drivers/vme/bridges/vme_fake.c:619:6: warning: no previous prototype for 'fake_vmewrite8' [-Wmissing-prototypes]
drivers/vme/bridges/vme_fake.c:649:6: warning: no previous prototype for 'fake_vmewrite16' [-Wmissing-prototypes]
drivers/vme/bridges/vme_fake.c:679:6: warning: no previous prototype for 'fake_vmewrite32' [-Wmissing-prototypes]

In fact, these functions are only used in the file in which they are
declared and don't need a declaration, but can be made static.
so this patch marks these functions with 'static'.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
---
 drivers/vme/bridges/vme_fake.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/vme/bridges/vme_fake.c b/drivers/vme/bridges/vme_fake.c
index ebf35d3..29ac74f 100644
--- a/drivers/vme/bridges/vme_fake.c
+++ b/drivers/vme/bridges/vme_fake.c
@@ -381,8 +381,8 @@ static int fake_master_get(struct vme_master_resource *image, int *enabled,
 }
 
 
-void fake_lm_check(struct fake_driver *bridge, unsigned long long addr,
-		u32 aspace, u32 cycle)
+static void fake_lm_check(struct fake_driver *bridge, unsigned long long addr,
+			  u32 aspace, u32 cycle)
 {
 	struct vme_bridge *fake_bridge;
 	unsigned long long lm_base;
@@ -616,8 +616,8 @@ static ssize_t fake_master_read(struct vme_master_resource *image, void *buf,
 	return retval;
 }
 
-void fake_vmewrite8(struct fake_driver *bridge, u8 *buf,
-		 unsigned long long addr, u32 aspace, u32 cycle)
+static void fake_vmewrite8(struct fake_driver *bridge, u8 *buf,
+			   unsigned long long addr, u32 aspace, u32 cycle)
 {
 	int i;
 	unsigned long long start, end, offset;
@@ -646,8 +646,8 @@ void fake_vmewrite8(struct fake_driver *bridge, u8 *buf,
 
 }
 
-void fake_vmewrite16(struct fake_driver *bridge, u16 *buf,
-		unsigned long long addr, u32 aspace, u32 cycle)
+static void fake_vmewrite16(struct fake_driver *bridge, u16 *buf,
+			    unsigned long long addr, u32 aspace, u32 cycle)
 {
 	int i;
 	unsigned long long start, end, offset;
@@ -676,8 +676,8 @@ void fake_vmewrite16(struct fake_driver *bridge, u16 *buf,
 
 }
 
-void fake_vmewrite32(struct fake_driver *bridge, u32 *buf,
-		unsigned long long addr, u32 aspace, u32 cycle)
+static void fake_vmewrite32(struct fake_driver *bridge, u32 *buf,
+			    unsigned long long addr, u32 aspace, u32 cycle)
 {
 	int i;
 	unsigned long long start, end, offset;
-- 
2.7.4

[toc] | [next] | [standalone]


#1490445

FromMartyn Welch <martyn@welchs.me.uk>
Date2016-09-23 22:40 +0200
Message-ID<skFqi-6t-11@gated-at.bofh.it>
In reply to#1490082
On 23 September 2016 at 14:38, Baoyou Xie <baoyou.xie@linaro.org> wrote:
> We get 4 warnings when building kernel with W=1:
> drivers/vme/bridges/vme_fake.c:384:6: warning: no previous prototype for 'fake_lm_check' [-Wmissing-prototypes]
> drivers/vme/bridges/vme_fake.c:619:6: warning: no previous prototype for 'fake_vmewrite8' [-Wmissing-prototypes]
> drivers/vme/bridges/vme_fake.c:649:6: warning: no previous prototype for 'fake_vmewrite16' [-Wmissing-prototypes]
> drivers/vme/bridges/vme_fake.c:679:6: warning: no previous prototype for 'fake_vmewrite32' [-Wmissing-prototypes]
>
> In fact, these functions are only used in the file in which they are
> declared and don't need a declaration, but can be made static.
> so this patch marks these functions with 'static'.
>
> Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>

Acked-by: Martyn Welch <martyn@welchs.me.uk>

> ---
>  drivers/vme/bridges/vme_fake.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/vme/bridges/vme_fake.c b/drivers/vme/bridges/vme_fake.c
> index ebf35d3..29ac74f 100644
> --- a/drivers/vme/bridges/vme_fake.c
> +++ b/drivers/vme/bridges/vme_fake.c
> @@ -381,8 +381,8 @@ static int fake_master_get(struct vme_master_resource *image, int *enabled,
>  }
>
>
> -void fake_lm_check(struct fake_driver *bridge, unsigned long long addr,
> -               u32 aspace, u32 cycle)
> +static void fake_lm_check(struct fake_driver *bridge, unsigned long long addr,
> +                         u32 aspace, u32 cycle)
>  {
>         struct vme_bridge *fake_bridge;
>         unsigned long long lm_base;
> @@ -616,8 +616,8 @@ static ssize_t fake_master_read(struct vme_master_resource *image, void *buf,
>         return retval;
>  }
>
> -void fake_vmewrite8(struct fake_driver *bridge, u8 *buf,
> -                unsigned long long addr, u32 aspace, u32 cycle)
> +static void fake_vmewrite8(struct fake_driver *bridge, u8 *buf,
> +                          unsigned long long addr, u32 aspace, u32 cycle)
>  {
>         int i;
>         unsigned long long start, end, offset;
> @@ -646,8 +646,8 @@ void fake_vmewrite8(struct fake_driver *bridge, u8 *buf,
>
>  }
>
> -void fake_vmewrite16(struct fake_driver *bridge, u16 *buf,
> -               unsigned long long addr, u32 aspace, u32 cycle)
> +static void fake_vmewrite16(struct fake_driver *bridge, u16 *buf,
> +                           unsigned long long addr, u32 aspace, u32 cycle)
>  {
>         int i;
>         unsigned long long start, end, offset;
> @@ -676,8 +676,8 @@ void fake_vmewrite16(struct fake_driver *bridge, u16 *buf,
>
>  }
>
> -void fake_vmewrite32(struct fake_driver *bridge, u32 *buf,
> -               unsigned long long addr, u32 aspace, u32 cycle)
> +static void fake_vmewrite32(struct fake_driver *bridge, u32 *buf,
> +                           unsigned long long addr, u32 aspace, u32 cycle)
>  {
>         int i;
>         unsigned long long start, end, offset;
> --
> 2.7.4
>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web