linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/arm: mark symbols static where possible
@ 2016-09-06  7:23 Baoyou Xie
  2016-09-06  8:07 ` liviu.dudau
  0 siblings, 1 reply; 6+ messages in thread
From: Baoyou Xie @ 2016-09-06  7:23 UTC (permalink / raw)
  To: liviu.dudau, brian.starkey, malidp, airlied
  Cc: dri-devel, linux-kernel, arnd, baoyou.xie, xie.baoyou

We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/arm/malidp_planes.c:49:25: warning: no previous prototype for 'malidp_duplicate_plane_state' [-Wmissing-prototypes]
drivers/gpu/drm/arm/malidp_planes.c:66:6: warning: no previous prototype for 'malidp_destroy_plane_state' [-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/gpu/drm/arm/malidp_planes.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c
index 725098d..5f8bece 100644
--- a/drivers/gpu/drm/arm/malidp_planes.c
+++ b/drivers/gpu/drm/arm/malidp_planes.c
@@ -46,7 +46,8 @@ static void malidp_de_plane_destroy(struct drm_plane *plane)
 	devm_kfree(plane->dev->dev, mp);
 }
 
-struct drm_plane_state *malidp_duplicate_plane_state(struct drm_plane *plane)
+static struct
+drm_plane_state *malidp_duplicate_plane_state(struct drm_plane *plane)
 {
 	struct malidp_plane_state *state, *m_state;
 
@@ -63,7 +64,7 @@ struct drm_plane_state *malidp_duplicate_plane_state(struct drm_plane *plane)
 	return &state->base;
 }
 
-void malidp_destroy_plane_state(struct drm_plane *plane,
+static void malidp_destroy_plane_state(struct drm_plane *plane,
 				struct drm_plane_state *state)
 {
 	struct malidp_plane_state *m_state = to_malidp_plane_state(state);
-- 
2.7.4

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

* Re: [PATCH] drm/arm: mark symbols static where possible
  2016-09-06  7:23 [PATCH] drm/arm: mark symbols static where possible Baoyou Xie
@ 2016-09-06  8:07 ` liviu.dudau
  0 siblings, 0 replies; 6+ messages in thread
From: liviu.dudau @ 2016-09-06  8:07 UTC (permalink / raw)
  To: Baoyou Xie
  Cc: brian.starkey, malidp, airlied, dri-devel, linux-kernel, arnd,
	xie.baoyou

