[libvirt] [PATCH 10/22] util: Remove NONNULL(1) for virBitmapParseUnlimited

John Ferlan jferlan at redhat.com
Wed Mar 22 14:21:23 UTC 2017


The code checks and handles a NULL 'str', so just remove the NONNULL.

Update the error message to add the NULLSTR() around 'str' also.

Signed-off-by: John Ferlan <jferlan at redhat.com>
---
 src/util/virbitmap.c | 2 +-
 src/util/virbitmap.h | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/util/virbitmap.c b/src/util/virbitmap.c
index d263d73..eac63d9 100644
--- a/src/util/virbitmap.c
+++ b/src/util/virbitmap.c
@@ -647,7 +647,7 @@ virBitmapParseUnlimited(const char *str)
 
  error:
     virReportError(VIR_ERR_INVALID_ARG,
-                   _("Failed to parse bitmap '%s'"), str);
+                   _("Failed to parse bitmap '%s'"), NULLSTR(str));
     virBitmapFree(bitmap);
     return NULL;
 }
diff --git a/src/util/virbitmap.h b/src/util/virbitmap.h
index 3ba40ae..36282af 100644
--- a/src/util/virbitmap.h
+++ b/src/util/virbitmap.h
@@ -95,8 +95,7 @@ virBitmapParseSeparator(const char *str,
                         virBitmapPtr *bitmap,
                         size_t bitmapSize);
 virBitmapPtr
-virBitmapParseUnlimited(const char *str)
-    ATTRIBUTE_NONNULL(1);
+virBitmapParseUnlimited(const char *str);
 
 virBitmapPtr virBitmapNewCopy(virBitmapPtr src) ATTRIBUTE_NONNULL(1);
 
-- 
2.9.3




More information about the libvir-list mailing list