[PATCH 03/11] virDomainChrSourceDefCopy: Don't check arguments against NULL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The only caller of this function
(qemuProcessFindCharDevicePTYsMonitor()) doesn't pass NULL.
Remove corresponding check from virDomainChrSourceDefCopy().

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/conf/domain_conf.c | 3 ---
 src/conf/domain_conf.h | 3 ++-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 5387cd271a..e4abe1854f 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -2738,9 +2738,6 @@ int
 virDomainChrSourceDefCopy(virDomainChrSourceDef *dest,
                           virDomainChrSourceDef *src)
 {
-    if (!dest || !src)
-        return -1;
-
     virDomainChrSourceDefClear(dest);
 
     dest->type = src->type;
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 3e63d2513b..9bf54eee48 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -3348,7 +3348,8 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainSmartcardDef, virDomainSmartcardDefFree);
 void virDomainChrDefFree(virDomainChrDef *def);
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainChrDef, virDomainChrDefFree);
 int virDomainChrSourceDefCopy(virDomainChrSourceDef *dest,
-                              virDomainChrSourceDef *src);
+                              virDomainChrSourceDef *src)
+    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
 void virDomainSoundCodecDefFree(virDomainSoundCodecDef *def);
 ssize_t virDomainSoundDefFind(const virDomainDef *def,
                               const virDomainSoundDef *sound);
-- 
2.34.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux