All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Henrique Barboza <danielhb413@gmail.com>
To: qemu-devel@nongnu.org
Cc: Daniel Henrique Barboza <danielhb413@gmail.com>,
	qemu-ppc@nongnu.org, clg@kaod.org, david@gibson.dropbear.id.au
Subject: [PATCH for-7.1 3/9] hw/ppc/spapr_drc.c: use drc->index in trace functions
Date: Fri, 18 Mar 2022 14:33:14 -0300	[thread overview]
Message-ID: <20220318173320.320541-4-danielhb413@gmail.com> (raw)
In-Reply-To: <20220318173320.320541-1-danielhb413@gmail.com>

All the trace calls in the file are using spapr_drc_index(). Let's
convert them to use drc->index.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
---
 hw/ppc/spapr_drc.c | 30 +++++++++++++-----------------
 1 file changed, 13 insertions(+), 17 deletions(-)

diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c
index 1a5e9003b2..1d751fe9cc 100644
--- a/hw/ppc/spapr_drc.c
+++ b/hw/ppc/spapr_drc.c
@@ -81,8 +81,7 @@ static uint32_t drc_isolate_physical(SpaprDrc *drc)
     drc->state = SPAPR_DRC_STATE_PHYSICAL_POWERON;
 
     if (drc->unplug_requested) {
-        uint32_t drc_index = spapr_drc_index(drc);
-        trace_spapr_drc_set_isolation_state_finalizing(drc_index);
+        trace_spapr_drc_set_isolation_state_finalizing(drc->index);
         spapr_drc_release(drc);
     }
 
@@ -247,8 +246,7 @@ static uint32_t drc_set_unusable(SpaprDrc *drc)
 
     drc->state = SPAPR_DRC_STATE_LOGICAL_UNUSABLE;
     if (drc->unplug_requested) {
-        uint32_t drc_index = spapr_drc_index(drc);
-        trace_spapr_drc_set_allocation_state_finalizing(drc_index);
+        trace_spapr_drc_set_allocation_state_finalizing(drc->index);
         spapr_drc_release(drc);
     }
 
@@ -390,7 +388,7 @@ static void prop_get_fdt(Object *obj, Visitor *v, const char *name,
 
 void spapr_drc_attach(SpaprDrc *drc, DeviceState *d)
 {
-    trace_spapr_drc_attach(spapr_drc_index(drc));
+    trace_spapr_drc_attach(drc->index);
 
     g_assert(!drc->dev);
     g_assert((drc->state == SPAPR_DRC_STATE_LOGICAL_UNUSABLE)
@@ -408,14 +406,14 @@ void spapr_drc_unplug_request(SpaprDrc *drc)
 {
     SpaprDrcClass *drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc);
 
-    trace_spapr_drc_unplug_request(spapr_drc_index(drc));
+    trace_spapr_drc_unplug_request(drc->index);
 
     g_assert(drc->dev);
 
     drc->unplug_requested = true;
 
     if (drc->state != drck->empty_state) {
-        trace_spapr_drc_awaiting_quiesce(spapr_drc_index(drc));
+        trace_spapr_drc_awaiting_quiesce(drc->index);
         return;
     }
 
@@ -427,7 +425,7 @@ bool spapr_drc_reset(SpaprDrc *drc)
     SpaprDrcClass *drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc);
     bool unplug_completed = false;
 
-    trace_spapr_drc_reset(spapr_drc_index(drc));
+    trace_spapr_drc_reset(drc->index);
 
     /* immediately upon reset we can safely assume DRCs whose devices
      * are pending removal can be safely removed.
@@ -515,7 +513,7 @@ static void drc_realize(DeviceState *d, Error **errp)
     Object *root_container;
     const char *child_name;
 
-    trace_spapr_drc_realize(spapr_drc_index(drc));
+    trace_spapr_drc_realize(drc->index);
     /* NOTE: we do this as part of realize/unrealize due to the fact
      * that the guest will communicate with the DRC via RTAS calls
      * referencing the global DRC index. By unlinking the DRC
@@ -525,12 +523,12 @@ static void drc_realize(DeviceState *d, Error **errp)
      */
     root_container = container_get(object_get_root(), DRC_CONTAINER_PATH);
     child_name = object_get_canonical_path_component(OBJECT(drc));
-    trace_spapr_drc_realize_child(spapr_drc_index(drc), child_name);
+    trace_spapr_drc_realize_child(drc->index, child_name);
     object_property_add_alias(root_container, link_name,
                               drc->owner, child_name);
     vmstate_register(VMSTATE_IF(drc), spapr_drc_index(drc), &vmstate_spapr_drc,
                      drc);
-    trace_spapr_drc_realize_complete(spapr_drc_index(drc));
+    trace_spapr_drc_realize_complete(drc->index);
 }
 
 static void drc_unrealize(DeviceState *d)
@@ -539,7 +537,7 @@ static void drc_unrealize(DeviceState *d)
     g_autofree gchar *name = g_strdup_printf("%x", spapr_drc_index(drc));
     Object *root_container;
 
-    trace_spapr_drc_unrealize(spapr_drc_index(drc));
+    trace_spapr_drc_unrealize(drc->index);
     vmstate_unregister(VMSTATE_IF(drc), &vmstate_spapr_drc, drc);
     root_container = container_get(object_get_root(), DRC_CONTAINER_PATH);
     object_property_del(root_container, name);
@@ -986,7 +984,7 @@ static uint32_t rtas_set_isolation_state(uint32_t idx, uint32_t state)
         return RTAS_OUT_NO_SUCH_INDICATOR;
     }
 
