linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: lustre: silence sparse warnings
@ 2015-05-27 12:48 Marcus Folkesson
  2015-05-27 13:21 ` Julia Lawall
  0 siblings, 1 reply; 6+ messages in thread
From: Marcus Folkesson @ 2015-05-27 12:48 UTC (permalink / raw)
  To: Oleg Drokin, Andreas Dilger, Greg Kroah-Hartman, Greg Donald,
	Julia Lawall, Daniel Baluta, Lai Siyao, Andriy Skulysh,
	Joe Perches, Marcus Folkesson
  Cc: HPDD-discuss, devel, linux-kernel

Warnings reported by sparse:
drivers/staging/lustre/lustre/ptlrpc/pinger.c:94:5: warning: symbol 'ptlrpc_ping' was not declared. Should it be static?
drivers/staging/lustre/lustre/ptlrpc/pinger.c:113:6: warning: symbol 'ptlrpc_update_next_ping' was not declared. Should it be static?
drivers/staging/lustre/lustre/ptlrpc/pinger.c:144:6: warning: symbol 'pinger_check_timeout' was not declared. Should it be static?
drivers/staging/lustre/lustre/ptlrpc/pinger.c:425:21: warning: symbol 'ptlrpc_new_timeout' was not declared. Should it be static?
drivers/staging/lustre/lustre/ptlrpc/pinger.c:551:1: warning: symbol 'pet_list' was not declared. Should it be static?

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
---
 drivers/staging/lustre/lustre/ptlrpc/pinger.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ptlrpc/pinger.c b/drivers/staging/lustre/lustre/ptlrpc/pinger.c
index 5abb91c..ff9d904 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/pinger.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/pinger.c
@@ -91,7 +91,7 @@ int ptlrpc_obd_ping(struct obd_device *obd)
 }
 EXPORT_SYMBOL(ptlrpc_obd_ping);
 
-int ptlrpc_ping(struct obd_import *imp)
+static int ptlrpc_ping(struct obd_import *imp)
 {
 	struct ptlrpc_request *req;
 
@@ -110,7 +110,7 @@ int ptlrpc_ping(struct obd_import *imp)
 	return 0;
 }
 
-void ptlrpc_update_next_ping(struct obd_import *imp, int soon)
+static void ptlrpc_update_next_ping(struct obd_import *imp, int soon)
 {
 	int time = soon ? PING_INTERVAL_SHORT : PING_INTERVAL;
 	if (imp->imp_state == LUSTRE_IMP_DISCON) {
@@ -141,7 +141,7 @@ static inline int ptlrpc_next_reconnect(struct obd_import *imp)
 		return cfs_time_shift(obd_timeout);
 }
 
-long pinger_check_timeout(unsigned long time)
+static long pinger_check_timeout(unsigned long time)
 {
 	struct timeout_item *item;
 	unsigned long timeout = PING_INTERVAL;
@@ -422,7 +422,7 @@ EXPORT_SYMBOL(ptlrpc_pinger_del_import);
  * Register a timeout callback to the pinger list, and the callback will
  * be called when timeout happens.
  */
-struct timeout_item *ptlrpc_new_timeout(int time, enum timeout_event event,
+static struct timeout_item *ptlrpc_new_timeout(int time, enum timeout_event event,
 					timeout_cb_t cb, void *data)
 {
 	struct timeout_item *ti;
@@ -548,7 +548,7 @@ void ptlrpc_pinger_wake_up(void)
 static int pet_refcount;
 static int	       pet_state;
 static wait_queue_head_t       pet_waitq;
-LIST_HEAD(pet_list);
+static LIST_HEAD(pet_list);
 static DEFINE_SPINLOCK(pet_lock);
 
 int ping_evictor_wake(struct obd_export *exp)
-- 
1.9.1


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

* Re: [PATCH] staging: lustre: silence sparse warnings
  2015-05-27 12:48 [PATCH] staging: lustre: silence sparse warnings Marcus Folkesson
@ 2015-05-27 13:21 ` Julia Lawall
  2015-05-27 14:47   ` changelog v2 Marcus Folkesson
  0 siblings, 1 reply; 6+ messages in thread
From: Julia Lawall @ 2015-05-27 13:21 UTC (permalink / raw)
  To: Marcus Folkesson
  Cc: Oleg Drokin, Andreas Dilger, Greg Kroah-Hartman, Greg Donald,
	Julia Lawall, Daniel Baluta, Lai Siyao, Andriy Skulysh,
	Joe Perches, HPDD-discuss, devel, linux-kernel

Maybe the explanation should more like "Make functions that are not used
in other files static", rather than just silencing a tool.

julia

On Wed, 27 May 2015, Marcus Folkesson wrote:

> Warnings reported by sparse:
> drivers/staging/lustre/lustre/ptlrpc/pinger.c:94:5: warning: symbol 'ptlrpc_ping' was not declared. Should it be static?
> drivers/staging/lustre/lustre/ptlrpc/pinger.c:113:6: warning: symbol 'ptlrpc_update_next_ping' was not declared. Should it be static?
> drivers/staging/lustre/lustre/ptlrpc/pinger.c:144:6: warning: symbol 'pinger_check_timeout' was not declared. Should it be static?
> drivers/staging/lustre/lustre/ptlrpc/pinger.c:425:21: warning: symbol 'ptlrpc_new_timeout' was not declared. Should it be static?
> drivers/staging/lustre/lustre/ptlrpc/pinger.c:551:1: warning: symbol 'pet_list' was not declared. Should it be static?
>
> Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
> ---
>  drivers/staging/lustre/lustre/ptlrpc/pinger.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/staging/lustre/lustre/ptlrpc/pinger.c b/drivers/staging/lustre/lustre/ptlrpc/pinger.c
> index 5abb91c..ff9d904 100644
> --- a/drivers/staging/lustre/lustre/ptlrpc/pinger.c
> +++ b/drivers/staging/lustre/lustre/ptlrpc/pinger.c
> @@ -91,7 +91,7 @@ int ptlrpc_obd_ping(struct obd_device *obd)
>  }
>  EXPORT_SYMBOL(ptlrpc_obd_ping);
>
> -int ptlrpc_ping(struct obd_import *imp)
> +static int ptlrpc_ping(struct obd_import *imp)
>  {
>  	struct ptlrpc_request *req;
>
> @@ -110,7 +110,7 @@ int ptlrpc_ping(struct obd_import *imp)
>  	return 0;
>  }
>
> -void ptlrpc_update_next_ping(struct obd_import *imp, int soon)
> +static void ptlrpc_update_next_ping(struct obd_import *imp, int soon)
>  {
>  	int time = soon ? PING_INTERVAL_SHORT : PING_INTERVAL;
>  	if (imp->imp_state == LUSTRE_IMP_DISCON) {
> @@ -141,7 +141,7 @@ static inline int ptlrpc_next_reconnect(struct obd_import *imp)
>  		return cfs_time_shift(obd_timeout);
>  }
>
> -long pinger_check_timeout(unsigned long time)
> +static long pinger_check_timeout(unsigned long time)
>  {
>  	struct timeout_item *item;
>  	unsigned long timeout = PING_INTERVAL;
> @@ -422,7 +422,7 @@ EXPORT_SYMBOL(ptlrpc_pinger_del_import);
>   * Register a timeout callback to the pinger list, and the callback will
>   * be called when timeout happens.
>   */
> -struct timeout_item *ptlrpc_new_timeout(int time, enum timeout_event event,
> +static struct timeout_item *ptlrpc_new_timeout(int time, enum timeout_event event,
>  					timeout_cb_t cb, void *data)
>  {
>  	struct timeout_item *ti;
> @@ -548,7 +548,7 @@ void ptlrpc_pinger_wake_up(void)
>  static int pet_refcount;
>  static int	       pet_state;
>  static wait_queue_head_t       pet_waitq;
> -LIST_HEAD(pet_list);
> +static LIST_HEAD(pet_list);
>  static DEFINE_SPINLOCK(pet_lock);
>
>  int ping_evictor_wake(struct obd_export *exp)
> --
> 1.9.1
>
>

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

* changelog v2
  2015-05-27 13:21 ` Julia Lawall
