From 73f4b3088251cbe69a2c05b94063c942fde8b59b Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Mon, 9 Jul 2012 14:08:00 +0200 Subject: [PATCH] storage_conf: Break long line and polish coding style --- src/conf/storage_conf.c | 12 ++++++------ src/storage/storage_backend_fs.c | 3 +-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index bf4567f311..ab8df9eb5a 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -593,19 +593,19 @@ virStoragePoolDefParseSourceString(const char *srcSpec, xmlXPathContextPtr xpath_ctxt = NULL; virStoragePoolSourcePtr def = NULL, ret = NULL; - if (!(doc = virXMLParseStringCtxt(srcSpec, _("(storage_source_specification)"), &xpath_ctxt))) { + if (!(doc = virXMLParseStringCtxt(srcSpec, + _("(storage_source_specification)"), + &xpath_ctxt))) goto cleanup; - } if (VIR_ALLOC(def) < 0) { virReportOOMError(); goto cleanup; } - node = virXPathNode("/source", xpath_ctxt); - if (!node) { - virStorageReportError(VIR_ERR_XML_ERROR, - "%s", _("root element was not source")); + if (!(node = virXPathNode("/source", xpath_ctxt))) { + virStorageReportError(VIR_ERR_XML_ERROR, "%s", + _("root element was not source")); goto cleanup; } diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c index 87d9192967..c736496ef3 100644 --- a/src/storage/storage_backend_fs.c +++ b/src/storage/storage_backend_fs.c @@ -190,8 +190,7 @@ virStorageBackendFileSystemNetFindPoolSourcesFunc(virStoragePoolObjPtr pool ATTR path = groups[0]; - name = strrchr(path, '/'); - if (name == NULL) { + if (!(name = strrchr(path, '/'))) { virStorageReportError(VIR_ERR_INTERNAL_ERROR, _("invalid netfs path (no /): %s"), path); goto cleanup;