Re: [PATCH 03/11] inotify: Code cleanup

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

 



Osier Yang wrote:
> On 2013年01月31日 02:51, John Ferlan wrote:
>> Clean up some function headers
>> ---
>>   src/xen/xen_inotify.c | 48
>> +++++++++++++++++++++++-------------------------
>>   1 file changed, 23 insertions(+), 25 deletions(-)
>>
>> diff --git a/src/xen/xen_inotify.c b/src/xen/xen_inotify.c
>> index 2043c74..94803b2 100644
>> --- a/src/xen/xen_inotify.c
>> +++ b/src/xen/xen_inotify.c
>> @@ -4,7 +4,7 @@
>>    *                /etc/xen
>>    *                /var/lib/xend/domains
>>    *
>> - * Copyright (C) 2010-2011 Red Hat, Inc.
>> + * Copyright (C) 2010-2013 Red Hat, Inc.
>>    * Copyright (C) 2008 VirtualIron
>>    *
>>    * This library is free software; you can redistribute it and/or
>> @@ -49,9 +49,9 @@ struct xenUnifiedDriver xenInotifyDriver = {
>>   };
>>
>>   static int
>> -xenInotifyXenCacheLookup(virConnectPtr conn,
>> -                         const char *filename,
>> -                         char **name, unsigned char *uuid) {
>> +xenInotifyXenCacheLookup(virConnectPtr conn, const char *filename,
>> +                         char **name, unsigned char *uuid)
>> +{
>>       xenUnifiedPrivatePtr priv = conn->privateData;
>>       xenXMConfCachePtr entry;
>>
>> @@ -73,7 +73,8 @@ xenInotifyXenCacheLookup(virConnectPtr conn,
>>
>>   static int
>>   xenInotifyXendDomainsDirLookup(virConnectPtr conn, const char
>> *filename,
>> -                               char **name, unsigned char *uuid) {
>> +                               char **name, unsigned char *uuid)
>> +{
>>       int i;
>>       virDomainPtr dom;
>>       const char *uuid_str;
>> @@ -129,9 +130,9 @@ xenInotifyXendDomainsDirLookup(virConnectPtr
>> conn, const char *filename,
>>   }
>>
>>   static int
>> -xenInotifyDomainLookup(virConnectPtr conn,
>> -                       const char *filename,
>> -                       char **name, unsigned char *uuid) {
>> +xenInotifyDomainLookup(virConnectPtr conn, const char *filename,
>> char **name,
>> +                       unsigned char *uuid)
>
> Thing like this is personal habit from my p.o.v, someone likes
> even write it like below:
>
> xenInotifyDomainLookup(virConnectPtr conn,
>                        const char *filename,
>                        char **name,
>                        unsigned char *uuid)
> {
> }

Yep, there doesn't seem to be a consistent pattern throughout the
sources.  One thing that is consistent is '{' starting on a new line, so
ACK to those changes.

Regards,
Jim

>
>
>> +{
>>       xenUnifiedPrivatePtr priv = conn->privateData;
>>       if (priv->useXenConfigCache)
>>           return xenInotifyXenCacheLookup(conn, filename, name, uuid);
>> @@ -140,9 +141,9 @@ xenInotifyDomainLookup(virConnectPtr conn,
>>   }
>>
>>   static virDomainEventPtr
>> -xenInotifyDomainEventFromFile(virConnectPtr conn,
>> -                              const char *filename,
>> -                              int type, int detail) {
>> +xenInotifyDomainEventFromFile(virConnectPtr conn, const char *filename,
>> +                              int type, int detail)
>> +{
>>       virDomainEventPtr event;
>>       char *name = NULL;
>>       unsigned char uuid[VIR_UUID_BUFLEN];
>> @@ -156,8 +157,8 @@ xenInotifyDomainEventFromFile(virConnectPtr conn,
>>   }
>>
>>   static int
>> -xenInotifyXendDomainsDirRemoveEntry(virConnectPtr conn,
>> -                                    const char *fname) {
>> +xenInotifyXendDomainsDirRemoveEntry(virConnectPtr conn, const char
>> *fname)
>> +{
>>       xenUnifiedPrivatePtr priv = conn->privateData;
>>       const char *uuidstr = fname + strlen(XEND_DOMAINS_DIR) + 1;
>>       unsigned char uuid[VIR_UUID_BUFLEN];
>> @@ -193,8 +194,8 @@ xenInotifyXendDomainsDirRemoveEntry(virConnectPtr
>> conn,
>>   }
>>
>>   static int
>> -xenInotifyXendDomainsDirAddEntry(virConnectPtr conn,
>> -                                 const char *fname) {
>> +xenInotifyXendDomainsDirAddEntry(virConnectPtr conn, const char *fname)
>> +{
>>       char *name = NULL;
>>       unsigned char uuid[VIR_UUID_BUFLEN];
>>       xenUnifiedPrivatePtr priv = conn->privateData;
>> @@ -217,8 +218,8 @@ xenInotifyXendDomainsDirAddEntry(virConnectPtr conn,
>>   }
>>
>>   static int
>> -xenInotifyRemoveDomainConfigInfo(virConnectPtr conn,
>> -                                 const char *fname) {
>> +xenInotifyRemoveDomainConfigInfo(virConnectPtr conn, const char *fname)
>> +{
>>       xenUnifiedPrivatePtr priv = conn->privateData;
>>       return priv->useXenConfigCache ?
>>           xenXMConfigCacheRemoveFile(conn, fname) :
>> @@ -226,8 +227,8 @@ xenInotifyRemoveDomainConfigInfo(virConnectPtr conn,
>>   }
>>
>>   static int
>> -xenInotifyAddDomainConfigInfo(virConnectPtr conn,
>> -                              const char *fname) {
>> +xenInotifyAddDomainConfigInfo(virConnectPtr conn, const char *fname)
>> +{
>>       xenUnifiedPrivatePtr priv = conn->privateData;
>>       return priv->useXenConfigCache ?
>>           xenXMConfigCacheAddFile(conn, fname) :
>> @@ -235,10 +236,8 @@ xenInotifyAddDomainConfigInfo(virConnectPtr conn,
>>   }
>>
>>   static void
>> -xenInotifyEvent(int watch ATTRIBUTE_UNUSED,
>> -                int fd,
>> -                int events ATTRIBUTE_UNUSED,
>> -                void *data)
>> +xenInotifyEvent(int watch ATTRIBUTE_UNUSED, int fd,
>> +                int events ATTRIBUTE_UNUSED, void *data)
>>   {
>>       char buf[1024];
>>       char fname[1024];
>> @@ -341,8 +340,7 @@ cleanup:
>>    * Returns 0 or -1 in case of error.
>>    */
>>   virDrvOpenStatus
>> -xenInotifyOpen(virConnectPtr conn,
>> -               virConnectAuthPtr auth ATTRIBUTE_UNUSED,
>> +xenInotifyOpen(virConnectPtr conn, virConnectAuthPtr auth
>> ATTRIBUTE_UNUSED,
>>                  unsigned int flags)
>>   {
>>       DIR *dh;
>
> -- 
> libvir-list mailing list
> libvir-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/libvir-list

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[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]