@ 2015-05-27 14:47   ` Marcus Folkesson
  2015-05-27 14:47     ` [PATCH v2] staging: lustre: fix non-static symbol warnings reported by sparse Marcus Folkesson
  0 siblings, 1 reply; 6+ messages in thread
From: Marcus Folkesson @ 2015-05-27 14:47 UTC (permalink / raw)
  To: Oleg Drokin, Andreas Dilger, Greg Kroah-Hartman, Greg Donald,
	Julia Lawall, Daniel Baluta, Lai Siyao, Andriy Skulysh,
	Joe Perches, Marcus Folkesson
  Cc: HPDD-discuss, devel, linux-kernel

Changes since v2:
Change commit message to be more descriptive (thanks to Julia for input)


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

* [PATCH v2] staging: lustre: fix non-static symbol warnings reported by sparse
  2015-05-27 14:47   ` changelog v2 Marcus Folkesson
@ 2015-05-27 14:47     ` Marcus Folkesson
  2015-05-27 14:53       ` Greg Kroah-Hartman
  2015-05-27 14:54       ` Julia Lawall
  0 siblings, 2 replies; 6+ messages in thread
From: Marcus Folkesson @ 2015-05-27 14:47 UTC (permalink / raw)
  To: Oleg Drokin, Andreas Dilger, Greg Kroah-Hartman, Greg Donald,
	Julia Lawall, Daniel Baluta, Lai Siyao, Andriy Skulysh,
	Joe Perches, Marcus Folkesson
  Cc: HPDD-discuss, devel, linux-kernel

