Skip to contentSkip to conversation

More whitespace and coding style clean ups ahead of future changes

PATCH In review Peter Portante 5 participants 9 messages Mar 21, 2012 – Mar 22, 2012

lore
Share & tools
lore
#0 lore raw

cover More whitespace and coding style clean ups ahead of future changes

Hi Folks,

Please forgive me if you find these changes are annoying, as I am trying to learn the ropes of patch submission with git ahead of making a real patch.

While working on the code, I found that scripts/checkpatch.pl will flag lines that I am changing as not adhereing to the codeing standard due to pre-existing coding violations. So I figured I could learn a bit about how to submit patches by fixing these files I will be touching before submitting the code changes.

I also figure this might benefit others working on the code base a bit.

Thanks,

-peter

#1 lore raw

PATCH 1/4 More whitespace cleanup in preparation for future commits.

---
 block_int.h   |    4 +-
 qemu-timer.c  |    6 +-
 slirp/slirp.c |  526 ++++++++++++++++++++++++++++----------------------------
 3 files changed, 268 insertions(+), 268 deletions(-)
block_int.h +2 -2
index b460c36..64e8b82 100644
@@ -31,8 +31,8 @@
 #include "qemu-timer.h"
 #include "qapi-types.h"
 
-#define BLOCK_FLAG_ENCRYPT	1
-#define BLOCK_FLAG_COMPAT6	4
+#define BLOCK_FLAG_ENCRYPT      1
+#define BLOCK_FLAG_COMPAT6      4
 
 #define BLOCK_IO_LIMIT_READ     0
 #define BLOCK_IO_LIMIT_WRITE    1
