[PATCH-for-5.2] qapi/error: Make error_vprepend() static

Philippe Mathieu-Daudé posted 1 patch 3 years, 9 months ago
Test docker-quick@centos7 failed
Test docker-mingw@fedora failed
Test checkpatch failed
Test FreeBSD failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200723101453.11129-1-philmd@redhat.com
include/qapi/error.h | 6 ------
util/error.c         | 6 +++++-
2 files changed, 5 insertions(+), 7 deletions(-)
[PATCH-for-5.2] qapi/error: Make error_vprepend() static
Posted by Philippe Mathieu-Daudé 3 years, 9 months ago
error_vprepend() is only used by util/error.c where it is
defined. Make it static to reduce its scope.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 include/qapi/error.h | 6 ------
 util/error.c         | 6 +++++-
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/include/qapi/error.h b/include/qapi/error.h
index 7932594dce..fa2308dedd 100644
--- a/include/qapi/error.h
+++ b/include/qapi/error.h
@@ -384,12 +384,6 @@ void error_propagate(Error **dst_errp, Error *local_err);
 void error_propagate_prepend(Error **dst_errp, Error *local_err,
                              const char *fmt, ...);
 
-/*
- * Prepend some text to @errp's human-readable error message.
- * The text is made by formatting @fmt, @ap like vprintf().
- */
-void error_vprepend(Error *const *errp, const char *fmt, va_list ap);
-
 /*
  * Prepend some text to @errp's human-readable error message.
  * The text is made by formatting @fmt, ... like printf().
diff --git a/util/error.c b/util/error.c
index b6c89d1412..3990b741ff 100644
--- a/util/error.c
+++ b/util/error.c
@@ -121,7 +121,11 @@ void error_setg_file_open_internal(Error **errp,
                               "Could not open '%s'", filename);
 }
 
-void error_vprepend(Error *const *errp, const char *fmt, va_list ap)
+/*
+ * Prepend some text to @errp's human-readable error message.
+ * The text is made by formatting @fmt, @ap like vprintf().
+ */
+static void error_vprepend(Error *const *errp, const char *fmt, va_list ap)
 {
     GString *newmsg;
 
-- 
2.21.3


Re: [PATCH-for-5.2] qapi/error: Make error_vprepend() static
Posted by Li Qiang 3 years, 9 months ago
Philippe Mathieu-Daudé <philmd@redhat.com> 于2020年7月23日周四 下午6:15写道:
>
> error_vprepend() is only used by util/error.c where it is
> defined. Make it static to reduce its scope.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Reviewed-by: Li Qiang <liq3ea@gmail.com>

> ---
>  include/qapi/error.h | 6 ------
>  util/error.c         | 6 +++++-
>  2 files changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/include/qapi/error.h b/include/qapi/error.h
> index 7932594dce..fa2308dedd 100644
> --- a/include/qapi/error.h
> +++ b/include/qapi/error.h
> @@ -384,12 +384,6 @@ void error_propagate(Error **dst_errp, Error *local_err);
>  void error_propagate_prepend(Error **dst_errp, Error *local_err,
>                               const char *fmt, ...);
>
> -/*
> - * Prepend some text to @errp's human-readable error message.
> - * The text is made by formatting @fmt, @ap like vprintf().
> - */
> -void error_vprepend(Error *const *errp, const char *fmt, va_list ap);
> -
>  /*
>   * Prepend some text to @errp's human-readable error message.
>   * The text is made by formatting @fmt, ... like printf().
> diff --git a/util/error.c b/util/error.c
> index b6c89d1412..3990b741ff 100644
> --- a/util/error.c
> +++ b/util/error.c
> @@ -121,7 +121,11 @@ void error_setg_file_open_internal(Error **errp,
>                                "Could not open '%s'", filename);
>  }
>
> -void error_vprepend(Error *const *errp, const char *fmt, va_list ap)
> +/*
> + * Prepend some text to @errp's human-readable error message.
> + * The text is made by formatting @fmt, @ap like vprintf().
> + */
> +static void error_vprepend(Error *const *errp, const char *fmt, va_list ap)
>  {
>      GString *newmsg;
>
> --
> 2.21.3
>
>