All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] staging: lustre: Fix non-ANSI sparse warnings
@ 2013-07-27 22:38 Emil Goode
  2013-07-28 16:19 ` walter harms
  2013-07-28 16:43 ` Greg KH
  0 siblings, 2 replies; 3+ messages in thread
From: Emil Goode @ 2013-07-27 22:38 UTC (permalink / raw)
  To: kernel-janitors

This patch fixes a lot of non-ANSI sparse warnings by adding void to
parameterless functions.

Signed-off-by: Emil Goode <emilgoode@gmail.com>
---
v2: A bit more specific commit message.

 .../lustre/lnet/klnds/socklnd/socklnd_lib-linux.c        |    6 +++---
 drivers/staging/lustre/lnet/lnet/api-ni.c                |    2 +-
 drivers/staging/lustre/lnet/selftest/console.c           |    2 +-
 .../staging/lustre/lustre/libcfs/linux/linux-tracefile.c |   14 +++++++-------
 drivers/staging/lustre/lustre/ptlrpc/pack_generic.c      |    2 +-
 drivers/staging/lustre/lustre/ptlrpc/pinger.c            |    4 ++--
 6 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c
index 3e08fe2..76e442b 100644
--- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c
+++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c
@@ -325,20 +325,20 @@ ksocknal_lib_tunables_init ()
 }
 
 void
-ksocknal_lib_tunables_fini ()
+ksocknal_lib_tunables_fini(void)
 {
 	if (ksocknal_tunables.ksnd_sysctl != NULL)
 		unregister_sysctl_table(ksocknal_tunables.ksnd_sysctl);
 }
 #else
 int
-ksocknal_lib_tunables_init ()
+ksocknal_lib_tunables_init(void)
 {
 	return 0;
 }
 
 void
-ksocknal_lib_tunables_fini ()
+ksocknal_lib_tunables_fini(void)
 {
 }
 #endif /* # if CONFIG_SYSCTL && !CFS_SYSFS_MODULE_PARM */
diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c
index 250c618..160a429 100644
--- a/drivers/staging/lustre/lnet/lnet/api-ni.c
+++ b/drivers/staging/lustre/lnet/lnet/api-ni.c
@@ -1371,7 +1371,7 @@ EXPORT_SYMBOL(LNetNIInit);
  * \return always 0 for current implementation.
  */
 int