qemu-timer.c +3 -3
index d7f56e5..0eedf6e 100644
@@ -65,7 +65,7 @@ struct QEMUClock {
 
 struct QEMUTimer {
     QEMUClock *clock;
-    int64_t expire_time;	/* in nanoseconds */
+    int64_t expire_time;    /* in nanoseconds */
     int scale;
     QEMUTimerCB *cb;
     void *opaque;
@@ -231,7 +231,7 @@ void configure_alarms(char const *opt)
             /* Ignore */
             goto next;
 
-	/* Swap */
+        /* Swap */
         tmp = alarm_timers[i];
         alarm_timers[i] = alarm_timers[cur];
         alarm_timers[cur] = tmp;
@@ -492,7 +492,7 @@ static void host_alarm_handler(int host_signum)
 {
     struct qemu_alarm_timer *t = alarm_timer;
     if (!t)
-	return;
+        return;
 
     if (alarm_has_dynticks(t) ||
         qemu_next_alarm_deadline () <= 0) {
slirp/slirp.c +263 -263

578 lines not on this page · raw message

Signature · 1 line
1.7.7.6
#2 lore raw

PATCH 2/4 More work to fix up the formatting and the whitespace of this module to conform to the coding standard.

In reply to Peter Portante
---
 slirp/slirp.c |  381 +++++++++++++++++++++++++++++++--------------------------
 1 files changed, 205 insertions(+), 176 deletions(-)
slirp/slirp.c +205 -176
index ca0ff94..40f7523 100644
@@ -295,15 +295,17 @@ void slirp_select_fill(int *pnfds,
             /*
              * See if we need a tcp_fasttimo
              */
-            if (time_fasttimo == 0 && so->so_tcpcb->t_flags & TF_DELACK)
-               time_fasttimo = curtime; /* Flag when we want a fasttimo */
+            if (time_fasttimo == 0 && so->so_tcpcb->t_flags & TF_DELACK) {
+                time_fasttimo = curtime; /* Flag when we want a fasttimo */
+            }
 
             /*
              * NOFDREF can include still connecting to local-host,
              * newly socreated() sockets etc. Don't want to select these.
              */
-            if (so->so_state & SS_NOFDREF || so->s == -1)
-               continue;
+            if (so->so_state & SS_NOFDREF || so->s == -1) {
+                continue;
+            }
 
             /*
              * Set for reading sockets which are accepting
@@ -336,7 +338,8 @@ void slirp_select_fill(int *pnfds,
              * Set for reading (and urgent data) if we are connected, can
              * receive more, and we have room for it XXX /2 ?
              */
-            if (CONN_CANFRCV(so) && (so->so_snd.sb_cc < (so->so_snd.sb_datalen/2))) {
+            if (CONN_CANFRCV(so)
+                    && (so->so_snd.sb_cc < (so->so_snd.sb_datalen/2))) {
                 FD_SET(so->s, readfds);
                 FD_SET(so->s, xfds);
                 UPD_NFDS(so->s);
@@ -357,8 +360,9 @@ void slirp_select_fill(int *pnfds,
                 if (so->so_expire <= curtime) {
                     udp_detach(so);
                     continue;
-                } else
+                } else {
                     do_slowtimo = 1; /* Let socket expire */
+                }
             }
 
             /*
@@ -377,33 +381,33 @@ void slirp_select_fill(int *pnfds,
             }
         }
 
-                /*
-                 * ICMP sockets
-                 */
-                for (so = slirp->icmp.so_next; so != &slirp->icmp;
-                     so = so_next) {
-                    so_next = so->so_next;
-
-                    /*
-                     * See if it's timed out
-                     */
-                    if (so->so_expire) {
-                        if (so->so_expire <= curtime) {
-                            icmp_detach(so);
-                            continue;
-                        } else {
-                            do_slowtimo = 1; /* Let socket expire */
-                        }
-                    }
+        /*
+         * ICMP sockets
+         */
+        for (so = slirp->icmp.so_next; so != &slirp->icmp;
+             so = so_next) {
+            so_next = so->so_next;
 
-                    if (so->so_state & SS_ISFCONNECTED) {
-                        FD_SET(so->s, readfds);
-                        UPD_NFDS(so->s);
-                    }
+            /*
+             * See if it's timed out
+             */
+            if (so->so_expire) {
+                if (so->so_expire <= curtime) {
+                    icmp_detach(so);
+                    continue;
+                } else {
+                    do_slowtimo = 1; /* Let socket expire */
                 }
+            }
+
+            if (so->so_state & SS_ISFCONNECTED) {
+                FD_SET(so->s, readfds);
+                UPD_NFDS(so->s);
+            }
+        }
     }
 
-        *pnfds = nfds;
+    *pnfds = nfds;
 }
 
 void slirp_select_poll(fd_set *readfds, fd_set *writefds, fd_set *xfds,
@@ -424,9 +428,9 @@ void slirp_select_poll(fd_set *readfds, fd_set *writefds, fd_set *xfds,
     curtime = qemu_get_clock_ms(rt_clock);
 
     QTAILQ_FOREACH(slirp, &slirp_instances, entry) {
-    /*
-     * See if anything has timed out
-     */
+        /*
+         * See if anything has timed out
+         */
         if (time_fasttimo && ((curtime - time_fasttimo) >= 2)) {
             tcp_fasttimo(slirp);
             time_fasttimo = 0;
@@ -437,152 +441,157 @@ void slirp_select_poll(fd_set *readfds, fd_set *writefds, fd_set *xfds,
             last_slowtimo = curtime;
         }
 
-    /*
-     * Check sockets
-     */
-    if (!select_error) {
         /*
-         * Check TCP sockets
+         * Check sockets
          */
-        for (so = slirp->tcb.so_next; so != &slirp->tcb;
-             so = so_next) {
-            so_next = so->so_next;
-
+        if (!select_error) {
             /*
-             * FD_ISSET is meaningless on these sockets
-             * (and they can crash the program)
+             * Check TCP sockets
              */
-            if (so->so_state & SS_NOFDREF || so->s == -1)
-               continue;
+            for (so = slirp->tcb.so_next; so != &slirp->tcb;
+                 so = so_next) {
+                so_next = so->so_next;
 
-            /*
-             * Check for URG data
-             * This will soread as well, so no need to
-             * test for readfds below if this succeeds
-             */
-            if (FD_ISSET(so->s, xfds))
-               sorecvoob(so);
-            /*
-             * Check sockets for reading
-             */
-            else if (FD_ISSET(so->s, readfds)) {
                 /*
-                 * Check for incoming connections
+                 * FD_ISSET is meaningless on these sockets
+                 * (and they can crash the program)
                  */
-                if (so->so_state & SS_FACCEPTCONN) {
-                    tcp_connect(so);
-                    continue;
-                } /* else */
-                ret = soread(so);
+                if (so->so_state & SS_NOFDREF || so->s == -1) {
+                   continue;
+                }
 
-                /* Output it if we read something */
-                if (ret > 0)
-                   tcp_output(sototcpcb(so));
-            }
+                /*
+                 * Check for URG data
+                 * This will soread as well, so no need to
+                 * test for readfds below if this succeeds
+                 */
+                if (FD_ISSET(so->s, xfds)) {
+                    sorecvoob(so);
+                } else {
+                    /*
+                     * Check sockets for reading
+                     */
+                    if (FD_ISSET(so->s, readfds)) {
+                        /*
+                         * Check for incoming connections
+                         */
+                        if (so->so_state & SS_FACCEPTCONN) {
+                            tcp_connect(so);
+                            continue;
+                        } /* else */
+                        ret = soread(so);
 
-            /*
-             * Check sockets for writing
-             */
-            if (FD_ISSET(so->s, writefds)) {
-              /*
-               * Check for non-blocking, still-connecting sockets
-               */
-              if (so->so_state & SS_ISFCONNECTING) {
-                /* Connected */
-                so->so_state &= ~SS_ISFCONNECTING;
-
-                ret = send(so->s, (const void *) &ret, 0, 0);
-                if (ret < 0) {
-                  /* XXXXX Must fix, zero bytes is a NOP */
-                  if (errno == EAGAIN || errno == EWOULDBLOCK ||
-                  errno == EINPROGRESS || errno == ENOTCONN)
-                continue;
+                        /* Output it if we read something */
+                        if (ret > 0) {
+                            tcp_output(sototcpcb(so));
+                        }
+                    }
+                }
 
-                  /* else failed */
-                  so->so_state &= SS_PERSISTENT_MASK;
-                  so->so_state |= SS_NOFDREF;
+                /*
+                 * Check sockets for writing
+                 */
+                if (FD_ISSET(so->s, writefds)) {
+                    /*
+                     * Check for non-blocking, still-connecting sockets
+                     */
+                    if (so->so_state & SS_ISFCONNECTING) {
+                        /* Connected */
+                        so->so_state &= ~SS_ISFCONNECTING;
+
+                        ret = send(so->s, (const void *) &ret, 0, 0);
+                        if (ret < 0) {
+                            /* XXXXX Must fix, zero bytes is a NOP */
+                            if (errno == EAGAIN || errno == EWOULDBLOCK ||
+                                errno == EINPROGRESS || errno == ENOTCONN) {
+                                continue;
+                            }
+
+                            /* else failed */
+                            so->so_state &= SS_PERSISTENT_MASK;
+                            so->so_state |= SS_NOFDREF;
+                        }
+                        /* else so->so_state &= ~SS_ISFCONNECTING; */
+
+                        /*
+                         * Continue tcp_input
+                         */
+                        tcp_input((struct mbuf *)NULL, sizeof(struct ip), so);
+                        /* continue; */
+                    } else {
+                        ret = sowrite(so);
+                    }
+                    /*
+                     * XXXXX If we wrote something (a lot), there
+                     * could be a need for a window update.
+                     * In the worst case, the remote will send
+                     * a window probe to get things going again
+                     */
                 }
-                /* else so->so_state &= ~SS_ISFCONNECTING; */
 
                 /*
-                 * Continue tcp_input
+                 * Probe a still-connecting, non-blocking socket
+                 * to check if it's still alive
                  */
-                tcp_input((struct mbuf *)NULL, sizeof(struct ip), so);
-                /* continue; */
-              } else
-                ret = sowrite(so);
-              /*
-               * XXXXX If we wrote something (a lot), there
-               * could be a need for a window update.
-               * In the worst case, the remote will send
-               * a window probe to get things going again
-               */
+#ifdef PROBE_CONN
+                if (so->so_state & SS_ISFCONNECTING) {
+                    ret = qemu_recv(so->s, &ret, 0,0);
+
+                    if (ret < 0) {
+                        /* XXX */
+                        if (errno == EAGAIN || errno == EWOULDBLOCK ||
+                            errno == EINPROGRESS || errno == ENOTCONN) {
+                            continue; /* Still connecting, continue */
+                        }
+                        /* else failed */
+                        so->so_state &= SS_PERSISTENT_MASK;
+                        so->so_state |= SS_NOFDREF;
+
+                        /* tcp_input will take care of it */
+                    } else {
+                        ret = send(so->s, &ret, 0,0);
+                        if (ret < 0) {
+                            /* XXX */
+                            if (errno == EAGAIN || errno == EWOULDBLOCK ||
+                                errno == EINPROGRESS || errno == ENOTCONN) {
+                                continue;
+                            }
+                            /* else failed */
+                            so->so_state &= SS_PERSISTENT_MASK;
+                            so->so_state |= SS_NOFDREF;
+                        } else {
+                          so->so_state &= ~SS_ISFCONNECTING;
+                        }
+                    }
+                    tcp_input((struct mbuf *)NULL, sizeof(struct ip),so);
+                } /* SS_ISFCONNECTING */
+#endif
             }
 
             /*
-             * Probe a still-connecting, non-blocking socket
-             * to check if it's still alive
+             * Now UDP sockets.
+             * Incoming packets are sent straight away, they're not buffered.
+             * Incoming UDP data isn't buffered either.
              */
-#ifdef PROBE_CONN
-            if (so->so_state & SS_ISFCONNECTING) {
-                          ret = qemu_recv(so->s, &ret, 0,0);
-
-              if (ret < 0) {
-                /* XXX */
-                if (errno == EAGAIN || errno == EWOULDBLOCK ||
-                errno == EINPROGRESS || errno == ENOTCONN)
-                  continue; /* Still connecting, continue */
-
-                /* else failed */
-                so->so_state &= SS_PERSISTENT_MASK;
-                so->so_state |= SS_NOFDREF;
-
-                /* tcp_input will take care of it */
-              } else {
-                ret = send(so->s, &ret, 0,0);
-                if (ret < 0) {
-                  /* XXX */
-                  if (errno == EAGAIN || errno == EWOULDBLOCK ||
-                  errno == EINPROGRESS || errno == ENOTCONN)
-                continue;
-                  /* else failed */
-                  so->so_state &= SS_PERSISTENT_MASK;
-                  so->so_state |= SS_NOFDREF;
-                } else
-                  so->so_state &= ~SS_ISFCONNECTING;
-
-              }
-              tcp_input((struct mbuf *)NULL, sizeof(struct ip),so);
-            } /* SS_ISFCONNECTING */
-#endif
-        }
-
-        /*
-         * Now UDP sockets.
-         * Incoming packets are sent straight away, they're not buffered.
-         * Incoming UDP data isn't buffered either.
-         */
-        for (so = slirp->udb.so_next; so != &slirp->udb;
-             so = so_next) {
-            so_next = so->so_next;
+            for (so = slirp->udb.so_next; so != &slirp->udb; so = so_next) {
+                so_next = so->so_next;
 
-            if (so->s != -1 && FD_ISSET(so->s, readfds)) {
-                            sorecvfrom(so);
-                        }
-        }
+                if (so->s != -1 && FD_ISSET(so->s, readfds)) {
+                    sorecvfrom(so);
+                }
+            }
 
-                /*
-                 * Check incoming ICMP relies.
-                 */
-                for (so = slirp->icmp.so_next; so != &slirp->icmp;
-                     so = so_next) {
-                     so_next = so->so_next;
+            /*
+             * Check incoming ICMP relies.
+             */
+            for (so = slirp->icmp.so_next; so != &slirp->icmp; so = so_next) {
+                so_next = so->so_next;
 
-                    if (so->s != -1 && FD_ISSET(so->s, readfds)) {
-                        icmp_receive(so);
-                    }
+                if (so->s != -1 && FD_ISSET(so->s, readfds)) {
+                    icmp_receive(so);
                 }
-    }
+            }
+        }
 
         if_start(slirp);
     }
@@ -618,11 +627,13 @@ static void arp_input(Slirp *slirp, const uint8_t *pkt, int pkt_len)
         if ((ah->ar_tip & slirp->vnetwork_mask.s_addr) ==
             slirp->vnetwork_addr.s_addr) {
             if (ah->ar_tip == slirp->vnameserver_addr.s_addr ||
-                ah->ar_tip == slirp->vhost_addr.s_addr)
+                ah->ar_tip == slirp->vhost_addr.s_addr) {
                 goto arp_ok;
+            }
             for (ex_ptr = slirp->exec_list; ex_ptr; ex_ptr = ex_ptr->ex_next) {
-                if (ex_ptr->ex_addr.s_addr == ah->ar_tip)
+                if (ex_ptr->ex_addr.s_addr == ah->ar_tip) {
                     goto arp_ok;
+                }
             }
             return;
         arp_ok:
@@ -661,8 +672,9 @@ void slirp_input(Slirp *slirp, const uint8_t *pkt, int pkt_len)
     struct mbuf *m;
     int proto;
 
-    if (pkt_len < ETH_HLEN)
+    if (pkt_len < ETH_HLEN) {
         return;
+    }
 
     proto = ntohs(*(uint16_t *)(pkt + 12));
     switch(proto) {
@@ -671,8 +683,9 @@ void slirp_input(Slirp *slirp, const uint8_t *pkt, int pkt_len)
         break;
     case ETH_P_IP:
         m = m_get(slirp);
-        if (!m)
+        if (!m) {
             return;
+        }
         /* Note: we add to align the IP header */
         if (M_FREEROOM(m) < pkt_len + 2) {
             m_inc(m, pkt_len + 2);
@@ -786,12 +799,14 @@ int slirp_add_hostfwd(Slirp *slirp, int is_udp, struct in_addr host_addr,
     }
     if (is_udp) {
         if (!udp_listen(slirp, host_addr.s_addr, htons(host_port),
-                        guest_addr.s_addr, htons(guest_port), SS_HOSTFWD))
+                        guest_addr.s_addr, htons(guest_port), SS_HOSTFWD)) {
             return -1;
+        }
     } else {
         if (!tcp_listen(slirp, host_addr.s_addr, htons(host_port),
-                        guest_addr.s_addr, htons(guest_port), SS_HOSTFWD))
+                        guest_addr.s_addr, htons(guest_port), SS_HOSTFWD)) {
             return -1;
+        }
     }
     return 0;
 }
@@ -845,11 +860,13 @@ size_t slirp_socket_can_recv(Slirp *slirp, struct in_addr guest_addr,
 
     so = slirp_find_ctl_socket(slirp, guest_addr, guest_port);
 
-    if (!so || so->so_state & SS_NOFDREF)
+    if (!so || so->so_state & SS_NOFDREF) {
         return 0;
+    }
 
-    if (!CONN_CANFRCV(so) || so->so_snd.sb_cc >= (so->so_snd.sb_datalen/2))
+    if (!CONN_CANFRCV(so) || so->so_snd.sb_cc >= (so->so_snd.sb_datalen/2)) {
         return 0;
+    }
 
     return sopreprbuf(so, iov, NULL);
 }
@@ -860,13 +877,15 @@ void slirp_socket_recv(Slirp *slirp, struct in_addr guest_addr, int guest_port,
     int ret;
     struct socket *so = slirp_find_ctl_socket(slirp, guest_addr, guest_port);
 
-    if (!so)
+    if (!so) {
         return;
+    }
 
     ret = soreadbuf(so, (const char *)buf, size);
 
-    if (ret > 0)
+    if (ret > 0) {
         tcp_output(sototcpcb(so));
+    }
 }
 
 static void slirp_tcp_save(QEMUFile *f, struct tcpcb *tp)
@@ -960,17 +979,19 @@ static void slirp_state_save(QEMUFile *f, void *opaque)
     Slirp *slirp = opaque;
     struct ex_list *ex_ptr;
 
-    for (ex_ptr = slirp->exec_list; ex_ptr; ex_ptr = ex_ptr->ex_next)
+    for (ex_ptr = slirp->exec_list; ex_ptr; ex_ptr = ex_ptr->ex_next) {
         if (ex_ptr->ex_pty == 3) {
             struct socket *so;
             so = slirp_find_ctl_socket(slirp, ex_ptr->ex_addr,
                                        ntohs(ex_ptr->ex_fport));
-            if (!so)
+            if (!so) {
                 continue;
+            }
 
             qemu_put_byte(f, 42);
             slirp_socket_save(f, so);
         }
+    }
     qemu_put_byte(f, 0);
 
     qemu_put_be16(f, slirp->ip_id);
@@ -983,8 +1004,9 @@ static void slirp_tcp_load(QEMUFile *f, struct tcpcb *tp)
     int i;
 
     tp->t_state = qemu_get_sbe16(f);
-    for (i = 0; i < TCPT_NTIMERS; i++)
+    for (i = 0; i < TCPT_NTIMERS; i++) {
         tp->t_timer[i] = qemu_get_sbe16(f);
+    }
     tp->t_rxtshift = qemu_get_sbe16(f);
     tp->t_rxtcur = qemu_get_sbe16(f);
     tp->t_dupacks = qemu_get_sbe16(f);
@@ -1035,8 +1057,9 @@ static int slirp_sbuf_load(QEMUFile *f, struct sbuf *sbuf)
 
     sbreserve(sbuf, sb_datalen);
 
-    if (sbuf->sb_datalen != sb_datalen)
+    if (sbuf->sb_datalen != sb_datalen) {
         return -ENOMEM;
+    }
 
     sbuf->sb_cc = sb_cc;
 
@@ -1051,8 +1074,9 @@ static int slirp_sbuf_load(QEMUFile *f, struct sbuf *sbuf)
 
 static int slirp_socket_load(QEMUFile *f, struct socket *so)
 {
-    if (tcp_attach(so) < 0)
+    if (tcp_attach(so) < 0) {
         return -ENOMEM;
+    }
 
     so->so_urgc = qemu_get_be32(f);
     so->so_faddr.s_addr = qemu_get_be32(f);
@@ -1063,10 +1087,12 @@ static int slirp_socket_load(QEMUFile *f, struct socket *so)
     so->so_emu = qemu_get_byte(f);
     so->so_type = qemu_get_byte(f);
     so->so_state = qemu_get_be32(f);
-    if (slirp_sbuf_load(f, &so->so_rcv) < 0)
+    if (slirp_sbuf_load(f, &so->so_rcv) < 0) {
         return -ENOMEM;
-    if (slirp_sbuf_load(f, &so->so_snd) < 0)
+    }
+    if (slirp_sbuf_load(f, &so->so_snd) < 0) {
         return -ENOMEM;
+    }
     slirp_tcp_load(f, so->so_tcpcb);
 
     return 0;
@@ -1091,13 +1117,15 @@ static int slirp_state_load(QEMUFile *f, void *opaque, int version_id)
         int ret;
         struct socket *so = socreate(slirp);
 
-        if (!so)
+        if (!so) {
             return -ENOMEM;
+        }
 
         ret = slirp_socket_load(f, so);
 
-        if (ret < 0)
+        if (ret < 0) {
             return ret;
+        }
 
         if ((so->so_faddr.s_addr & slirp->vnetwork_mask.s_addr) !=
             slirp->vnetwork_addr.s_addr) {
@@ -1110,8 +1138,9 @@ static int slirp_state_load(QEMUFile *f, void *opaque, int version_id)
                 break;
             }
         }
-        if (!ex_ptr)
+        if (!ex_ptr) {
             return -EINVAL;
+        }
 
         so->extra = (void *)ex_ptr->ex_exec;
     }
Signature · 1 line
1.7.7.6
#3 lore raw

PATCH 3/4 And some final work to complete the coding style upgrade, missed by the previous commit.

In reply to Peter Portante
---
 slirp/slirp.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
slirp/slirp.c +4 -4
index 40f7523..fd28f17 100644
@@ -457,7 +457,7 @@ void slirp_select_poll(fd_set *readfds, fd_set *writefds, fd_set *xfds,
                  * (and they can crash the program)
                  */
                 if (so->so_state & SS_NOFDREF || so->s == -1) {
-                   continue;
+					continue;
                 }
 
                 /*
@@ -535,7 +535,7 @@ void slirp_select_poll(fd_set *readfds, fd_set *writefds, fd_set *xfds,
                  */
 #ifdef PROBE_CONN
                 if (so->so_state & SS_ISFCONNECTING) {
-                    ret = qemu_recv(so->s, &ret, 0,0);
+                    ret = qemu_recv(so->s, &ret, 0, 0);
 
                     if (ret < 0) {
                         /* XXX */
@@ -549,7 +549,7 @@ void slirp_select_poll(fd_set *readfds, fd_set *writefds, fd_set *xfds,
 
                         /* tcp_input will take care of it */
                     } else {
-                        ret = send(so->s, &ret, 0,0);
+                        ret = send(so->s, &ret, 0, 0);
                         if (ret < 0) {
                             /* XXX */
                             if (errno == EAGAIN || errno == EWOULDBLOCK ||
@@ -563,7 +563,7 @@ void slirp_select_poll(fd_set *readfds, fd_set *writefds, fd_set *xfds,
                           so->so_state &= ~SS_ISFCONNECTING;
                         }
                     }
-                    tcp_input((struct mbuf *)NULL, sizeof(struct ip),so);
+                    tcp_input((struct mbuf *)NULL, sizeof(struct ip), so);
                 } /* SS_ISFCONNECTING */
 #endif
             }
Signature · 1 line
1.7.7.6
#4 lore raw

PATCH 4/4 Yet another missed use of tabs.

In reply to Peter Portante
---
 slirp/slirp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
slirp/slirp.c +1 -1
index fd28f17..45a8de2 100644
@@ -457,7 +457,7 @@ void slirp_select_poll(fd_set *readfds, fd_set *writefds, fd_set *xfds,
                  * (and they can crash the program)
                  */
                 if (so->so_state & SS_NOFDREF || so->s == -1) {
-					continue;
+                    continue;
                 }
 
                 /*
Signature · 1 line
1.7.7.6
#5 lore raw
In reply to Peter Portante

Il 21/03/2012 22:02, Peter Portante ha scritto:

Quoted 10 lines

Hi Folks,

Please forgive me if you find these changes are annoying, as I am trying to learn the ropes of patch submission with git ahead of making a real patch.

While working on the code, I found that scripts/checkpatch.pl will flag lines that I am changing as not adhereing to the codeing standard due to pre-existing coding violations. So I figured I could learn a bit about how to submit patches by fixing these files I will be touching before submitting the code changes.

I think slirp is a mess and it's not worth doing this kind of sweeping change. Just ignore checkpatch output for slirp.

For the others, the changes are pretty small so they could be doable. If you want to change them then please also add braces around if statements.

In any case, your patch submission workflow seems to be fine. :P

Paolo

#6 lore raw
Quoted 6 lines · Paolo Bonzini

Il 21/03/2012 22:02, Peter Portante ha scritto:

Quoted 5 lines

Hi Folks,

Please forgive me if you find these changes are annoying, as I am trying to learn the ropes of patch submission with git ahead of making a real patch.

Quoted 8 lines
Quoted 5 lines

While working on the code, I found that scripts/checkpatch.pl will flag lines that I am changing as not adhereing to the codeing standard due to pre-existing coding violations. So I figured I could learn a bit about how to submit patches by fixing these files I will be touching before submitting the code changes.

I think slirp is a mess and it's not worth doing this kind of sweeping change.  Just ignore checkpatch output for slirp.

Please resend without slirp changes. I suggest including the individual block/raw-posix.c patch you sent in the new series too.

Quoted 2 lines

For the others, the changes are pretty small so they could be doable. If you want to change them then please also add braces around if statements.

If you're doing a whitespace patch please include the 3-space indentation issues that checkpatch.pl reports in block/raw-posix.c.

Quoted 1 line

In any case, your patch submission workflow seems to be fine. :P

Please use a prefix in your commit messages, for example "raw-posix:
whitespace cleanup". This gives each commit a unique, useful message which communicates more than "Yet another whitespace cleanup"-style messages.

Stefan

#7 lore raw
In reply to Paolo Bonzini
Quoted 6 lines · Paolo Bonzini

Il 21/03/2012 22:02, Peter Portante ha scritto:

Quoted 5 lines

Hi Folks,

Please forgive me if you find these changes are annoying, as I am trying to learn the ropes of patch submission with git ahead of making a real patch.

Quoted 8 lines
Quoted 5 lines

While working on the code, I found that scripts/checkpatch.pl will flag lines that I am changing as not adhereing to the codeing standard due to pre-existing coding violations. So I figured I could learn a bit about how to submit patches by fixing these files I will be touching before submitting the code changes.

I think slirp is a mess and it's not worth doing this kind of sweeping change. Just ignore checkpatch output for slirp.

In fact, I could imagine accepting slirp cleanups provided they come in palatable pieces and validate that the binary output is unchanged. It's really a pain changing something in slirp having to use a totally inconsistent style just to keep the code slightly readable.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
#8 lore raw
In reply to Peter Portante
Quoted 2 lines · Peter Portante

Please forgive me if you find these changes are annoying, as I am trying to learn the ropes of patch submission with git ahead of making a real patch.

I'd recommend using git format-patch's --cover-letter option to create your 'cover letter' patch, as this will include a diffstat and summary of all the patches in the patchset.

Quoted 5 lines

While working on the code, I found that scripts/checkpatch.pl will flag lines that I am changing as not adhereing to the codeing standard due to pre-existing coding violations. So I figured I could learn a bit about how to submit patches by fixing these files I will be touching before submitting the code changes.

Whitespace-fixes and other coding-style-only changes are a bit of a touchy issue here; they've caused long mailing list arguments in the past. Mostly the line we seem to take is "fix issues in new code submitted; when patching old code you can fix problems complained about in the immediately surrounding few lines". The idea is that gradually the codebase moves into line with the style guide without having massive style-only changes that break tools like 'git blame'. Small changes (like the qemu-timers one) are more likely to be accepted than massive ones (like the slirp patches).

Also, it would be helpful if you could split your patches more logically into smaller ones which touch the different subsystems:
any patch which touches all of block_int.h, qemu-timer.c and slirp is going to struggle to be reviewed and committed because it is trying to modify three different bits of the codebase and so it needs agreement from more people. Sometimes a patch really does have to touch several different areas, but in this case you're only putting roadblocks in your own path...

-- PMM