-    trace_spapr_drc_set_isolation_state(spapr_drc_index(drc), state);
+    trace_spapr_drc_set_isolation_state(drc->index, state);
 
     drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc);
 
@@ -1010,7 +1008,7 @@ static uint32_t rtas_set_allocation_state(uint32_t idx, uint32_t state)
         return RTAS_OUT_NO_SUCH_INDICATOR;
     }
 
-    trace_spapr_drc_set_allocation_state(spapr_drc_index(drc), state);
+    trace_spapr_drc_set_allocation_state(drc->index, state);
 
     switch (state) {
     case SPAPR_DR_ALLOCATION_STATE_USABLE:
@@ -1232,10 +1230,8 @@ static void rtas_ibm_configure_connector(PowerPCCPU *cpu,
         case FDT_END_NODE:
             drc->ccs_depth--;
             if (drc->ccs_depth == 0) {
-                uint32_t drc_index = spapr_drc_index(drc);
-
                 /* done sending the device tree, move to configured state */
-                trace_spapr_drc_set_configured(drc_index);
+                trace_spapr_drc_set_configured(drc->index);
                 drc->state = drck->ready_state;
                 /*
                  * Ensure that we are able to send the FDT fragment
-- 
2.35.1



  parent reply	other threads:[~2022-03-18 17:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-18 17:33 [PATCH for-7.1 0/9] spapr: add drc->index, remove spapr_drc_index() Daniel Henrique Barboza
2022-03-18 17:33 ` [PATCH for-7.1 1/9] hw/ppc/spapr_drc.c: add drc->index Daniel Henrique Barboza
2022-03-18 17:33 ` [PATCH for-7.1 2/9] hw/ppc/spapr_drc.c: redefine 'index' SpaprDRC property Daniel Henrique Barboza
2022-03-18 17:33 ` Daniel Henrique Barboza [this message]
2022-03-18 17:33 ` [PATCH for-7.1 4/9] hw/ppc/spapr_drc.c: use drc->index Daniel Henrique Barboza
2022-03-18 17:33 ` [PATCH for-7.1 5/9] hw/ppc/spapr.c: " Daniel Henrique Barboza
2022-03-18 17:33 ` [PATCH for-7.1 6/9] hw/ppc/spapr_events.c: " Daniel Henrique Barboza
2022-03-18 17:33 ` [PATCH for-7.1 7/9] hw/ppc/spapr_nvdimm.c: " Daniel Henrique Barboza
2022-03-18 17:33 ` [PATCH for-7.1 8/9] hw/ppc/spapr_pci.c: " Daniel Henrique Barboza
2022-03-18 17:33 ` [PATCH for-7.1 9/9] hw/ppc/spapr_drc.c: remove spapr_drc_index() Daniel Henrique Barboza
2022-03-21  3:55 ` [PATCH for-7.1 0/9] spapr: add drc->index, " David Gibson
2022-03-21  7:58   ` Daniel Henrique Barboza
2022-03-22  1:03     ` David Gibson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220318173320.320541-4-danielhb413@gmail.com \
    --to=danielhb413@gmail.com \
    --cc=clg@kaod.org \
    --cc=david@gibson.dropbear.id.au \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.