mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/8] common/kallsyms.c: Fix sparse warning
@ 2014-02-16  7:24 Alexander Shiyan
  2014-02-16  7:24 ` [PATCH 2/8] drivers/clk/clk-fixed.c: " Alexander Shiyan
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Alexander Shiyan @ 2014-02-16  7:24 UTC (permalink / raw)
  To: barebox

CHECK   common/kallsyms.c
common/kallsyms.c:170:12: warning: symbol 'kallsyms_lookup' was not declared. Should it be static?

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 common/kallsyms.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/kallsyms.c b/common/kallsyms.c
index 94dfcdc..121b77c 100644
--- a/common/kallsyms.c
+++ b/common/kallsyms.c
@@ -167,10 +167,10 @@ static unsigned long get_symbol_pos(unsigned long addr,
  *   It resides in a module.
  * - We also guarantee that modname will be valid until rescheduled.
  */
-const char *kallsyms_lookup(unsigned long addr,
-			    unsigned long *symbolsize,
-			    unsigned long *offset,
-			    char **modname, char *namebuf)
+static const char *kallsyms_lookup(unsigned long addr,
+				   unsigned long *symbolsize,
+				   unsigned long *offset,
+				   char **modname, char *namebuf)
 {
 	namebuf[KSYM_NAME_LEN - 1] = 0;
 	namebuf[0] = 0;
-- 
1.8.3.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 2/8] drivers/clk/clk-fixed.c: Fix sparse warning
  2014-02-16  7:24 [PATCH 1/8] common/kallsyms.c: Fix sparse warning Alexander Shiyan
@ 2014-02-16  7:24 ` Alexander Shiyan
  2014-02-16  7:24 ` [PATCH 3/8] drivers/clk/clk-fixed-factor.c: " Alexander Shiyan
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Alexander Shiyan @ 2014-02-16  7:24 UTC (permalink / raw)
  To: barebox

drivers/clk/clk-fixed.c:35:16: warning: symbol 'clk_fixed_ops' was not declared. Should it be static?

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 drivers/clk/clk-fixed.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/clk-fixed.c b/drivers/clk/clk-fixed.c
index 3a38865..8164005 100644
--- a/drivers/clk/clk-fixed.c
+++ b/drivers/clk/clk-fixed.c
@@ -32,7 +32,7 @@ static unsigned long clk_fixed_recalc_rate(struct clk *clk,
 	return fix->rate;
 }
 
-struct clk_ops clk_fixed_ops = {
+static struct clk_ops clk_fixed_ops = {
 	.recalc_rate = clk_fixed_recalc_rate,
 	.is_enabled = clk_is_enabled_always,
 };
-- 
1.8.3.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 3/8] drivers/clk/clk-fixed-factor.c: Fix sparse warning
  2014-02-16  7:24 [PATCH 1/8] common/kallsyms.c: Fix sparse warning Alexander Shiyan
  2014-02-16  7:24 ` [PATCH 2/8] drivers/clk/clk-fixed.c: " Alexander Shiyan
@ 2014-02-16  7:24 ` Alexander Shiyan
  2014-02-16  7:24 ` [PATCH 4/8] drivers/clk/clk-mux.c: " Alexander Shiyan
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Alexander Shiyan @ 2014-02-16  7:24 UTC (permalink / raw)
  To: barebox

drivers/clk/clk-fixed-factor.c:38:16: warning: symbol 'clk_fixed_factor_ops' was not declared. Should it be static?

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 drivers/clk/clk-fixed-factor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/clk-fixed-factor.c b/drivers/clk/clk-fixed-factor.c
index 52e7c16..f0ecbd3 100644
--- a/drivers/clk/clk-fixed-factor.c
+++ b/drivers/clk/clk-fixed-factor.c
@@ -35,7 +35,7 @@ static unsigned long clk_fixed_factor_recalc_rate(struct clk *clk,
 	return (parent_rate / f->div) * f->mult;
 }
 