-LNetNIFini()
+LNetNIFini(void)
 {
 	LNET_MUTEX_LOCK(&the_lnet.ln_api_mutex);
 
diff --git a/drivers/staging/lustre/lnet/selftest/console.c b/drivers/staging/lustre/lnet/selftest/console.c
index 78e8d04..09e4700 100644
--- a/drivers/staging/lustre/lnet/selftest/console.c
+++ b/drivers/staging/lustre/lnet/selftest/console.c
@@ -1773,7 +1773,7 @@ lstcon_session_info(lst_sid_t *sid_up, int *key_up, unsigned *featp,
 }
 
 int
-lstcon_session_end()
+lstcon_session_end(void)
 {
 	lstcon_rpc_trans_t *trans;
 	lstcon_group_t     *grp;
diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c
index a500a0b..162beee 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c
@@ -51,7 +51,7 @@ char *cfs_trace_console_buffers[NR_CPUS][CFS_TCD_TYPE_MAX];
 
 struct rw_semaphore cfs_tracefile_sem;
 
-int cfs_tracefile_init_arch()
+int cfs_tracefile_init_arch(void)
 {
 	int    i;
 	int    j;
@@ -96,7 +96,7 @@ out:
 	return -ENOMEM;
 }
 
-void cfs_tracefile_fini_arch()
+void cfs_tracefile_fini_arch(void)
 {
 	int    i;
 	int    j;
@@ -116,27 +116,27 @@ void cfs_tracefile_fini_arch()
 	fini_rwsem(&cfs_tracefile_sem);
 }
 
-void cfs_tracefile_read_lock()
+void cfs_tracefile_read_lock(void)
 {
 	down_read(&cfs_tracefile_sem);
 }
 
-void cfs_tracefile_read_unlock()
+void cfs_tracefile_read_unlock(void)
 {
 	up_read(&cfs_tracefile_sem);
 }
 
-void cfs_tracefile_write_lock()
+void cfs_tracefile_write_lock(void)
 {
 	down_write(&cfs_tracefile_sem);
 }
 
-void cfs_tracefile_write_unlock()
+void cfs_tracefile_write_unlock(void)
 {
 	up_write(&cfs_tracefile_sem);
 }
 
-cfs_trace_buf_type_t cfs_trace_buf_idx_get()
+cfs_trace_buf_type_t cfs_trace_buf_idx_get(void)
 {
 	if (in_irq())
 		return CFS_TCD_TYPE_IRQ;
diff --git a/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c b/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c
index ffff648..9c20d0c 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c
@@ -115,7 +115,7 @@ int lustre_msg_check_version(struct lustre_msg *msg, __u32 version)
 EXPORT_SYMBOL(lustre_msg_check_version);
 
 /* early reply size */
-int lustre_msg_early_size()
+int lustre_msg_early_size(void)
 {
 	static int size = 0;
 	if (!size) {
diff --git a/drivers/staging/lustre/lustre/ptlrpc/pinger.c b/drivers/staging/lustre/lustre/ptlrpc/pinger.c
index f521251..79e7d08 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/pinger.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/pinger.c
@@ -51,7 +51,7 @@ struct mutex pinger_mutex;
 static LIST_HEAD(pinger_imports);
 static struct list_head timeout_list = LIST_HEAD_INIT(timeout_list);
 
-int ptlrpc_pinger_suppress_pings()
+int ptlrpc_pinger_suppress_pings(void)
 {
 	return suppress_pings;
 }
@@ -608,7 +608,7 @@ int ptlrpc_pinger_remove_timeouts(void)
 	return 0;
 }
 
-void ptlrpc_pinger_wake_up()
+void ptlrpc_pinger_wake_up(void)
 {
 	thread_add_flags(&pinger_thread, SVC_EVENT);
 	wake_up(&pinger_thread.t_ctl_waitq);
-- 
1.7.10.4


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

* Re: [PATCH v2 1/2] staging: lustre: Fix non-ANSI sparse warnings
  2013-07-27 22:38 [PATCH v2 1/2] staging: lustre: Fix non-ANSI sparse warnings Emil Goode
@ 2013-07-28 16:19 ` walter harms
  2013-07-28 16:43 ` Greg KH
  1 sibling, 0 replies; 3+ messages in thread
From: walter harms @ 2013-07-28 16:19 UTC (permalink / raw)
  To: kernel-janitors



Am 28.07.2013 00:38, schrieb Emil Goode:
> This patch fixes a lot of non-ANSI sparse warnings by adding void to
> parameterless functions.
> 
> Signed-off-by: Emil Goode <emilgoode@gmail.com>
> ---
> v2: A bit more specific commit message.
> 
>  .../lustre/lnet/klnds/socklnd/socklnd_lib-linux.c        |    6 +++---
>  drivers/staging/lustre/lnet/lnet/api-ni.c                |    2 +-
>  drivers/staging/lustre/lnet/selftest/console.c           |    2 +-
>  .../staging/lustre/lustre/libcfs/linux/linux-tracefile.c |   14 +++++++-------
>  drivers/staging/lustre/lustre/ptlrpc/pack_generic.c      |    2 +-
>  drivers/staging/lustre/lustre/ptlrpc/pinger.c            |    4 ++--
>  6 files changed, 15 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c
> index 3e08fe2..76e442b 100644
> --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c
> +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c
> @@ -325,20 +325,20 @@ ksocknal_lib_tunables_init ()
>  }
>  
>  void
> -ksocknal_lib_tunables_fini ()
> +ksocknal_lib_tunables_fini(void)
>  {
>  	if (ksocknal_tunables.ksnd_sysctl != NULL)
>  		unregister_sysctl_table(ksocknal_tunables.ksnd_sysctl);
>  }

this is not needed as unregister_sysctl_table() can handle NULL

>  #else
>  int
> -ksocknal_lib_tunables_init ()
> +ksocknal_lib_tunables_init(void)
>  {
>  	return 0;
>  }
>  
>  void
> -ksocknal_lib_tunables_fini ()
> +ksocknal_lib_tunables_fini(void)
>  {
>  }
>  #endif /* # if CONFIG_SYSCTL && !CFS_SYSFS_MODULE_PARM */
> diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c
> index 250c618..160a429 100644
> --- a/drivers/staging/lustre/lnet/lnet/api-ni.c
> +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c
> @@ -1371,7 +1371,7 @@ EXPORT_SYMBOL(LNetNIInit);
>   * \return always 0 for current implementation.
>   */
>  int
> -LNetNIFini()
> +LNetNIFini(void)
>  {
>  	LNET_MUTEX_LOCK(&the_lnet.ln_api_mutex);
>  
> diff --git a/drivers/staging/lustre/lnet/selftest/console.c b/drivers/staging/lustre/lnet/selftest/console.c
> index 78e8d04..09e4700 100644
> --- a/drivers/staging/lustre/lnet/selftest/console.c
> +++ b/drivers/staging/lustre/lnet/selftest/console.c
> @@ -1773,7 +1773,7 @@ lstcon_session_info(lst_sid_t *sid_up, int *key_up, unsigned *featp,
>  }
>  
>  int
> -lstcon_session_end()
> +lstcon_session_end(void)
>  {
>  	lstcon_rpc_trans_t *trans;
>  	lstcon_group_t     *grp;
> diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c
> index a500a0b..162beee 100644
> --- a/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c
> +++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c
> @@ -51,7 +51,7 @@ char *cfs_trace_console_buffers[NR_CPUS][CFS_TCD_TYPE_MAX];
>  
>  struct rw_semaphore cfs_tracefile_sem;
>  
> -int cfs_tracefile_init_arch()
> +int cfs_tracefile_init_arch(void)
>  {
>  	int    i;
>  	int    j;
> @@ -96,7 +96,7 @@ out:
>  	return -ENOMEM;
>  }
>  
> -void cfs_tracefile_fini_arch()
> +void cfs_tracefile_fini_arch(void)
>  {
>  	int    i;
>  	int    j;
> @@ -116,27 +116,27 @@ void cfs_tracefile_fini_arch()
>  	fini_rwsem(&cfs_tracefile_sem);
>  }
>  
> -void cfs_tracefile_read_lock()
> +void cfs_tracefile_read_lock(void)
>  {
>  	down_read(&cfs_tracefile_sem);
>  }
>  
> -void cfs_tracefile_read_unlock()
> +void cfs_tracefile_read_unlock(void)
>  {
>  	up_read(&cfs_tracefile_sem);
>  }
>  
> -void cfs_tracefile_write_lock()
> +void cfs_tracefile_write_lock(void)
>  {
>  	down_write(&cfs_tracefile_sem);
>  }
>  
> -void cfs_tracefile_write_unlock()
> +void cfs_tracefile_write_unlock(void)
>  {
>  	up_write(&cfs_tracefile_sem);
>  }
>  
> -cfs_trace_buf_type_t cfs_trace_buf_idx_get()
> +cfs_trace_buf_type_t cfs_trace_buf_idx_get(void)
>  {
>  	if (in_irq())
>  		return CFS_TCD_TYPE_IRQ;
> diff --git a/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c b/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c
> index ffff648..9c20d0c 100644
> --- a/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c
> +++ b/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c
> @@ -115,7 +115,7 @@ int lustre_msg_check_version(struct lustre_msg *msg, __u32 version)
>  EXPORT_SYMBOL(lustre_msg_check_version);
>  
>  /* early reply size */
> -int lustre_msg_early_size()
> +int lustre_msg_early_size(void)
>  {
>  	static int size = 0;
>  	if (!size) {
> diff --git a/drivers/staging/lustre/lustre/ptlrpc/pinger.c b/drivers/staging/lustre/lustre/ptlrpc/pinger.c
> index f521251..79e7d08 100644
> --- a/drivers/staging/lustre/lustre/ptlrpc/pinger.c
> +++ b/drivers/staging/lustre/lustre/ptlrpc/pinger.c
> @@ -51,7 +51,7 @@ struct mutex pinger_mutex;
>  static LIST_HEAD(pinger_imports);
>  static struct list_head timeout_list = LIST_HEAD_INIT(timeout_list);
>  
> -int ptlrpc_pinger_suppress_pings()
> +int ptlrpc_pinger_suppress_pings(void)
>  {
>  	return suppress_pings;
>  }
> @@ -608,7 +608,7 @@ int ptlrpc_pinger_remove_timeouts(void)
>  	return 0;
>  }
>  
> -void ptlrpc_pinger_wake_up()
> +void ptlrpc_pinger_wake_up(void)
>  {
>  	thread_add_flags(&pinger_thread, SVC_EVENT);
>  	wake_up(&pinger_thread.t_ctl_waitq);

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

* Re: [PATCH v2 1/2] staging: lustre: Fix non-ANSI sparse warnings
  2013-07-27 22:38 [PATCH v2 1/2] staging: lustre: Fix non-ANSI sparse warnings Emil Goode
  2013-07-28 16:19 ` walter harms
@ 2013-07-28 16:43 ` Greg KH
  1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2013-07-28 16:43 UTC (permalink / raw)
  To: kernel-janitors

On Sun, Jul 28, 2013 at 06:19:29PM +0200, walter harms wrote:
> 
> 
> Am 28.07.2013 00:38, schrieb Emil Goode:
> > This patch fixes a lot of non-ANSI sparse warnings by adding void to
> > parameterless functions.
> > 
> > Signed-off-by: Emil Goode <emilgoode@gmail.com>
> > ---
> > v2: A bit more specific commit message.
> > 
> >  .../lustre/lnet/klnds/socklnd/socklnd_lib-linux.c        |    6 +++---
> >  drivers/staging/lustre/lnet/lnet/api-ni.c                |    2 +-
> >  drivers/staging/lustre/lnet/selftest/console.c           |    2 +-
> >  .../staging/lustre/lustre/libcfs/linux/linux-tracefile.c |   14 +++++++-------
> >  drivers/staging/lustre/lustre/ptlrpc/pack_generic.c      |    2 +-
> >  drivers/staging/lustre/lustre/ptlrpc/pinger.c            |    4 ++--
> >  6 files changed, 15 insertions(+), 15 deletions(-)
> > 
> > diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c
> > index 3e08fe2..76e442b 100644
> > --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c
> > +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c
> > @@ -325,20 +325,20 @@ ksocknal_lib_tunables_init ()
> >  }
> >  
> >  void
> > -ksocknal_lib_tunables_fini ()
> > +ksocknal_lib_tunables_fini(void)
> >  {
> >  	if (ksocknal_tunables.ksnd_sysctl != NULL)
> >  		unregister_sysctl_table(ksocknal_tunables.ksnd_sysctl);
> >  }
> 
> this is not needed as unregister_sysctl_table() can handle NULL

There's lots of cleanup needed in this code, but as that's a separate
thing from what the original poster was doing here, it isn't relevant
for this patch.

Follow-on patches are always welcome...

greg k-h

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

end of thread, other threads:[~2013-07-28 16:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-27 22:38 [PATCH v2 1/2] staging: lustre: Fix non-ANSI sparse warnings Emil Goode
2013-07-28 16:19 ` walter harms
2013-07-28 16:43 ` Greg KH

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.