]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: virNodeDeviceCapVPDParse*: Remove pointless NULL checks
authorPeter Krempa <pkrempa@redhat.com>
Wed, 24 Jan 2024 15:27:35 +0000 (16:27 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 31 Jan 2024 16:24:07 +0000 (17:24 +0100)
The function are never called with NULL argument so the checks can be
removed.

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

index dd174d30200e425f2003bd990fa3d13143a64814..d7e1a23034868ea6ec623c6b1c8ae37aade2a220 100644 (file)
@@ -1023,9 +1023,6 @@ virNodeDeviceCapVPDParseReadOnlyFields(xmlXPathContextPtr ctxt, virPCIVPDResourc
                               "serial_number", "part_number", NULL};
     size_t i = 0;
 
-    if (res == NULL)
-        return -1;
-
     res->ro = virPCIVPDResourceRONew();
 
     while (keywords[i]) {
@@ -1061,9 +1058,6 @@ virNodeDeviceCapVPDParseXML(xmlXPathContextPtr ctxt, virPCIVPDResource **res)
     size_t i = 0;
     g_autoptr(virPCIVPDResource) newres = g_new0(virPCIVPDResource, 1);
 
-    if (res == NULL)
-        return -1;
-
     if (!(newres->name = virXPathString("string(./name)", ctxt))) {
         virReportError(VIR_ERR_XML_ERROR, "%s",
                 _("Could not read a device name from the <name> element"));