Warnings reported by sparse:

drivers/staging/lustre/lustre/ptlrpc/pinger.c:94:5:
warning: symbol 'ptlrpc_ping' was not declared. Should it be static?

drivers/staging/lustre/lustre/ptlrpc/pinger.c:113:6:
warning: symbol 'ptlrpc_update_next_ping' was not declared. Should it be static

drivers/staging/lustre/lustre/ptlrpc/pinger.c:144:6:
warning: symbol 'pinger_check_timeout' was not declared. Should it be static?

drivers/staging/lustre/lustre/ptlrpc/pinger.c:425:21:
warning: symbol 'ptlrpc_new_timeout' was not declared. Should it be static?

drivers/staging/lustre/lustre/ptlrpc/pinger.c:551:1:
warning: symbol 'pet_list' was not declared. Should it be static?

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
---
 drivers/staging/lustre/lustre/ptlrpc/pinger.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ptlrpc/pinger.c b/drivers/staging/lustre/lustre/ptlrpc/pinger.c
index 5abb91c..9fc8156 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/pinger.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/pinger.c
@@ -91,7 +91,7 @@ int ptlrpc_obd_ping(struct obd_device *obd)
 }
 EXPORT_SYMBOL(ptlrpc_obd_ping);
 
-int ptlrpc_ping(struct obd_import *imp)
+static int ptlrpc_ping(struct obd_import *imp)
 {
 	struct ptlrpc_request *req;
 
@@ -110,7 +110,7 @@ int ptlrpc_ping(struct obd_import *imp)
 	return 0;
 }
 
-void ptlrpc_update_next_ping(struct obd_import *imp, int soon)
+static void ptlrpc_update_next_ping(struct obd_import *imp, int soon)
 {
 	int time = soon ? PING_INTERVAL_SHORT : PING_INTERVAL;
 	if (imp->imp_state == LUSTRE_IMP_DISCON) {
@@ -141,7 +141,7 @@ static inline int ptlrpc_next_reconnect(struct obd_import *imp)
 		return cfs_time_shift(obd_timeout);
 }
 
-long pinger_check_timeout(unsigned long time)
+static long pinger_check_timeout(unsigned long time)
 {
 	struct timeout_item *item;
 	unsigned long timeout = PING_INTERVAL;
@@ -422,8 +422,8 @@ EXPORT_SYMBOL(ptlrpc_pinger_del_import);
  * Register a timeout callback to the pinger list, and the callback will
  * be called when timeout happens.
  */
-struct timeout_item *ptlrpc_new_timeout(int time, enum timeout_event event,
-					timeout_cb_t cb, void *data)
+static struct timeout_item *ptlrpc_new_timeout(int time,
+	enum timeout_event event, timeout_cb_t cb, void *data)
 {
 	struct timeout_item *ti;
 
@@ -548,7 +548,7 @@ void ptlrpc_pinger_wake_up(void)
 static int pet_refcount;
 static int	       pet_state;
 static wait_queue_head_t       pet_waitq;
-LIST_HEAD(pet_list);
+static LIST_HEAD(pet_list);
 static DEFINE_SPINLOCK(pet_lock);
 
 int ping_evictor_wake(struct obd_export *exp)
-- 
1.9.1


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

* Re: [PATCH v2] staging: lustre: fix non-static symbol warnings reported by sparse
  2015-05-27 14:47     ` [PATCH v2] staging: lustre: fix non-static symbol warnings reported by sparse Marcus Folkesson
@ 2015-05-27 14:53       ` Greg Kroah-Hartman
  2015-05-27 14:54       ` Julia Lawall
  1 sibling, 0 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2015-05-27 14:53 UTC (permalink / raw)
  To: Marcus Folkesson
  Cc: Oleg Drokin, Andreas Dilger, Greg Donald, Julia Lawall,
	Daniel Baluta, Lai Siyao, Andriy Skulysh, Joe Perches,
	HPDD-discuss, devel, linux-kernel

On Wed, May 27, 2015 at 04:47:56PM +0200, Marcus Folkesson wrote:
> Warnings reported by sparse:
> 
> drivers/staging/lustre/lustre/ptlrpc/pinger.c:94:5:
> warning: symbol 'ptlrpc_ping' was not declared. Should it be static?
> 
> drivers/staging/lustre/lustre/ptlrpc/pinger.c:113:6:
> warning: symbol 'ptlrpc_update_next_ping' was not declared. Should it be static
> 
> drivers/staging/lustre/lustre/ptlrpc/pinger.c:144:6:
> warning: symbol 'pinger_check_timeout' was not declared. Should it be static?
> 
> drivers/staging/lustre/lustre/ptlrpc/pinger.c:425:21:
> warning: symbol 'ptlrpc_new_timeout' was not declared. Should it be static?
> 
> drivers/staging/lustre/lustre/ptlrpc/pinger.c:551:1:
> warning: symbol 'pet_list' was not declared. Should it be static?
> 
> Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
> ---
>  drivers/staging/lustre/lustre/ptlrpc/pinger.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)

What changed in v2 needs to go here, below the --- line, not in a
separate email that will get lost, especially as it has a very odd
subject line :(

Please fix up and resend.

thanks,

greg k-h

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

* Re: [PATCH v2] staging: lustre: fix non-static symbol warnings reported by sparse
  2015-05-27 14:47     ` [PATCH v2] staging: lustre: fix non-static symbol warnings reported by sparse Marcus Folkesson
  2015-05-27 14:53       ` Greg Kroah-Hartman
@ 2015-05-27 14:54       ` Julia Lawall
  1 sibling, 0 replies; 6+ messages in thread
From: Julia Lawall @ 2015-05-27 14:54 UTC (permalink / raw)
  To: Marcus Folkesson
  Cc: Oleg Drokin, Andreas Dilger, Greg Kroah-Hartman, Greg Donald,
	Julia Lawall, Daniel Baluta, Lai Siyao, Andriy Skulysh,
	Joe Perches, HPDD-discuss, devel, linux-kernel

The comment about the v2 change should be under the ---, and not in a
separate message.

julia

On Wed, 27 May 2015, Marcus Folkesson wrote:

> Warnings reported by sparse:
>
> drivers/staging/lustre/lustre/ptlrpc/pinger.c:94:5:
> warning: symbol 'ptlrpc_ping' was not declared. Should it be static?
>
> drivers/staging/lustre/lustre/ptlrpc/pinger.c:113:6:
> warning: symbol 'ptlrpc_update_next_ping' was not declared. Should it be static
>
> drivers/staging/lustre/lustre/ptlrpc/pinger.c:144:6:
> warning: symbol 'pinger_check_timeout' was not declared. Should it be static?
>
> drivers/staging/lustre/lustre/ptlrpc/pinger.c:425:21:
> warning: symbol 'ptlrpc_new_timeout' was not declared. Should it be static?
>
> drivers/staging/lustre/lustre/ptlrpc/pinger.c:551:1:
> warning: symbol 'pet_list' was not declared. Should it be static?
>
> Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
> ---
>  drivers/staging/lustre/lustre/ptlrpc/pinger.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/staging/lustre/lustre/ptlrpc/pinger.c b/drivers/staging/lustre/lustre/ptlrpc/pinger.c
> index 5abb91c..9fc8156 100644
> --- a/drivers/staging/lustre/lustre/ptlrpc/pinger.c
> +++ b/drivers/staging/lustre/lustre/ptlrpc/pinger.c
> @@ -91,7 +91,7 @@ int ptlrpc_obd_ping(struct obd_device *obd)
>  }
>  EXPORT_SYMBOL(ptlrpc_obd_ping);
>
> -int ptlrpc_ping(struct obd_import *imp)
> +static int ptlrpc_ping(struct obd_import *imp)
>  {
>  	struct ptlrpc_request *req;
>
> @@ -110,7 +110,7 @@ int ptlrpc_ping(struct obd_import *imp)
>  	return 0;
>  }
>
> -void ptlrpc_update_next_ping(struct obd_import *imp, int soon)
> +static void ptlrpc_update_next_ping(struct obd_import *imp, int soon)
>  {
>  	int time = soon ? PING_INTERVAL_SHORT : PING_INTERVAL;
>  	if (imp->imp_state == LUSTRE_IMP_DISCON) {
> @@ -141,7 +141,7 @@ static inline int ptlrpc_next_reconnect(struct obd_import *imp)
>  		return cfs_time_shift(obd_timeout);
>  }
>
> -long pinger_check_timeout(unsigned long time)
> +static long pinger_check_timeout(unsigned long time)
>  {
>  	struct timeout_item *item;
>  	unsigned long timeout = PING_INTERVAL;
> @@ -422,8 +422,8 @@ EXPORT_SYMBOL(ptlrpc_pinger_del_import);
>   * Register a timeout callback to the pinger list, and the callback will
>   * be called when timeout happens.
>   */
> -struct timeout_item *ptlrpc_new_timeout(int time, enum timeout_event event,
> -					timeout_cb_t cb, void *data)
> +static struct timeout_item *ptlrpc_new_timeout(int time,
> +	enum timeout_event event, timeout_cb_t cb, void *data)
>  {
>  	struct timeout_item *ti;
>
> @@ -548,7 +548,7 @@ void ptlrpc_pinger_wake_up(void)
>  static int pet_refcount;
>  static int	       pet_state;
>  static wait_queue_head_t       pet_waitq;
> -LIST_HEAD(pet_list);
> +static LIST_HEAD(pet_list);
>  static DEFINE_SPINLOCK(pet_lock);
>
>  int ping_evictor_wake(struct obd_export *exp)
> --
> 1.9.1
>
>

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

end of thread, other threads:[~2015-05-27 14:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-27 12:48 [PATCH] staging: lustre: silence sparse warnings Marcus Folkesson
2015-05-27 13:21 ` Julia Lawall
2015-05-27 14:47   ` changelog v2 Marcus Folkesson
2015-05-27 14:47     ` [PATCH v2] staging: lustre: fix non-static symbol warnings reported by sparse Marcus Folkesson
2015-05-27 14:53       ` Greg Kroah-Hartman
2015-05-27 14:54       ` Julia Lawall

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