]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
Simplify bhyveDriverGetCapabilities()
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 7 Apr 2014 15:25:49 +0000 (17:25 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 8 Apr 2014 07:17:01 +0000 (09:17 +0200)
The driver passed as the only argument to the function should never be
NULL so there's no need to check it. After removing it, the whole
function collapses to a single line doing ref over driver
capabilities.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/bhyve/bhyve_driver.c

index 84d1915b92c157364a3790976cfa9f49f634f58f..6ef9d986569cced2ae39e0d14880674d6ab2b657 100644 (file)
@@ -2,6 +2,7 @@
  * bhyve_driver.c: core driver methods for managing bhyve guests
  *
  * Copyright (C) 2014 Roman Bogorodskiy
+ * Copyright (C) 2014 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -123,16 +124,10 @@ bhyveAutostartDomains(bhyveConnPtr driver)
  * Returns: a reference to a virCapsPtr instance or NULL
  */
 static virCapsPtr
-bhyveDriverGetCapabilities(bhyveConnPtr driver)
+bhyveDriverGetCapabilities(bhyveConnPtr driver ATTRIBUTE_NONNULL)
 {
-    virCapsPtr ret = NULL;
 
-    if (driver == NULL)
-        return NULL;
-
-    ret = virObjectRef(driver->caps);
-
-    return ret;
+    return virObjectRef(driver->caps);
 }
 
 static char *