[libvirt] [PATCH 08/31] src/phyp: Remove the whitespace before '; '

Osier Yang jyang at redhat.com
Tue May 21 15:50:15 UTC 2013


On 21/05/13 23:37, Eric Blake wrote:
> On 05/21/2013 04:00 AM, Osier Yang wrote:
>> ---
>>   src/phyp/phyp_driver.c | 6 +++---
>>   1 file changed, 3 insertions(+), 3 deletions(-)
> ACK for being mechanical.  However...
>
>> diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c
>> index 4594cbf..70d3adb 100644
>> --- a/src/phyp/phyp_driver.c
>> +++ b/src/phyp/phyp_driver.c
>> @@ -1008,7 +1008,7 @@ connected:
>>       libssh2_session_set_blocking(session, 0);
>>   
>>       while ((rc = libssh2_session_startup(session, sock)) ==
>> -           LIBSSH2_ERROR_EAGAIN) ;
>> +           LIBSSH2_ERROR_EAGAIN);
> My review of patch 30/31 made me revisit this patch.  It has an empty
> while loop.  Should we enforce a particular style where all empty-bodied
> loops should use a more obvious style to prove that we knew what we were
> doing?  For example:
>
> while ((rc = libssh2_session_startup(session, sock)) ==
>         LIBSSH2_ERROR_EAGAIN)
>      ; /* empty */
>
> or
>
> while ((rc = libssh2_session_startup(session, sock)) ==
>         LIBSSH2_ERROR_EAGAIN) {
>      /* empty */
> }

Either of above 2 is better than the original one. It's more clear to know
the loop has an empty body. But not sure if it's overladen forcing.

Osier




More information about the libvir-list mailing list