vbox: vboxDumpAudio: invert conditions

Elimination of the positive conditions reduces
the indentation by two levels.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
Ján Tomko 2020-10-02 19:55:02 +02:00
parent a7464a3f01
commit 4a1f4e898b

View File

@ -3798,20 +3798,16 @@ vboxDumpAudio(virDomainDefPtr def, vboxDriverPtr data G_GNUC_UNUSED,
PRUint32 audioController = AudioControllerType_AC97; PRUint32 audioController = AudioControllerType_AC97;
def->nsounds = 1; def->nsounds = 1;
if (VIR_ALLOC_N(def->sounds, def->nsounds) >= 0) { if (VIR_ALLOC_N(def->sounds, def->nsounds) < 0)
if (VIR_ALLOC(def->sounds[0]) >= 0) { return;
gVBoxAPI.UIAudioAdapter.GetAudioController(audioAdapter, &audioController); if (VIR_ALLOC(def->sounds[0]) < 0)
if (audioController == AudioControllerType_SB16) { return;
def->sounds[0]->model = VIR_DOMAIN_SOUND_MODEL_SB16;
} else if (audioController == AudioControllerType_AC97) { gVBoxAPI.UIAudioAdapter.GetAudioController(audioAdapter, &audioController);
def->sounds[0]->model = VIR_DOMAIN_SOUND_MODEL_AC97; if (audioController == AudioControllerType_SB16) {
} def->sounds[0]->model = VIR_DOMAIN_SOUND_MODEL_SB16;
} else { } else if (audioController == AudioControllerType_AC97) {
VIR_FREE(def->sounds); def->sounds[0]->model = VIR_DOMAIN_SOUND_MODEL_AC97;
def->nsounds = 0;
}
} else {
def->nsounds = 0;
} }
} }
VBOX_RELEASE(audioAdapter); VBOX_RELEASE(audioAdapter);