diff mbox series

[23/36] qdev: Make qdev_propinfo_get_uint16() static

Message ID 20201029220246.472693-24-ehabkost@redhat.com (mailing list archive)
State New, archived
Headers show
Series Make qdev static property API usable by any QOM type | expand

Commit Message

Eduardo Habkost Oct. 29, 2020, 10:02 p.m. UTC
There are no users of the function outside qdev-properties.c.
Make function static and rename it to get_uint16().

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: qemu-devel@nongnu.org
---
 hw/core/qdev-prop-internal.h | 2 --
 hw/core/qdev-properties.c    | 6 +++---
 2 files changed, 3 insertions(+), 5 deletions(-)

Comments

Marc-André Lureau Oct. 30, 2020, 4:51 p.m. UTC | #1
On Fri, Oct 30, 2020 at 2:20 AM Eduardo Habkost <ehabkost@redhat.com> wrote:

> There are no users of the function outside qdev-properties.c.
> Make function static and rename it to get_uint16().
>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>


> ---
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: "Daniel P. Berrangé" <berrange@redhat.com>
> Cc: Eduardo Habkost <ehabkost@redhat.com>
> Cc: qemu-devel@nongnu.org
> ---
>  hw/core/qdev-prop-internal.h | 2 --
>  hw/core/qdev-properties.c    | 6 +++---
>  2 files changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/hw/core/qdev-prop-internal.h b/hw/core/qdev-prop-internal.h
> index 49bf557fd5..c8006a21c7 100644
> --- a/hw/core/qdev-prop-internal.h
> +++ b/hw/core/qdev-prop-internal.h
> @@ -20,8 +20,6 @@ void qdev_propinfo_set_default_value_int(ObjectProperty
> *op,
>  void qdev_propinfo_set_default_value_uint(ObjectProperty *op,
>                                            const Property *prop);
>
> -void qdev_propinfo_get_uint16(Object *obj, Visitor *v, const char *name,
> -                              void *opaque, Error **errp);
>  void qdev_propinfo_get_int32(Object *obj, Visitor *v, const char *name,
>                               void *opaque, Error **errp);
>  void qdev_propinfo_get_size32(Object *obj, Visitor *v, const char *name,
> diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
> index 4cb8baa6a0..5189626c09 100644
> --- a/hw/core/qdev-properties.c
> +++ b/hw/core/qdev-properties.c
> @@ -296,8 +296,8 @@ const PropertyInfo qdev_prop_uint8 = {
>
>  /* --- 16bit integer --- */
>
> -void qdev_propinfo_get_uint16(Object *obj, Visitor *v, const char *name,
> -                              void *opaque, Error **errp)
> +static void get_uint16(Object *obj, Visitor *v, const char *name,
> +                       void *opaque, Error **errp)
>  {
>      Property *prop = opaque;
>      uint16_t *ptr = qdev_get_prop_ptr(obj, prop);
> @@ -316,7 +316,7 @@ static void set_uint16(Object *obj, Visitor *v, const
> char *name,
>
>  const PropertyInfo qdev_prop_uint16 = {
>      .name  = "uint16",
> -    .get   = qdev_propinfo_get_uint16,
> +    .get   = get_uint16,
>      .set   = set_uint16,
>      .set_default_value = qdev_propinfo_set_default_value_uint,
>  };
> --
> 2.28.0
>
>
>
diff mbox series

Patch

diff --git a/hw/core/qdev-prop-internal.h b/hw/core/qdev-prop-internal.h
index 49bf557fd5..c8006a21c7 100644
--- a/hw/core/qdev-prop-internal.h
+++ b/hw/core/qdev-prop-internal.h
@@ -20,8 +20,6 @@  void qdev_propinfo_set_default_value_int(ObjectProperty *op,
 void qdev_propinfo_set_default_value_uint(ObjectProperty *op,
                                           const Property *prop);
 
-void qdev_propinfo_get_uint16(Object *obj, Visitor *v, const char *name,
-                              void *opaque, Error **errp);
 void qdev_propinfo_get_int32(Object *obj, Visitor *v, const char *name,
                              void *opaque, Error **errp);
 void qdev_propinfo_get_size32(Object *obj, Visitor *v, const char *name,
diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
index 4cb8baa6a0..5189626c09 100644
--- a/hw/core/qdev-properties.c
+++ b/hw/core/qdev-properties.c
@@ -296,8 +296,8 @@  const PropertyInfo qdev_prop_uint8 = {
 
 /* --- 16bit integer --- */
 
-void qdev_propinfo_get_uint16(Object *obj, Visitor *v, const char *name,
-                              void *opaque, Error **errp)
+static void get_uint16(Object *obj, Visitor *v, const char *name,
+                       void *opaque, Error **errp)
 {
     Property *prop = opaque;
     uint16_t *ptr = qdev_get_prop_ptr(obj, prop);
@@ -316,7 +316,7 @@  static void set_uint16(Object *obj, Visitor *v, const char *name,
 
 const PropertyInfo qdev_prop_uint16 = {
     .name  = "uint16",
-    .get   = qdev_propinfo_get_uint16,
+    .get   = get_uint16,
     .set   = set_uint16,
     .set_default_value = qdev_propinfo_set_default_value_uint,
 };