]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: Sanitize ATTRIBUTE_NONNULL use in viriscsi.h
authorPeter Krempa <pkrempa@redhat.com>
Tue, 25 Mar 2014 07:17:27 +0000 (08:17 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 25 Mar 2014 07:26:39 +0000 (08:26 +0100)
Some of the function attributes marked as nonnull actually explicitly
handle the arguments for NULL. All changed functions handle missing
"initiatoriqn" argument well and virISCSIScanTargets also handles well
if the return pointers are missing. Remove some of the liberaly used
ATTRIBUTE_NONNULLs as coverity and possibly other compilers that honor
the attribute fail to compile the code.

Flaw introduced in commit 5e1d5dde

src/util/viriscsi.h

index b2dd3f1d1bd670fe2570284bd112e2ae2d458c5d..f4093f7165e14be98f2533bc90377ffb4535a10d 100644 (file)
@@ -33,14 +33,14 @@ int
 virISCSIConnectionLogin(const char *portal,
                         const char *initiatoriqn,
                         const char *target)
-    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
+    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3)
     ATTRIBUTE_RETURN_CHECK;
 
 int
 virISCSIConnectionLogout(const char *portal,
                          const char *initiatoriqn,
                          const char *target)
-    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
+    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3)
     ATTRIBUTE_RETURN_CHECK;
 
 int
@@ -52,8 +52,7 @@ virISCSIScanTargets(const char *portal,
                     const char *initiatoriqn,
                     size_t *ntargetsret,
                     char ***targetsret)
-    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
-    ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
+    ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
 
 int
 virISCSINodeUpdate(const char *portal,