On 23.01.2019 23:09, Ben Pfaff wrote:
> Just a style fix.
> 
> With this patch, the following reports no hits:
> 
> git ls-files | grep '\.[ch]$' | grep -vE 'datapath|sflow' | xargs grep -n // 
> | grep -vE "http|s/|'|\""

I'd like this line wrapped. For example, like this:

  git ls-files | grep '\.[ch]$' | grep -vE 'datapath|sflow' \
               | xargs grep -n // | grep -vE "http|s/|'|\""

It's still a valid shell command.

Beside that,
Acked-by: Ilya Maximets <i.maxim...@samsung.com>

P.S. sflow_receiver.c is just a bunch of bad style examples.

> 
> Reported-by: Ilya Maximets <i.maxim...@samsung.com>
> Signed-off-by: Ben Pfaff <b...@ovn.org>
> ---
>  include/openvswitch/ofpbuf.h | 2 +-
>  lib/backtrace.h              | 4 ++--
>  lib/hash.h                   | 4 ++--
>  lib/netdev-bsd.c             | 2 +-
>  lib/ofp-actions.c            | 6 +++---
>  lib/ovs-atomic.h             | 3 +--
>  lib/rtbsd.c                  | 6 +++---
>  lib/seq.h                    | 2 +-
>  lib/socket-util.c            | 2 +-
>  ofproto/ofproto-dpif-ipfix.c | 2 +-
>  ofproto/ofproto-provider.h   | 6 +++---
>  11 files changed, 19 insertions(+), 20 deletions(-)
> 
> diff --git a/include/openvswitch/ofpbuf.h b/include/openvswitch/ofpbuf.h
> index 71ee0c9534a3..e4cf0883ceec 100644
> --- a/include/openvswitch/ofpbuf.h
> +++ b/include/openvswitch/ofpbuf.h
> @@ -72,7 +72,7 @@ struct ofpbuf {
>   *
>   * Usage example:
>   *
> - *     uint64_t stub[1024 / 8]; // 1 kB stub properly aligned for 64-bit 
> data.
> + *     uint64_t stub[1024 / 8];         <-- 1 kB stub aligned for 64-bit 
> data.
>   *     struct ofpbuf ofpbuf = OFPBUF_STUB_INITIALIZER(stub);
>   */
>  #define OFPBUF_STUB_INITIALIZER(STUB) {         \
> diff --git a/lib/backtrace.h b/lib/backtrace.h
> index 3eb92f7ad23d..384f2700d94c 100644
> --- a/lib/backtrace.h
> +++ b/lib/backtrace.h
> @@ -27,8 +27,8 @@
>   * desired:
>   *       #include "backtrace.h"
>   *
> - *       log_backtrace();
> - *       // A message can be added with log_backtrace_msg("your message")
> + *       log_backtrace();                           <-- plain
> + *       log_backtrace_msg("your message");         <-- with a message
>   *
>   *
>   * A typical log will look like the following. The hex numbers listed after
> diff --git a/lib/hash.h b/lib/hash.h
> index a642a1e97954..01e8c52de8b9 100644
> --- a/lib/hash.h
> +++ b/lib/hash.h
> @@ -55,8 +55,8 @@ static inline uint32_t hash_string(const char *, uint32_t 
> basis);
>   *
>   * The upstream license there says:
>   *
> - * // MurmurHash3 was written by Austin Appleby, and is placed in the public
> - * // domain. The author hereby disclaims copyright to this source code.
> + *    MurmurHash3 was written by Austin Appleby, and is placed in the public
> + *    domain. The author hereby disclaims copyright to this source code.
>   *
>   * See hash_words() for sample usage. */
>  
> diff --git a/lib/netdev-bsd.c b/lib/netdev-bsd.c
> index 46698d54748f..7875636cc3cc 100644
> --- a/lib/netdev-bsd.c
> +++ b/lib/netdev-bsd.c
> @@ -996,7 +996,7 @@ netdev_bsd_get_stats(const struct netdev *netdev_, struct 
> netdev_stats *stats)
>      mib[3] = IFMIB_IFDATA;
>      len = sizeof(ifmd);
>      for (i = 1; i <= if_count; i++) {
> -        mib[4] = i; //row
> +        mib[4] = i; /* row */
>          if (sysctl(mib, 6, &ifmd, &len, (void *)0, 0) == -1) {
>              VLOG_DBG_RL(&rl, "%s: sysctl failed: %s",
>                          netdev_get_name(netdev_), ovs_strerror(errno));
> diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c
> index 96e39d6c6c9c..f76db6c0f948 100644
> --- a/lib/ofp-actions.c
> +++ b/lib/ofp-actions.c
> @@ -3569,10 +3569,10 @@ struct nx_action_cnt_ids {
>      ovs_be16 n_controllers;     /* Number of controllers. */
>      uint8_t zeros[4];           /* Must be zero. */
>  
> -    /* Followed by 1 or more controller ids.
> +    /* Followed by 1 or more controller ids:
>       *
> -     * uint16_t cnt_ids[];        // Controller ids.
> -     * uint8_t pad[];           // Must be 0 to 8-byte align cnt_ids[].
> +     * uint16_t cnt_ids[];      -- Controller ids.
> +     * uint8_t pad[];           -- Must be 0 to 8-byte align cnt_ids[].
>       */
>  };
>  OFP_ASSERT(sizeof(struct nx_action_cnt_ids) == 16);
> diff --git a/lib/ovs-atomic.h b/lib/ovs-atomic.h
> index 4664eefaf3a1..21e230e36f6b 100644
> --- a/lib/ovs-atomic.h
> +++ b/lib/ovs-atomic.h
> @@ -509,7 +509,7 @@ ovs_refcount_ref(struct ovs_refcount *refcount)
>   * in this form:
>   *
>   * if (ovs_refcount_unref(&object->ref_cnt) == 1) {
> - *     // ...uninitialize object...
> + *     ...uninitialize object...
>   *     free(object);
>   * }
>   *
> @@ -593,7 +593,6 @@ ovs_refcount_try_ref_rcu(struct ovs_refcount *refcount)
>   * For example:
>   *
>   * if (ovs_refcount_unref_relaxed(&object->ref_cnt) == 1) {
> - *     // Schedule uninitialization and freeing of the object:
>   *     ovsrcu_postpone(destructor_function, object);
>   * }
>   *
> diff --git a/lib/rtbsd.c b/lib/rtbsd.c
> index c98f3052f386..564595c3a511 100644
> --- a/lib/rtbsd.c
> +++ b/lib/rtbsd.c
> @@ -117,7 +117,7 @@ rtbsd_notifier_run(void)
>          int retval;
>  
>          msg.ifm_type = RTM_IFINFO;
> -        msg.ifm_version = RTM_VERSION; //XXX check if necessary
> +        msg.ifm_version = RTM_VERSION; /* XXX Check if necessary. */
>  
>          /* read from PF_ROUTE socket */
>          retval = read(notify_sock, (char *)&msg, sizeof(msg));
> @@ -176,8 +176,8 @@ rtbsd_report_change(const struct if_msghdr *msg)
>  
>      COVERAGE_INC(rtbsd_changed);
>  
> -    change.msg_type = msg->ifm_type; //XXX
> -    change.master_ifindex = 0; //XXX
> +    change.msg_type = msg->ifm_type; /* XXX */
> +    change.master_ifindex = 0; /* XXX */
>  
>      switch (msg->ifm_type) {
>      case RTM_IFINFO:
> diff --git a/lib/seq.h b/lib/seq.h
> index 92743c1eb4ea..c88b9d1c814f 100644
> --- a/lib/seq.h
> +++ b/lib/seq.h
> @@ -83,7 +83,7 @@
>   *
>   *    ovs_mutex_lock(&mutex);
>   *    ovs_list_push_back(&queue, ...element...);
> - *    if (ovs_list_is_singleton(&queue)) {   // The 'if' test here is 
> optional.
> + *    if (ovs_list_is_singleton(&queue)) {   <-- The 'if' here is optional.
>   *        seq_change(nonempty_seq);
>   *    }
>   *    ovs_mutex_unlock(&mutex);
> diff --git a/lib/socket-util.c b/lib/socket-util.c
> index 09daa3c90326..6b7378de934b 100644
> --- a/lib/socket-util.c
> +++ b/lib/socket-util.c
> @@ -1241,7 +1241,7 @@ sock_strerror(int error)
>  #endif
>  }
>  
> -#ifndef _WIN32 //Avoid using sendmsg on Windows entirely
> +#ifndef _WIN32 /* Avoid using sendmsg on Windows entirely. */
>  static int
>  emulate_sendmmsg(int fd, struct mmsghdr *msgs, unsigned int n,
>                   unsigned int flags)
> diff --git a/ofproto/ofproto-dpif-ipfix.c b/ofproto/ofproto-dpif-ipfix.c
> index 40298067884c..5ea1097f95d1 100644
> --- a/ofproto/ofproto-dpif-ipfix.c
> +++ b/ofproto/ofproto-dpif-ipfix.c
> @@ -1115,7 +1115,7 @@ dpif_ipfix_set_options(
>              }
>              options++;
>          }
> -        if (i == n_flow_exporters_options) {  // Not found.
> +        if (i == n_flow_exporters_options) {  /* Not found. */
>              remove_flow_exporter(di, node);
>          }
>      }
> diff --git a/ofproto/ofproto-provider.h b/ofproto/ofproto-provider.h
> index 074edfc1199f..d1a87a59e47e 100644
> --- a/ofproto/ofproto-provider.h
> +++ b/ofproto/ofproto-provider.h
> @@ -1128,12 +1128,12 @@ struct ofproto_class {
>       *         if (error) {
>       *             break;
>       *         }
> -     *         // Do something with 'port' here (without modifying or freeing
> -     *         // any of its data).
> +     *         ...Do something with 'port' here (without modifying or freeing
> +     *            any of its data)...
>       *     }
>       *     ofproto->ofproto_class->port_dump_done(ofproto, state);
>       * }
> -     * // 'error' is now EOF (success) or a positive errno value (failure).
> +     * ...'error' is now EOF (success) or a positive errno value (failure)...
>       */
>      int (*port_dump_start)(const struct ofproto *ofproto, void **statep);
>      int (*port_dump_next)(const struct ofproto *ofproto, void *state,
> 
_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to