提交 17b17565 编写于 作者: M Michal Privoznik

Simplify bhyveDriverGetCapabilities()

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: NMichal Privoznik <mprivozn@redhat.com>
上级 87f24f34
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
* bhyve_driver.c: core driver methods for managing bhyve guests * bhyve_driver.c: core driver methods for managing bhyve guests
* *
* Copyright (C) 2014 Roman Bogorodskiy * Copyright (C) 2014 Roman Bogorodskiy
* Copyright (C) 2014 Red Hat, Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
...@@ -123,16 +124,10 @@ bhyveAutostartDomains(bhyveConnPtr driver) ...@@ -123,16 +124,10 @@ bhyveAutostartDomains(bhyveConnPtr driver)
* Returns: a reference to a virCapsPtr instance or NULL * Returns: a reference to a virCapsPtr instance or NULL
*/ */
static virCapsPtr static virCapsPtr
bhyveDriverGetCapabilities(bhyveConnPtr driver) bhyveDriverGetCapabilities(bhyveConnPtr driver ATTRIBUTE_NONNULL)
{ {
virCapsPtr ret = NULL;
if (driver == NULL) return virObjectRef(driver->caps);
return NULL;
ret = virObjectRef(driver->caps);
return ret;
} }
static char * static char *
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册