[dpdk-dev,1/2] log: rte_openlog_stream should be void

Message ID 1429284934-3261-2-git-send-email-stephen@networkplumber.org (mailing list archive)
State Rejected, archived
Headers

Commit Message

Stephen Hemminger April 17, 2015, 3:35 p.m. UTC
  Function always returned 0 and no one was checking anyway.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/librte_eal/common/eal_common_log.c  | 3 +--
 lib/librte_eal/common/include/rte_log.h | 5 +----
 2 files changed, 2 insertions(+), 6 deletions(-)
  

Comments

Bruce Richardson May 19, 2015, 10:24 a.m. UTC | #1
On Fri, Apr 17, 2015 at 08:35:33AM -0700, Stephen Hemminger wrote:
> Function always returned 0 and no one was checking anyway.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

Acked-by: Bruce Richardson <bruce.richardson@intel.com>

> ---
>  lib/librte_eal/common/eal_common_log.c  | 3 +--
>  lib/librte_eal/common/include/rte_log.h | 5 +----
>  2 files changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/lib/librte_eal/common/eal_common_log.c b/lib/librte_eal/common/eal_common_log.c
> index ff44d23..3802f9c 100644
> --- a/lib/librte_eal/common/eal_common_log.c
> +++ b/lib/librte_eal/common/eal_common_log.c
> @@ -158,14 +158,13 @@ rte_log_set_history(int enable)
>  }
>  
>  /* Change the stream that will be used by logging system */
> -int
> +void
>  rte_openlog_stream(FILE *f)
>  {
>  	if (f == NULL)
>  		rte_logs.file = default_log_stream;
>  	else
>  		rte_logs.file = f;
> -	return 0;
>  }
>  
>  /* Set global log level */
> diff --git a/lib/librte_eal/common/include/rte_log.h b/lib/librte_eal/common/include/rte_log.h
> index f83a0d9..888ee19 100644
> --- a/lib/librte_eal/common/include/rte_log.h
> +++ b/lib/librte_eal/common/include/rte_log.h
> @@ -110,11 +110,8 @@ extern FILE *eal_default_log_stream;
>   *
>   * @param f
>   *   Pointer to the stream.
> - * @return
> - *   - 0 on success.
> - *   - Negative on error.
>   */
> -int rte_openlog_stream(FILE *f);
> +void rte_openlog_stream(FILE *f);
>  
>  /**
>   * Set the global log level.
> -- 
> 2.1.4
>
  
Stephen Hemminger July 30, 2015, 12:35 a.m. UTC | #2
On Tue, 19 May 2015 11:24:03 +0100
Bruce Richardson <bruce.richardson@intel.com> wrote:

> On Fri, Apr 17, 2015 at 08:35:33AM -0700, Stephen Hemminger wrote:
> > Function always returned 0 and no one was checking anyway.
> > 
> > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> 
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> 
> > ---
> >  lib/librte_eal/common/eal_common_log.c  | 3 +--
> >  lib/librte_eal/common/include/rte_log.h | 5 +----
> >  2 files changed, 2 insertions(+), 6 deletions(-)
> > 
> > diff --git a/lib/librte_eal/common/eal_common_log.c b/lib/librte_eal/common/eal_common_log.c
> > index ff44d23..3802f9c 100644
> > --- a/lib/librte_eal/common/eal_common_log.c
> > +++ b/lib/librte_eal/common/eal_common_log.c
> > @@ -158,14 +158,13 @@ rte_log_set_history(int enable)
> >  }
> >  
> >  /* Change the stream that will be used by logging system */
> > -int
> > +void
> >  rte_openlog_stream(FILE *f)
> >  {
> >  	if (f == NULL)
> >  		rte_logs.file = default_log_stream;
> >  	else
> >  		rte_logs.file = f;
> > -	return 0;
> >  }
> >  
> >  /* Set global log level */
> > diff --git a/lib/librte_eal/common/include/rte_log.h b/lib/librte_eal/common/include/rte_log.h
> > index f83a0d9..888ee19 100644
> > --- a/lib/librte_eal/common/include/rte_log.h
> > +++ b/lib/librte_eal/common/include/rte_log.h
> > @@ -110,11 +110,8 @@ extern FILE *eal_default_log_stream;
> >   *
> >   * @param f
> >   *   Pointer to the stream.
> > - * @return
> > - *   - 0 on success.
> > - *   - Negative on error.
> >   */
> > -int rte_openlog_stream(FILE *f);
> > +void rte_openlog_stream(FILE *f);
> >  
> >  /**
> >   * Set the global log level.
> > -- 
> > 2.1.4
> > 

Yes it should be void, but technically this is an ABI change.
Please drop the patch.
  

Patch

diff --git a/lib/librte_eal/common/eal_common_log.c b/lib/librte_eal/common/eal_common_log.c
index ff44d23..3802f9c 100644
--- a/lib/librte_eal/common/eal_common_log.c
+++ b/lib/librte_eal/common/eal_common_log.c
@@ -158,14 +158,13 @@  rte_log_set_history(int enable)
 }
 
 /* Change the stream that will be used by logging system */
-int
+void
 rte_openlog_stream(FILE *f)
 {
 	if (f == NULL)
 		rte_logs.file = default_log_stream;
 	else
 		rte_logs.file = f;
-	return 0;
 }
 
 /* Set global log level */
diff --git a/lib/librte_eal/common/include/rte_log.h b/lib/librte_eal/common/include/rte_log.h
index f83a0d9..888ee19 100644
--- a/lib/librte_eal/common/include/rte_log.h
+++ b/lib/librte_eal/common/include/rte_log.h
@@ -110,11 +110,8 @@  extern FILE *eal_default_log_stream;
  *
  * @param f
  *   Pointer to the stream.
- * @return
- *   - 0 on success.
- *   - Negative on error.
  */
-int rte_openlog_stream(FILE *f);
+void rte_openlog_stream(FILE *f);
 
 /**
  * Set the global log level.