From nobody Sat Feb 7 08:07:36 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.24 as permitted sender) client-ip=209.132.183.24; envelope-from=libvir-list-bounces@redhat.com; helo=mx3-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.24 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx3-phx2.redhat.com (mx3-phx2.redhat.com [209.132.183.24]) by mx.zohomail.com with SMTPS id 1488471485592173.5380431014205; Thu, 2 Mar 2017 08:18:05 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v22GEbTc030679; Thu, 2 Mar 2017 11:14:37 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v22GEWrV021768 for ; Thu, 2 Mar 2017 11:14:32 -0500 Received: from localhost.localdomain.com (ovpn-116-78.phx2.redhat.com [10.3.116.78]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v22GEUfh018752 for ; Thu, 2 Mar 2017 11:14:32 -0500 From: John Ferlan To: libvir-list@redhat.com Date: Thu, 2 Mar 2017 11:14:23 -0500 Message-Id: <20170302161427.31535-3-jferlan@redhat.com> In-Reply-To: <20170302161427.31535-1-jferlan@redhat.com> References: <20170302161427.31535-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 2/6] conf: Adjust coding style for nodedev conf sources X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Alter the format of the code to follow more recent style guidelines of two empty lines between functions, function delcs with "[static] type" on one line followed by function name with arguments to functions each on one line. Signed-off-by: John Ferlan --- src/conf/node_device_conf.c | 31 ++++++++++++++++++++++++++++--- src/conf/virnodedeviceobj.c | 38 +++++++++++++++++++++++++++----------- 2 files changed, 55 insertions(+), 14 deletions(-) diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c index bc36527..20c2bcf 100644 --- a/src/conf/node_device_conf.c +++ b/src/conf/node_device_conf.c @@ -86,7 +86,8 @@ virNodeDevCapsDefParseString(const char *xpath, } =20 =20 -void virNodeDeviceDefFree(virNodeDeviceDefPtr def) +void +virNodeDeviceDefFree(virNodeDeviceDefPtr def) { virNodeDevCapsDefPtr caps; =20 @@ -133,6 +134,7 @@ virPCIELinkFormat(virBufferPtr buf, virBufferAddLit(buf, "/>\n"); } =20 + static void virPCIEDeviceInfoFormat(virBufferPtr buf, virPCIEDeviceInfoPtr info) @@ -152,7 +154,9 @@ virPCIEDeviceInfoFormat(virBufferPtr buf, virBufferAddLit(buf, "\n"); } =20 -char *virNodeDeviceDefFormat(const virNodeDeviceDef *def) + +char * +virNodeDeviceDefFormat(const virNodeDeviceDef *def) { virBuffer buf =3D VIR_BUFFER_INITIALIZER; virNodeDevCapsDefPtr caps; @@ -489,6 +493,7 @@ char *virNodeDeviceDefFormat(const virNodeDeviceDef *de= f) return virBufferContentAndReset(&buf); } =20 + /** * virNodeDevCapsDefParseIntOptional: * @xpath: XPath to evaluate @@ -524,6 +529,7 @@ virNodeDevCapsDefParseIntOptional(const char *xpath, return 1; } =20 + static int virNodeDevCapsDefParseULong(const char *xpath, xmlXPathContextPtr ctxt, @@ -547,6 +553,7 @@ virNodeDevCapsDefParseULong(const char *xpath, return 0; } =20 + static int virNodeDevCapsDefParseULongLong(const char *xpath, xmlXPathContextPtr ctxt, @@ -570,6 +577,7 @@ virNodeDevCapsDefParseULongLong(const char *xpath, return 0; } =20 + static int virNodeDevCapDRMParseXML(xmlXPathContextPtr ctxt, virNodeDeviceDefPtr def, @@ -600,6 +608,7 @@ virNodeDevCapDRMParseXML(xmlXPathContextPtr ctxt, return ret; } =20 + static int virNodeDevCapStorageParseXML(xmlXPathContextPtr ctxt, virNodeDeviceDefPtr def, @@ -694,6 +703,7 @@ virNodeDevCapStorageParseXML(xmlXPathContextPtr ctxt, return ret; } =20 + static int virNodeDevCapSCSIParseXML(xmlXPathContextPtr ctxt, virNodeDeviceDefPtr def, @@ -954,6 +964,7 @@ virNodeDevCapNetParseXML(xmlXPathContextPtr ctxt, return ret; } =20 + static int virNodeDevCapUSBInterfaceParseXML(xmlXPathContextPtr ctxt, virNodeDeviceDefPtr def, @@ -998,6 +1009,7 @@ virNodeDevCapUSBInterfaceParseXML(xmlXPathContextPtr c= txt, return ret; } =20 + static int virNodeDevCapsDefParseHexId(const char *xpath, xmlXPathContextPtr ctxt, @@ -1021,6 +1033,7 @@ virNodeDevCapsDefParseHexId(const char *xpath, return 0; } =20 + static int virNodeDevCapUSBDevParseXML(xmlXPathContextPtr ctxt, virNodeDeviceDefPtr def, @@ -1066,6 +1079,7 @@ virNodeDevCapUSBDevParseXML(xmlXPathContextPtr ctxt, return ret; } =20 + static int virNodeDevCapPCIDevIommuGroupParseXML(xmlXPathContextPtr ctxt, xmlNodePtr iommuGroupNode, @@ -1122,6 +1136,7 @@ virNodeDevCapPCIDevIommuGroupParseXML(xmlXPathContext= Ptr ctxt, return ret; } =20 + static int virPCIEDeviceInfoLinkParseXML(xmlXPathContextPtr ctxt, xmlNodePtr linkNode, @@ -1168,6 +1183,7 @@ virPCIEDeviceInfoLinkParseXML(xmlXPathContextPtr ctxt, return ret; } =20 + static int virPCIEDeviceInfoParseXML(xmlXPathContextPtr ctxt, xmlNodePtr pciExpressNode, @@ -1391,6 +1407,7 @@ virNodeDevCapPCIDevParseXML(xmlXPathContextPtr ctxt, return ret; } =20 + static int virNodeDevCapSystemParseXML(xmlXPathContextPtr ctxt, virNodeDeviceDefPtr def, @@ -1435,6 +1452,7 @@ virNodeDevCapSystemParseXML(xmlXPathContextPtr ctxt, return ret; } =20 + static virNodeDevCapsDefPtr virNodeDevCapsDefParseXML(xmlXPathContextPtr ctxt, virNodeDeviceDefPtr def, @@ -1519,6 +1537,7 @@ virNodeDevCapsDefParseXML(xmlXPathContextPtr ctxt, return NULL; } =20 + static virNodeDeviceDefPtr virNodeDeviceDefParseXML(xmlXPathContextPtr ctxt, int create, @@ -1633,6 +1652,7 @@ virNodeDeviceDefParseXML(xmlXPathContextPtr ctxt, return NULL; } =20 + virNodeDeviceDefPtr virNodeDeviceDefParseNode(xmlDocPtr xml, xmlNodePtr root, @@ -1664,6 +1684,7 @@ virNodeDeviceDefParseNode(xmlDocPtr xml, return def; } =20 + static virNodeDeviceDefPtr virNodeDeviceDefParse(const char *str, const char *filename, @@ -1682,6 +1703,7 @@ virNodeDeviceDefParse(const char *str, return def; } =20 + virNodeDeviceDefPtr virNodeDeviceDefParseString(const char *str, int create, @@ -1690,6 +1712,7 @@ virNodeDeviceDefParseString(const char *str, return virNodeDeviceDefParse(str, NULL, create, virt_type); } =20 + virNodeDeviceDefPtr virNodeDeviceDefParseFile(const char *filename, int create, @@ -1698,6 +1721,7 @@ virNodeDeviceDefParseFile(const char *filename, return virNodeDeviceDefParse(NULL, filename, create, virt_type); } =20 + /* * Return fc_host dev's WWNN and WWPN */ @@ -1737,7 +1761,8 @@ virNodeDeviceGetWWNs(virNodeDeviceDefPtr def, } =20 =20 -void virNodeDevCapsDefFree(virNodeDevCapsDefPtr caps) +void +virNodeDevCapsDefFree(virNodeDevCapsDefPtr caps) { size_t i =3D 0; virNodeDevCapDataPtr data =3D &caps->data; diff --git a/src/conf/virnodedeviceobj.c b/src/conf/virnodedeviceobj.c index 83f7217..f37e597 100644 --- a/src/conf/virnodedeviceobj.c +++ b/src/conf/virnodedeviceobj.c @@ -33,7 +33,9 @@ VIR_LOG_INIT("conf.virnodedeviceobj"); =20 =20 -int virNodeDeviceHasCap(const virNodeDeviceObj *dev, const char *cap) +int +virNodeDeviceHasCap(const virNodeDeviceObj *dev, + const char *cap) { virNodeDevCapsDefPtr caps =3D dev->def->caps; const char *fc_host_cap =3D @@ -125,8 +127,9 @@ virNodeDeviceFindBySysfsPath(virNodeDeviceObjListPtr de= vs, } =20 =20 -virNodeDeviceObjPtr virNodeDeviceFindByName(virNodeDeviceObjListPtr devs, - const char *name) +virNodeDeviceObjPtr +virNodeDeviceFindByName(virNodeDeviceObjListPtr devs, + const char *name) { size_t i; =20 @@ -198,7 +201,8 @@ virNodeDeviceFindByCap(virNodeDeviceObjListPtr devs, } =20 =20 -void virNodeDeviceObjFree(virNodeDeviceObjPtr dev) +void +virNodeDeviceObjFree(virNodeDeviceObjPtr dev) { if (!dev) return; @@ -212,7 +216,9 @@ void virNodeDeviceObjFree(virNodeDeviceObjPtr dev) VIR_FREE(dev); } =20 -void virNodeDeviceObjListFree(virNodeDeviceObjListPtr devs) + +void +virNodeDeviceObjListFree(virNodeDeviceObjListPtr devs) { size_t i; for (i =3D 0; i < devs->count; i++) @@ -221,8 +227,10 @@ void virNodeDeviceObjListFree(virNodeDeviceObjListPtr = devs) devs->count =3D 0; } =20 -virNodeDeviceObjPtr virNodeDeviceAssignDef(virNodeDeviceObjListPtr devs, - virNodeDeviceDefPtr def) + +virNodeDeviceObjPtr +virNodeDeviceAssignDef(virNodeDeviceObjListPtr devs, + virNodeDeviceDefPtr def) { virNodeDeviceObjPtr device; =20 @@ -254,8 +262,10 @@ virNodeDeviceObjPtr virNodeDeviceAssignDef(virNodeDevi= ceObjListPtr devs, =20 } =20 -void virNodeDeviceObjRemove(virNodeDeviceObjListPtr devs, - virNodeDeviceObjPtr *dev) + +void +virNodeDeviceObjRemove(virNodeDeviceObjListPtr devs, + virNodeDeviceObjPtr *dev) { size_t i; =20 @@ -423,16 +433,20 @@ virNodeDeviceGetParentHost(virNodeDeviceObjListPtr de= vs, } =20 =20 -void virNodeDeviceObjLock(virNodeDeviceObjPtr obj) +void +virNodeDeviceObjLock(virNodeDeviceObjPtr obj) { virMutexLock(&obj->lock); } =20 -void virNodeDeviceObjUnlock(virNodeDeviceObjPtr obj) + +void +virNodeDeviceObjUnlock(virNodeDeviceObjPtr obj) { virMutexUnlock(&obj->lock); } =20 + static bool virNodeDeviceCapMatch(virNodeDeviceObjPtr devobj, int type) @@ -459,6 +473,7 @@ virNodeDeviceCapMatch(virNodeDeviceObjPtr devobj, return false; } =20 + #define MATCH(FLAG) ((flags & (VIR_CONNECT_LIST_NODE_DEVICES_CAP_ ## FLAG)= ) && \ virNodeDeviceCapMatch(devobj, VIR_NODE_DEV_CAP_ ## FL= AG)) static bool @@ -487,6 +502,7 @@ virNodeDeviceMatch(virNodeDeviceObjPtr devobj, } #undef MATCH =20 + int virNodeDeviceObjListExport(virConnectPtr conn, virNodeDeviceObjList devobjs, --=20 2.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list