On Tue, Sep 06, 2016 at 03:23:28PM +0800, Baoyou Xie wrote:
> We get 2 warnings when building kernel with W=1:
> drivers/gpu/drm/arm/malidp_planes.c:49:25: warning: no previous prototype for 'malidp_duplicate_plane_state' [-Wmissing-prototypes]
> drivers/gpu/drm/arm/malidp_planes.c:66:6: warning: no previous prototype for 'malidp_destroy_plane_state' [-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: Liviu Dudau <Liviu.Dudau@arm.com>

> ---
>  drivers/gpu/drm/arm/malidp_planes.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c
> index 725098d..5f8bece 100644
> --- a/drivers/gpu/drm/arm/malidp_planes.c
> +++ b/drivers/gpu/drm/arm/malidp_planes.c
> @@ -46,7 +46,8 @@ static void malidp_de_plane_destroy(struct drm_plane *plane)
>  	devm_kfree(plane->dev->dev, mp);
>  }
>  
> -struct drm_plane_state *malidp_duplicate_plane_state(struct drm_plane *plane)
> +static struct
> +drm_plane_state *malidp_duplicate_plane_state(struct drm_plane *plane)
>  {
>  	struct malidp_plane_state *state, *m_state;
>  
> @@ -63,7 +64,7 @@ struct drm_plane_state *malidp_duplicate_plane_state(struct drm_plane *plane)
>  	return &state->base;
>  }
>  
> -void malidp_destroy_plane_state(struct drm_plane *plane,
> +static void malidp_destroy_plane_state(struct drm_plane *plane,
>  				struct drm_plane_state *state)
>  {
>  	struct malidp_plane_state *m_state = to_malidp_plane_state(state);
> -- 
> 2.7.4
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

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

* Re: [PATCH] drm/arm: mark symbols static where possible
  2016-10-24 10:18 ` Arnd Bergmann
@ 2016-10-24 17:50   ` liviu.dudau
  0 siblings, 0 replies; 6+ messages in thread
From: liviu.dudau @ 2016-10-24 17:50 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Baoyou Xie, brian.starkey, malidp, airlied, dri-devel,
	linux-kernel, xie.baoyou, han.fei, tang.qiang007

On Mon, Oct 24, 2016 at 12:18:37PM +0200, Arnd Bergmann wrote:
> On Saturday, October 22, 2016 5:13:01 PM CEST Baoyou Xie wrote:
> > We get 2 warnings when building kernel with W=1:
> > drivers/gpu/drm/arm/malidp_planes.c:49:25: warning: no previous prototype for 'malidp_duplicate_plane_state' [-Wmissing-prototypes]
> > drivers/gpu/drm/arm/malidp_planes.c:66:6: warning: no previous prototype for 'malidp_destroy_plane_state' [-Wmissing-prototypes]
> > 
> > In fact, both 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>
> > ---
> ...
> > @@ -63,7 +64,7 @@ struct drm_plane_state *malidp_duplicate_plane_state(struct drm_plane *plane)
> >  	return &state->base;
> >  }
> >  
> > -void malidp_destroy_plane_state(struct drm_plane *plane,
> > +static void malidp_destroy_plane_state(struct drm_plane *plane,
> >  				struct drm_plane_state *state)
> >  {
> >  	struct malidp_plane_state *m_state = to_malidp_plane_state(state);
> > 
> 
> The change looks correct, but I notice that the two lines of the
> declaration are no longer aligned.
> 
> The file follows the normal style of aligning the argument list
> in the second line to line up with the opening '(', so please keep
> it that way.
> 
> 	Arnd
> 

Fixed it locally and pushed it into my public repo @ git://linux-arm.org/linux-ld.git for-upstream/mali-dp

I will send it to David Airlie as a pull request together with the other patches/cleanups.

Many thanks,
Liviu


-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

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

* Re: [PATCH] drm/arm: mark symbols static where possible
  2016-10-22  9:13 Baoyou Xie
@ 2016-10-24 10:18 ` Arnd Bergmann
  2016-10-24 17:50   ` liviu.dudau
  0 siblings, 1 reply; 6+ messages in thread
From: Arnd Bergmann @ 2016-10-24 10:18 UTC (permalink / raw)
  To: Baoyou Xie
  Cc: liviu.dudau, brian.starkey, malidp, airlied, dri-devel,
	linux-kernel, xie.baoyou, han.fei, tang.qiang007

On Saturday, October 22, 2016 5:13:01 PM CEST Baoyou Xie wrote:
> We get 2 warnings when building kernel with W=1:
> drivers/gpu/drm/arm/malidp_planes.c:49:25: warning: no previous prototype for 'malidp_duplicate_plane_state' [-Wmissing-prototypes]
> drivers/gpu/drm/arm/malidp_planes.c:66:6: warning: no previous prototype for 'malidp_destroy_plane_state' [-Wmissing-prototypes]
> 
> In fact, both 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>
> ---
...
> @@ -63,7 +64,7 @@ struct drm_plane_state *malidp_duplicate_plane_state(struct drm_plane *plane)
>  	return &state->base;
>  }
>  
> -void malidp_destroy_plane_state(struct drm_plane *plane,
> +static void malidp_destroy_plane_state(struct drm_plane *plane,
>  				struct drm_plane_state *state)
>  {
>  	struct malidp_plane_state *m_state = to_malidp_plane_state(state);
> 

The change looks correct, but I notice that the two lines of the
declaration are no longer aligned.

The file follows the normal style of aligning the argument list
in the second line to line up with the opening '(', so please keep
it that way.

	Arnd

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

* [PATCH] drm/arm: mark symbols static where possible
@ 2016-10-22  9:13 Baoyou Xie
  2016-10-24 10:18 ` Arnd Bergmann
  0 siblings, 1 reply; 6+ messages in thread
From: Baoyou Xie @ 2016-10-22  9:13 UTC (permalink / raw)
  To: liviu.dudau, brian.starkey, malidp, airlied
  Cc: dri-devel, linux-kernel, arnd, baoyou.xie, xie.baoyou, han.fei,
	tang.qiang007

We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/arm/malidp_planes.c:49:25: warning: no previous prototype for 'malidp_duplicate_plane_state' [-Wmissing-prototypes]
drivers/gpu/drm/arm/malidp_planes.c:66:6: warning: no previous prototype for 'malidp_destroy_plane_state' [-Wmissing-prototypes]

In fact, both 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/gpu/drm/arm/malidp_planes.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c
index 82c193e..5339e87 100644
--- a/drivers/gpu/drm/arm/malidp_planes.c
+++ b/drivers/gpu/drm/arm/malidp_planes.c
@@ -46,7 +46,8 @@ static void malidp_de_plane_destroy(struct drm_plane *plane)
 	devm_kfree(plane->dev->dev, mp);
 }
 
-struct drm_plane_state *malidp_duplicate_plane_state(struct drm_plane *plane)
+static struct
+drm_plane_state *malidp_duplicate_plane_state(struct drm_plane *plane)
 {
 	struct malidp_plane_state *state, *m_state;
 
@@ -63,7 +64,7 @@ struct drm_plane_state *malidp_duplicate_plane_state(struct drm_plane *plane)
 	return &state->base;
 }
 
-void malidp_destroy_plane_state(struct drm_plane *plane,
+static void malidp_destroy_plane_state(struct drm_plane *plane,
 				struct drm_plane_state *state)
 {
 	struct malidp_plane_state *m_state = to_malidp_plane_state(state);
-- 
2.7.4

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

* [PATCH] drm/arm: mark symbols static where possible
@ 2016-10-22  9:07 Baoyou Xie
  0 siblings, 0 replies; 6+ messages in thread
From: Baoyou Xie @ 2016-10-22  9:07 UTC (permalink / raw)
  To: liviu.dudau, brian.starkey, malidp, airlied, dri-devel
  Cc: linux-kernel, arnd, baoyou.xie, xie.baoyou, han.fei, tang.qiang007

We get 2 warnings when building kernel with W=1:
drivers/gpu/drm/arm/malidp_planes.c:49:25: warning: no previous prototype for 'malidp_duplicate_plane_state' [-Wmissing-prototypes]
drivers/gpu/drm/arm/malidp_planes.c:66:6: warning: no previous prototype for 'malidp_destroy_plane_state' [-Wmissing-prototypes]

In fact, both 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/gpu/drm/arm/malidp_planes.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c
index 82c193e..5339e87 100644
--- a/drivers/gpu/drm/arm/malidp_planes.c
+++ b/drivers/gpu/drm/arm/malidp_planes.c
@@ -46,7 +46,8 @@ static void malidp_de_plane_destroy(struct drm_plane *plane)
 	devm_kfree(plane->dev->dev, mp);
 }
 
-struct drm_plane_state *malidp_duplicate_plane_state(struct drm_plane *plane)
+static struct
+drm_plane_state *malidp_duplicate_plane_state(struct drm_plane *plane)
 {
 	struct malidp_plane_state *state, *m_state;
 
@@ -63,7 +64,7 @@ struct drm_plane_state *malidp_duplicate_plane_state(struct drm_plane *plane)
 	return &state->base;
 }
 
-void malidp_destroy_plane_state(struct drm_plane *plane,
+static void malidp_destroy_plane_state(struct drm_plane *plane,
 				struct drm_plane_state *state)
 {
 	struct malidp_plane_state *m_state = to_malidp_plane_state(state);
-- 
2.7.4

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

end of thread, other threads:[~2016-10-24 17:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-06  7:23 [PATCH] drm/arm: mark symbols static where possible Baoyou Xie
2016-09-06  8:07 ` liviu.dudau
2016-10-22  9:07 Baoyou Xie
2016-10-22  9:13 Baoyou Xie
2016-10-24 10:18 ` Arnd Bergmann
2016-10-24 17:50   ` liviu.dudau

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).