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

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

 



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

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