]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virPCIVPDParseVPDLargeResourceFields: Refactor return logic
authorPeter Krempa <pkrempa@redhat.com>
Tue, 30 Jan 2024 15:45:39 +0000 (16:45 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 31 Jan 2024 16:24:07 +0000 (17:24 +0100)
commita352bcf1c64e4efaa31ff5b193ff8ff4ca9d1329
tree550a48b393af173572af41d075e5c1ca3006945b
parent378b82dac2f7bb7f20e32c4f0f8db49ff5f36851
virPCIVPDParseVPDLargeResourceFields: Refactor return logic

Rewrite the conditions after exiting the parser so that they are easier
to understand. This partially decreases the granularity of "error"
messages as they are not strictly necessary albeit for debugging.

As it was already observed in this code the logic itself often does
something else than the comment claims, thus the code logic is
preserved.

Changes:
 - any case when not all data was processed is aggregated together and
   gets a common "error" message
 - absence of 'checksum' field is checked separately
 - helper variables are removed as they are no longer needed

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/util/virpcivpd.c