From 5c11e165fd89d72b054cd991485d93be2370f227 Mon Sep 17 00:00:00 2001 From: Matt Coleman Date: Thu, 5 Nov 2020 22:32:41 -0500 Subject: [PATCH] domain_conf: make virDomainChr/RNG/Video/VsockDefPostParse() and virDomainNVRAMDefFormat() void These functions always return zero, so they might as well be void. Signed-off-by: Matt Coleman Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index d4590e7d39..0233fd7607 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -5177,7 +5177,7 @@ virDomainCheckVirtioOptions(virDomainVirtioOptionsPtr virtio) } -static int +static void virDomainChrDefPostParse(virDomainChrDefPtr chr, const virDomainDef *def) { @@ -5204,12 +5204,10 @@ virDomainChrDefPostParse(virDomainChrDefPtr chr, chr->target.port = maxport + 1; } - - return 0; } -static int +static void virDomainRNGDefPostParse(virDomainRNGDefPtr rng) { /* set default path for virtio-rng "random" backend to /dev/random */ @@ -5217,8 +5215,6 @@ virDomainRNGDefPostParse(virDomainRNGDefPtr rng) !rng->source.file) { rng->source.file = g_strdup("/dev/random"); } - - return 0; } @@ -5298,7 +5294,7 @@ virDomainDiskDefPostParse(virDomainDiskDefPtr disk, } -static int +static void virDomainVideoDefPostParse(virDomainVideoDefPtr video, const virDomainDef *def) { @@ -5310,8 +5306,6 @@ virDomainVideoDefPostParse(virDomainVideoDefPtr video, video->ram = VIR_ROUND_UP_POWER_OF_TWO(video->ram); video->vram = VIR_ROUND_UP_POWER_OF_TWO(video->vram); - - return 0; } @@ -5344,7 +5338,7 @@ virDomainNetDefPostParse(virDomainNetDefPtr net) } -static int +static void virDomainVsockDefPostParse(virDomainVsockDefPtr vsock) { if (vsock->auto_cid == VIR_TRISTATE_BOOL_ABSENT) { @@ -5353,8 +5347,6 @@ virDomainVsockDefPostParse(virDomainVsockDefPtr vsock) else vsock->auto_cid = VIR_TRISTATE_BOOL_YES; } - - return 0; } @@ -5386,11 +5378,13 @@ virDomainDeviceDefPostParseCommon(virDomainDeviceDefPtr dev, switch ((virDomainDeviceType)dev->type) { case VIR_DOMAIN_DEVICE_CHR: - ret = virDomainChrDefPostParse(dev->data.chr, def); + virDomainChrDefPostParse(dev->data.chr, def); + ret = 0; break; case VIR_DOMAIN_DEVICE_RNG: - ret = virDomainRNGDefPostParse(dev->data.rng); + virDomainRNGDefPostParse(dev->data.rng); + ret = 0; break; case VIR_DOMAIN_DEVICE_DISK: @@ -5398,7 +5392,8 @@ virDomainDeviceDefPostParseCommon(virDomainDeviceDefPtr dev, break; case VIR_DOMAIN_DEVICE_VIDEO: - ret = virDomainVideoDefPostParse(dev->data.video, def); + virDomainVideoDefPostParse(dev->data.video, def); + ret = 0; break; case VIR_DOMAIN_DEVICE_HOSTDEV: @@ -5414,7 +5409,8 @@ virDomainDeviceDefPostParseCommon(virDomainDeviceDefPtr dev, break; case VIR_DOMAIN_DEVICE_VSOCK: - ret = virDomainVsockDefPostParse(dev->data.vsock); + virDomainVsockDefPostParse(dev->data.vsock); + ret = 0; break; case VIR_DOMAIN_DEVICE_MEMORY: @@ -27719,7 +27715,7 @@ virDomainMemballoonDefFormat(virBufferPtr buf, return 0; } -static int +static void virDomainNVRAMDefFormat(virBufferPtr buf, virDomainNVRAMDefPtr def, unsigned int flags) @@ -27730,8 +27726,6 @@ virDomainNVRAMDefFormat(virBufferPtr buf, virBufferAdjustIndent(buf, -2); virBufferAddLit(buf, "\n"); - - return 0; }