-struct clk_ops clk_fixed_factor_ops = {
+static struct clk_ops clk_fixed_factor_ops = {
 	.recalc_rate = clk_fixed_factor_recalc_rate,
 };
 
-- 
1.8.3.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 4/8] drivers/clk/clk-mux.c: Fix sparse warning
  2014-02-16  7:24 [PATCH 1/8] common/kallsyms.c: Fix sparse warning Alexander Shiyan
  2014-02-16  7:24 ` [PATCH 2/8] drivers/clk/clk-fixed.c: " Alexander Shiyan
  2014-02-16  7:24 ` [PATCH 3/8] drivers/clk/clk-fixed-factor.c: " Alexander Shiyan
@ 2014-02-16  7:24 ` Alexander Shiyan
  2014-02-16  7:24 ` [PATCH 5/8] drivers/clk/clk-gate.c: " Alexander Shiyan
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Alexander Shiyan @ 2014-02-16  7:24 UTC (permalink / raw)
  To: barebox

drivers/clk/clk-mux.c:53:16: warning: symbol 'clk_mux_ops' was not declared. Should it be static?

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 drivers/clk/clk-mux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/clk-mux.c b/drivers/clk/clk-mux.c
index 47efe12..b22bdd1 100644
--- a/drivers/clk/clk-mux.c
+++ b/drivers/clk/clk-mux.c
@@ -50,7 +50,7 @@ static int clk_mux_set_parent(struct clk *clk, u8 idx)
 	return 0;
 }
 
-struct clk_ops clk_mux_ops = {
+static struct clk_ops clk_mux_ops = {
 	.get_parent = clk_mux_get_parent,
 	.set_parent = clk_mux_set_parent,
 };
-- 
1.8.3.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 5/8] drivers/clk/clk-gate.c: Fix sparse warning
  2014-02-16  7:24 [PATCH 1/8] common/kallsyms.c: Fix sparse warning Alexander Shiyan
                   ` (2 preceding siblings ...)
  2014-02-16  7:24 ` [PATCH 4/8] drivers/clk/clk-mux.c: " Alexander Shiyan
@ 2014-02-16  7:24 ` Alexander Shiyan
  2014-02-16  7:24 ` [PATCH 6/8] drivers/clk/clk-divider-table.c: " Alexander Shiyan
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Alexander Shiyan @ 2014-02-16  7:24 UTC (permalink / raw)
  To: barebox

drivers/clk/clk-gate.c:79:16: warning: symbol 'clk_gate_ops' was not declared. Should it be static?

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 drivers/clk/clk-gate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/clk-gate.c b/drivers/clk/clk-gate.c
index f33effd..baec855 100644
--- a/drivers/clk/clk-gate.c
+++ b/drivers/clk/clk-gate.c
@@ -76,7 +76,7 @@ static int clk_gate_is_enabled(struct clk *clk)
 		return g->flags & CLK_GATE_INVERTED ? 1 : 0;
 }
 
-struct clk_ops clk_gate_ops = {
+static struct clk_ops clk_gate_ops = {
 	.enable = clk_gate_enable,
 	.disable = clk_gate_disable,
 	.is_enabled = clk_gate_is_enabled,
-- 
1.8.3.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 6/8] drivers/clk/clk-divider-table.c: Fix sparse warning
  2014-02-16  7:24 [PATCH 1/8] common/kallsyms.c: Fix sparse warning Alexander Shiyan
                   ` (3 preceding siblings ...)
  2014-02-16  7:24 ` [PATCH 5/8] drivers/clk/clk-gate.c: " Alexander Shiyan
@ 2014-02-16  7:24 ` Alexander Shiyan
  2014-02-16  7:24 ` [PATCH 7/8] drivers/i2c/i2c.c: Fix sparse warnings Alexander Shiyan
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Alexander Shiyan @ 2014-02-16  7:24 UTC (permalink / raw)
  To: barebox

drivers/clk/clk-divider-table.c:81:16: warning: symbol 'clk_divider_table_ops' was not declared. Should it be static?

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 drivers/clk/clk-divider-table.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/clk-divider-table.c b/drivers/clk/clk-divider-table.c
index 204e24d..fd2d3fc 100644
--- a/drivers/clk/clk-divider-table.c
+++ b/drivers/clk/clk-divider-table.c
@@ -78,7 +78,7 @@ static unsigned long clk_divider_recalc_rate(struct clk *clk,
 	return parent_rate / div->table[val].div;
 }
 
-struct clk_ops clk_divider_table_ops = {
+static struct clk_ops clk_divider_table_ops = {
 	.set_rate = clk_divider_set_rate,
 	.recalc_rate = clk_divider_recalc_rate,
 };
-- 
1.8.3.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 7/8] drivers/i2c/i2c.c: Fix sparse warnings
  2014-02-16  7:24 [PATCH 1/8] common/kallsyms.c: Fix sparse warning Alexander Shiyan
                   ` (4 preceding siblings ...)
  2014-02-16  7:24 ` [PATCH 6/8] drivers/clk/clk-divider-table.c: " Alexander Shiyan
@ 2014-02-16  7:24 ` Alexander Shiyan
  2014-02-16  7:24 ` [PATCH 8/8] drivers/of/base.c: " Alexander Shiyan
  2014-02-17  7:25 ` [PATCH 1/8] common/kallsyms.c: Fix sparse warning Sascha Hauer
  7 siblings, 0 replies; 10+ messages in thread
From: Alexander Shiyan @ 2014-02-16  7:24 UTC (permalink / raw)
  To: barebox

drivers/i2c/i2c.c:246:19: warning: symbol 'i2c_new_device' was not declared. Should it be static?
drivers/i2c/i2c.c:274:6: warning: symbol 'of_i2c_register_devices' was not declared. Should it be static?

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 drivers/i2c/i2c.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/i2c/i2c.c b/drivers/i2c/i2c.c
index 3b9f601..f8785cb 100644
--- a/drivers/i2c/i2c.c
+++ b/drivers/i2c/i2c.c
@@ -243,8 +243,8 @@ EXPORT_SYMBOL(i2c_write_reg);
  *
  * Returns the new device, or NULL.
  */
-struct i2c_client *i2c_new_device(struct i2c_adapter *adapter,
-				  struct i2c_board_info *chip)
+static struct i2c_client *i2c_new_device(struct i2c_adapter *adapter,
+					 struct i2c_board_info *chip)
 {
 	struct i2c_client *client;
 	int status;
@@ -269,9 +269,8 @@ struct i2c_client *i2c_new_device(struct i2c_adapter *adapter,
 
 	return client;
 }
-EXPORT_SYMBOL(i2c_new_device);
 
-void of_i2c_register_devices(struct i2c_adapter *adap)
+static void of_i2c_register_devices(struct i2c_adapter *adap)
 {
 	struct device_node *n;
 
-- 
1.8.3.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 8/8] drivers/of/base.c: Fix sparse warnings
  2014-02-16  7:24 [PATCH 1/8] common/kallsyms.c: Fix sparse warning Alexander Shiyan
                   ` (5 preceding siblings ...)
  2014-02-16  7:24 ` [PATCH 7/8] drivers/i2c/i2c.c: Fix sparse warnings Alexander Shiyan
@ 2014-02-16  7:24 ` Alexander Shiyan
  2014-02-17  7:25 ` [PATCH 1/8] common/kallsyms.c: Fix sparse warning Sascha Hauer
  7 siblings, 0 replies; 10+ messages in thread
From: Alexander Shiyan @ 2014-02-16  7:24 UTC (permalink / raw)
  To: barebox

drivers/of/base.c:70:20: warning: symbol 'root_node' was not declared. Should it be static?
drivers/of/base.c:72:20: warning: symbol 'of_aliases' was not declared. Should it be static?
drivers/of/base.c:1724:20: warning: symbol 'of_chosen' was not declared. Should it be static?
drivers/of/base.c:1725:12: warning: symbol 'of_model' was not declared. Should it be static?

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 drivers/of/base.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/of/base.c b/drivers/of/base.c
index 6e5e7d6..104b6da 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -67,9 +67,9 @@ struct alias_prop {
 
 static LIST_HEAD(aliases_lookup);
 
-struct device_node *root_node;
+static struct device_node *root_node;
 
-struct device_node *of_aliases;
+static struct device_node *of_aliases;
 
 #define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
 #define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1
@@ -1721,8 +1721,8 @@ int of_add_memory(struct device_node *node, bool dump)
 	return 0;
 }
 
-struct device_node *of_chosen;
-const char *of_model;
+static struct device_node *of_chosen;
+static const char *of_model;
 
 const char *of_get_model(void)
 {
-- 
1.8.3.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH 1/8] common/kallsyms.c: Fix sparse warning
  2014-02-16  7:24 [PATCH 1/8] common/kallsyms.c: Fix sparse warning Alexander Shiyan
                   ` (6 preceding siblings ...)
  2014-02-16  7:24 ` [PATCH 8/8] drivers/of/base.c: " Alexander Shiyan
@ 2014-02-17  7:25 ` Sascha Hauer
  2014-02-17  7:30   ` Alexander Shiyan
  7 siblings, 1 reply; 10+ messages in thread
From: Sascha Hauer @ 2014-02-17  7:25 UTC (permalink / raw)
  To: Alexander Shiyan; +Cc: barebox

On Sun, Feb 16, 2014 at 11:24:30AM +0400, Alexander Shiyan wrote:
> CHECK   common/kallsyms.c
> common/kallsyms.c:170:12: warning: symbol 'kallsyms_lookup' was not declared. Should it be static?
> 
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>

Applied all, although with some of them I'm not sure whether the correct
fix would be to actually add the declaration to a header file instead of
making the symbol static.

Sascha

> ---
>  common/kallsyms.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/common/kallsyms.c b/common/kallsyms.c
> index 94dfcdc..121b77c 100644
> --- a/common/kallsyms.c
> +++ b/common/kallsyms.c
> @@ -167,10 +167,10 @@ static unsigned long get_symbol_pos(unsigned long addr,
>   *   It resides in a module.
>   * - We also guarantee that modname will be valid until rescheduled.
>   */
> -const char *kallsyms_lookup(unsigned long addr,
> -			    unsigned long *symbolsize,
> -			    unsigned long *offset,
> -			    char **modname, char *namebuf)
> +static const char *kallsyms_lookup(unsigned long addr,
> +				   unsigned long *symbolsize,
> +				   unsigned long *offset,
> +				   char **modname, char *namebuf)
>  {
>  	namebuf[KSYM_NAME_LEN - 1] = 0;
>  	namebuf[0] = 0;
> -- 
> 1.8.3.2
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH 1/8] common/kallsyms.c: Fix sparse warning
  2014-02-17  7:25 ` [PATCH 1/8] common/kallsyms.c: Fix sparse warning Sascha Hauer
@ 2014-02-17  7:30   ` Alexander Shiyan
  0 siblings, 0 replies; 10+ messages in thread
From: Alexander Shiyan @ 2014-02-17  7:30 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

Понедельник, 17 февраля 2014, 8:25 +01:00 от Sascha Hauer <s.hauer@pengutronix.de>:
> On Sun, Feb 16, 2014 at 11:24:30AM +0400, Alexander Shiyan wrote:
> > CHECK   common/kallsyms.c
> > common/kallsyms.c:170:12: warning: symbol 'kallsyms_lookup' was not
> declared. Should it be static?
> > 
> > Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
> 
> Applied all, although with some of them I'm not sure whether the correct
> fix would be to actually add the declaration to a header file instead of
> making the symbol static.

You are right, but declaration may be added as they are needed.

---
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2014-02-17  7:31 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-16  7:24 [PATCH 1/8] common/kallsyms.c: Fix sparse warning Alexander Shiyan
2014-02-16  7:24 ` [PATCH 2/8] drivers/clk/clk-fixed.c: " Alexander Shiyan
2014-02-16  7:24 ` [PATCH 3/8] drivers/clk/clk-fixed-factor.c: " Alexander Shiyan
2014-02-16  7:24 ` [PATCH 4/8] drivers/clk/clk-mux.c: " Alexander Shiyan
2014-02-16  7:24 ` [PATCH 5/8] drivers/clk/clk-gate.c: " Alexander Shiyan
2014-02-16  7:24 ` [PATCH 6/8] drivers/clk/clk-divider-table.c: " Alexander Shiyan
2014-02-16  7:24 ` [PATCH 7/8] drivers/i2c/i2c.c: Fix sparse warnings Alexander Shiyan
2014-02-16  7:24 ` [PATCH 8/8] drivers/of/base.c: " Alexander Shiyan
2014-02-17  7:25 ` [PATCH 1/8] common/kallsyms.c: Fix sparse warning Sascha Hauer
2014-02-17  7:30   ` Alexander Shiyan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox