diff mbox series

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

Message ID 20201029220246.472693-24-ehabkost@redhat.com
State Superseded
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

>

>

>


-- 
Marc-André Lureau
<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 30, 2020 at 2:20 AM Eduardo Habkost &lt;<a href="mailto:ehabkost@redhat.com">ehabkost@redhat.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">There are no users of the function outside qdev-properties.c.<br>
Make function static and rename it to get_uint16().<br>
<br>
Signed-off-by: Eduardo Habkost &lt;<a href="mailto:ehabkost@redhat.com" target="_blank">ehabkost@redhat.com</a>&gt;<br></blockquote><div><br></div><div><div>Reviewed-by: Marc-André Lureau &lt;<a href="mailto:marcandre.lureau@redhat.com" target="_blank">marcandre.lureau@redhat.com</a>&gt;</div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

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