All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/tilcdc: mark symbols static where possible
@ 2016-09-08 11:29 Baoyou Xie
  2016-09-08 12:58   ` Jyri Sarha
  0 siblings, 1 reply; 3+ messages in thread
From: Baoyou Xie @ 2016-09-08 11:29 UTC (permalink / raw)
  To: jsarha, tomi.valkeinen, airlied, dri-devel, linux-kernel, arnd,
	baoyou.xie, xie.baoyou

We get 3 warnings when building kernel with W=1:
drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c:142:29: warning: no previous prototype for 'tilcdc_get_overlay' [-Wmissing-prototypes]
drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c:198:13: warning: no previous prototype for 'tilcdc_convert_slave_node' [-Wmissing-prototypes]
drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c:264:12: warning: no previous prototype for 'tilcdc_slave_compat_init' [-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/tilcdc/tilcdc_slave_compat.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c b/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c
index f9c79da..dd8de260 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c
@@ -139,7 +139,7 @@ static void __init tilcdc_node_disable(struct device_node *node)
 	of_update_property(node, prop);
 }
 
-struct device_node * __init tilcdc_get_overlay(struct kfree_table *kft)
+static struct device_node * __init tilcdc_get_overlay(struct kfree_table *kft)
 {
 	const int size = __dtb_tilcdc_slave_compat_end -
 		__dtb_tilcdc_slave_compat_begin;
@@ -195,7 +195,7 @@ static const char * const tilcdc_slave_props[] __initconst = {
 	NULL
 };
 
-void __init tilcdc_convert_slave_node(void)
+static void __init tilcdc_convert_slave_node(void)
 {
 	struct device_node *slave = NULL, *lcdc = NULL;
 	struct device_node *i2c = NULL, *fragment = NULL;
@@ -261,7 +261,7 @@ out:
 	of_node_put(fragment);
 }
 
-int __init tilcdc_slave_compat_init(void)
+static int __init tilcdc_slave_compat_init(void)
 {
 	tilcdc_convert_slave_node();
 	return 0;
-- 
2.7.4

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

* Re: [PATCH] drm/tilcdc: mark symbols static where possible
  2016-09-08 11:29 [PATCH] drm/tilcdc: mark symbols static where possible Baoyou Xie
@ 2016-09-08 12:58   ` Jyri Sarha
  0 siblings, 0 replies; 3+ messages in thread
From: Jyri Sarha @ 2016-09-08 12:58 UTC (permalink / raw)
  To: Baoyou Xie, tomi.valkeinen, airlied, dri-devel, linux-kernel,
	arnd, xie.baoyou

On 09/08/16 14:29, Baoyou Xie wrote:
> We get 3 warnings when building kernel with W=1:
> drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c:142:29: warning: no previous prototype for 'tilcdc_get_overlay' [-Wmissing-prototypes]
> drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c:198:13: warning: no previous prototype for 'tilcdc_convert_slave_node' [-Wmissing-prototypes]
> drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c:264:12: warning: no previous prototype for 'tilcdc_slave_compat_init' [-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>

I'll pick this up.
Thanks,
Jyri


> ---
>  drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c b/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c
> index f9c79da..dd8de260 100644
> --- a/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c
> +++ b/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c
> @@ -139,7 +139,7 @@ static void __init tilcdc_node_disable(struct device_node *node)
>  	of_update_property(node, prop);
>  }
>  
> -struct device_node * __init tilcdc_get_overlay(struct kfree_table *kft)
> +static struct device_node * __init tilcdc_get_overlay(struct kfree_table *kft)
>  {
>  	const int size = __dtb_tilcdc_slave_compat_end -
>  		__dtb_tilcdc_slave_compat_begin;
> @@ -195,7 +195,7 @@ static const char * const tilcdc_slave_props[] __initconst = {
>  	NULL
>  };
>  
> -void __init tilcdc_convert_slave_node(void)
> +static void __init tilcdc_convert_slave_node(void)
>  {
>  	struct device_node *slave = NULL, *lcdc = NULL;
>  	struct device_node *i2c = NULL, *fragment = NULL;
> @@ -261,7 +261,7 @@ out:
>  	of_node_put(fragment);
>  }
>  
> -int __init tilcdc_slave_compat_init(void)
> +static int __init tilcdc_slave_compat_init(void)
>  {
>  	tilcdc_convert_slave_node();
>  	return 0;
> 

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

* Re: [PATCH] drm/tilcdc: mark symbols static where possible
@ 2016-09-08 12:58   ` Jyri Sarha
  0 siblings, 0 replies; 3+ messages in thread
From: Jyri Sarha @ 2016-09-08 12:58 UTC (permalink / raw)
  To: Baoyou Xie, tomi.valkeinen, airlied, dri-devel, linux-kernel,
	arnd, xie.baoyou

On 09/08/16 14:29, Baoyou Xie wrote:
> We get 3 warnings when building kernel with W=1:
> drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c:142:29: warning: no previous prototype for 'tilcdc_get_overlay' [-Wmissing-prototypes]
> drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c:198:13: warning: no previous prototype for 'tilcdc_convert_slave_node' [-Wmissing-prototypes]
> drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c:264:12: warning: no previous prototype for 'tilcdc_slave_compat_init' [-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>

I'll pick this up.
Thanks,
Jyri


> ---
>  drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c b/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c
> index f9c79da..dd8de260 100644
> --- a/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c
> +++ b/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c
> @@ -139,7 +139,7 @@ static void __init tilcdc_node_disable(struct device_node *node)
>  	of_update_property(node, prop);
>  }
>  
> -struct device_node * __init tilcdc_get_overlay(struct kfree_table *kft)
> +static struct device_node * __init tilcdc_get_overlay(struct kfree_table *kft)
>  {
>  	const int size = __dtb_tilcdc_slave_compat_end -
>  		__dtb_tilcdc_slave_compat_begin;
> @@ -195,7 +195,7 @@ static const char * const tilcdc_slave_props[] __initconst = {
>  	NULL
>  };
>  
> -void __init tilcdc_convert_slave_node(void)
> +static void __init tilcdc_convert_slave_node(void)
>  {
>  	struct device_node *slave = NULL, *lcdc = NULL;
>  	struct device_node *i2c = NULL, *fragment = NULL;
> @@ -261,7 +261,7 @@ out:
>  	of_node_put(fragment);
>  }
>  
> -int __init tilcdc_slave_compat_init(void)
> +static int __init tilcdc_slave_compat_init(void)
>  {
>  	tilcdc_convert_slave_node();
>  	return 0;
> 

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2016-09-08 12:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-08 11:29 [PATCH] drm/tilcdc: mark symbols static where possible Baoyou Xie
2016-09-08 12:58 ` Jyri Sarha
2016-09-08 12:58   ` Jyri Sarha

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.