Skip to content

Commit

Permalink
treewide: Get rid of // comments, even inside comments.
Browse files Browse the repository at this point in the history
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/|'|\""

Acked-by: Ilya Maximets <i.maximets@samsung.com>
Reported-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
  • Loading branch information
blp committed Jan 25, 2019
1 parent 5cc463d commit b534330
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 20 deletions.
2 changes: 1 addition & 1 deletion include/openvswitch/ofpbuf.h
Expand Up @@ -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) { \
Expand Down
4 changes: 2 additions & 2 deletions lib/backtrace.h
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/hash.h
Expand Up @@ -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. */

Expand Down
2 changes: 1 addition & 1 deletion lib/netdev-bsd.c
Expand Up @@ -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));
Expand Down
6 changes: 3 additions & 3 deletions lib/ofp-actions.c
Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions lib/ovs-atomic.h
Expand Up @@ -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);
* }
*
Expand Down Expand Up @@ -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);
* }
*
Expand Down
6 changes: 3 additions & 3 deletions lib/rtbsd.c
Expand Up @@ -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));
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion lib/seq.h
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion lib/socket-util.c
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion ofproto/ofproto-dpif-ipfix.c
Expand Up @@ -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);
}
}
Expand Down
6 changes: 3 additions & 3 deletions ofproto/ofproto-provider.h
Expand Up @@ -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,
Expand Down

0 comments on commit b534330

Please sign in to comment.