OSDN Git Service

spapr.c: use g_auto* with 'nodename' in CPU DT functions
authorDaniel Henrique Barboza <danielhb413@gmail.com>
Wed, 20 Jan 2021 23:23:04 +0000 (20:23 -0300)
committerDavid Gibson <david@gibson.dropbear.id.au>
Tue, 9 Feb 2021 23:43:49 +0000 (10:43 +1100)
commit7265bc3e5429a630a8de2459d510d5d66a072af9
tree865235e0c6b9f406020ccd93cb22587ba16f1dfb
parent1214d55d1c41fbab3a9973a05085b8760647e411
spapr.c: use g_auto* with 'nodename' in CPU DT functions

Next patch will use the 'nodename' string in spapr_core_dt_populate()
after the point it's being freed today.

Instead of moving 'g_free(nodename)' around, let's do a QoL change in
both CPU DT functions where 'nodename' is being freed, and use
g_autofree to avoid the 'g_free()' call altogether.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20210120232305.241521-2-danielhb413@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/spapr.c