mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
block: Clean up local variable shadowing
Local variables shadowing other local variables or parameters make the code needlessly hard to understand. Tracked down with -Wshadow=local. Clean up: delete inner declarations when they are actually redundant, else rename variables. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Acked-by: Anthony PERARD <anthony.perard@citrix.com> Acked-by: Ilya Dryomov <idryomov@gmail.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Message-ID: <20230921121312.1301864-7-armbru@redhat.com>
This commit is contained in:
parent
d25b99c72b
commit
fb2575f954
5 changed files with 27 additions and 26 deletions
|
@ -369,7 +369,7 @@ static void xen_block_get_vdev(Object *obj, Visitor *v, const char *name,
|
|||
case XEN_BLOCK_VDEV_TYPE_XVD:
|
||||
case XEN_BLOCK_VDEV_TYPE_HD:
|
||||
case XEN_BLOCK_VDEV_TYPE_SD: {
|
||||
char *name = disk_to_vbd_name(vdev->disk);
|
||||
char *vbd_name = disk_to_vbd_name(vdev->disk);
|
||||
|
||||
str = g_strdup_printf("%s%s%lu",
|
||||
(vdev->type == XEN_BLOCK_VDEV_TYPE_XVD) ?
|
||||
|
@ -377,8 +377,8 @@ static void xen_block_get_vdev(Object *obj, Visitor *v, const char *name,
|
|||
(vdev->type == XEN_BLOCK_VDEV_TYPE_HD) ?
|
||||
"hd" :
|
||||
"sd",
|
||||
name, vdev->partition);
|
||||
g_free(name);
|
||||
vbd_name, vdev->partition);
|
||||
g_free(vbd_name);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue