[ovs-dev] [PATCH] treewide: Convert tabs to spaces in C source files written in OVS style.
Ethan Jackson
ethan at nicira.com
Fri Mar 23 18:46:33 UTC 2012
Seems fine to me.
On Fri, Mar 23, 2012 at 11:44, Ben Pfaff <blp at nicira.com> wrote:
> The Open vSwitch C style doesn't use hard tabs.
>
> This commit doesn't touch files written in kernel style or that are
> imported from other projects where we want to minimize changes from
> upstream (the sflow files).
>
> Reported-by: Mehak Mahajan <mmahajan at nicira.com>
> Signed-off-by: Ben Pfaff <blp at nicira.com>
> ---
> include/openvswitch/types.h | 6 +++---
> lib/netlink-protocol.h | 14 +++++++-------
> lib/sha1.c | 42 +++++++++++++++++++++---------------------
> lib/sha1.h | 8 ++++----
> lib/unaligned.h | 14 +++++++-------
> ofproto/ofproto.c | 2 +-
> ofproto/ofproto.h | 4 ++--
> 7 files changed, 45 insertions(+), 45 deletions(-)
>
> diff --git a/include/openvswitch/types.h b/include/openvswitch/types.h
> index 90a32f5..ad05757 100644
> --- a/include/openvswitch/types.h
> +++ b/include/openvswitch/types.h
> @@ -48,16 +48,16 @@ typedef __be64 ovs_be64;
> * boundary. */
> typedef struct {
> #ifdef WORDS_BIGENDIAN
> - uint32_t hi, lo;
> + uint32_t hi, lo;
> #else
> - uint32_t lo, hi;
> + uint32_t lo, hi;
> #endif
> } ovs_32aligned_u64;
>
> /* A 64-bit value, in network byte order, that is only aligned on a 32-bit
> * boundary. */
> typedef struct {
> - ovs_be32 hi, lo;
> + ovs_be32 hi, lo;
> } ovs_32aligned_be64;
>
> #endif /* openvswitch/types.h */
> diff --git a/lib/netlink-protocol.h b/lib/netlink-protocol.h
> index 521c5bf..3f4ce35 100644
> --- a/lib/netlink-protocol.h
> +++ b/lib/netlink-protocol.h
> @@ -149,9 +149,9 @@ enum {
>
> /* These were introduced all together in 2.6.24. */
> #ifndef NLA_TYPE_MASK
> -#define NLA_F_NESTED (1 << 15)
> -#define NLA_F_NET_BYTEORDER (1 << 14)
> -#define NLA_TYPE_MASK ~(NLA_F_NESTED | NLA_F_NET_BYTEORDER)
> +#define NLA_F_NESTED (1 << 15)
> +#define NLA_F_NET_BYTEORDER (1 << 14)
> +#define NLA_TYPE_MASK ~(NLA_F_NESTED | NLA_F_NET_BYTEORDER)
> #endif
>
> /* These were introduced all together in 2.6.14. (We want our programs to
> @@ -170,10 +170,10 @@ enum {
> #define CTRL_ATTR_MCAST_GROUPS 7
>
> enum {
> - CTRL_ATTR_MCAST_GRP_UNSPEC,
> - CTRL_ATTR_MCAST_GRP_NAME,
> - CTRL_ATTR_MCAST_GRP_ID,
> - __CTRL_ATTR_MCAST_GRP_MAX,
> + CTRL_ATTR_MCAST_GRP_UNSPEC,
> + CTRL_ATTR_MCAST_GRP_NAME,
> + CTRL_ATTR_MCAST_GRP_ID,
> + __CTRL_ATTR_MCAST_GRP_MAX,
> };
>
> #define CTRL_ATTR_MCAST_GRP_MAX (__CTRL_ATTR_MCAST_GRP_MAX - 1)
> diff --git a/lib/sha1.c b/lib/sha1.c
> index cdccab3..6205e50 100644
> --- a/lib/sha1.c
> +++ b/lib/sha1.c
> @@ -23,10 +23,10 @@
> /* This software also makes use of the following component:
> *
> * NIST Secure Hash Algorithm
> - * heavily modified by Uwe Hollerbach uh at alumni.caltech edu
> - * from Peter C. Gutmann's implementation as found in
> - * Applied Cryptography by Bruce Schneier
> - * This code is hereby placed in the public domain
> + * heavily modified by Uwe Hollerbach uh at alumni.caltech edu
> + * from Peter C. Gutmann's implementation as found in
> + * Applied Cryptography by Bruce Schneier
> + * This code is hereby placed in the public domain
> */
>
> #include <config.h>
> @@ -65,10 +65,10 @@ f4(uint32_t x, uint32_t y, uint32_t z)
> }
>
> /* SHA constants */
> -#define CONST1 0x5a827999L
> -#define CONST2 0x6ed9eba1L
> -#define CONST3 0x8f1bbcdcL
> -#define CONST4 0xca62c1d6L
> +#define CONST1 0x5a827999L
> +#define CONST2 0x6ed9eba1L
> +#define CONST3 0x8f1bbcdcL
> +#define CONST4 0xca62c1d6L
>
> /* 32-bit rotate */
> static inline uint32_t
> @@ -157,19 +157,19 @@ maybe_byte_reverse(uint32_t *buffer OVS_UNUSED, int count OVS_UNUSED)
> int i;
> uint8_t ct[4], *cp;
>
> - count /= sizeof(uint32_t);
> - cp = (uint8_t *) buffer;
> - for (i = 0; i < count; i++) {
> - ct[0] = cp[0];
> - ct[1] = cp[1];
> - ct[2] = cp[2];
> - ct[3] = cp[3];
> - cp[0] = ct[3];
> - cp[1] = ct[2];
> - cp[2] = ct[1];
> - cp[3] = ct[0];
> - cp += sizeof(uint32_t);
> - }
> + count /= sizeof(uint32_t);
> + cp = (uint8_t *) buffer;
> + for (i = 0; i < count; i++) {
> + ct[0] = cp[0];
> + ct[1] = cp[1];
> + ct[2] = cp[2];
> + ct[3] = cp[3];
> + cp[0] = ct[3];
> + cp[1] = ct[2];
> + cp[2] = ct[1];
> + cp[3] = ct[0];
> + cp += sizeof(uint32_t);
> + }
> #endif
> }
>
> diff --git a/lib/sha1.h b/lib/sha1.h
> index 9a37277..9015104 100644
> --- a/lib/sha1.h
> +++ b/lib/sha1.h
> @@ -20,10 +20,10 @@
> * limitations under the License.
> */
> /* NIST Secure Hash Algorithm
> - * heavily modified by Uwe Hollerbach uh at alumni.caltech edu
> - * from Peter C. Gutmann's implementation as found in
> - * Applied Cryptography by Bruce Schneier
> - * This code is hereby placed in the public domain
> + * heavily modified by Uwe Hollerbach uh at alumni.caltech edu
> + * from Peter C. Gutmann's implementation as found in
> + * Applied Cryptography by Bruce Schneier
> + * This code is hereby placed in the public domain
> */
>
> #ifndef SHA1_H
> diff --git a/lib/unaligned.h b/lib/unaligned.h
> index a5ae4be..87b060c 100644
> --- a/lib/unaligned.h
> +++ b/lib/unaligned.h
> @@ -178,15 +178,15 @@ put_unaligned_u64(uint64_t *p, uint64_t x)
> static inline uint64_t
> get_32aligned_u64(const ovs_32aligned_u64 *x)
> {
> - return ((uint64_t) x->hi << 32) | x->lo;
> + return ((uint64_t) x->hi << 32) | x->lo;
> }
>
> /* Stores 'value' in 'x'. */
> static inline void
> put_32aligned_u64(ovs_32aligned_u64 *x, uint64_t value)
> {
> - x->hi = value >> 32;
> - x->lo = value;
> + x->hi = value >> 32;
> + x->lo = value;
> }
>
> #ifndef __CHECKER__
> @@ -195,9 +195,9 @@ static inline ovs_be64
> get_32aligned_be64(const ovs_32aligned_be64 *x)
> {
> #ifdef WORDS_BIGENDIAN
> - return ((ovs_be64) x->hi << 32) | x->lo;
> + return ((ovs_be64) x->hi << 32) | x->lo;
> #else
> - return ((ovs_be64) x->lo << 32) | x->hi;
> + return ((ovs_be64) x->lo << 32) | x->hi;
> #endif
> }
>
> @@ -206,8 +206,8 @@ static inline void
> put_32aligned_be64(ovs_32aligned_be64 *x, ovs_be64 value)
> {
> #if WORDS_BIGENDIAN
> - x->hi = value >> 32;
> - x->lo = value;
> + x->hi = value >> 32;
> + x->lo = value;
> #else
> x->hi = value;
> x->lo = value >> 32;
> diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
> index 6ce587d..bb1b310 100644
> --- a/ofproto/ofproto.c
> +++ b/ofproto/ofproto.c
> @@ -1929,7 +1929,7 @@ handle_set_config(struct ofconn *ofconn, const struct ofp_switch_config *osc)
> }
> }
> ofconn_set_invalid_ttl_to_controller(ofconn,
> - (flags & OFPC_INVALID_TTL_TO_CONTROLLER));
> + (flags & OFPC_INVALID_TTL_TO_CONTROLLER));
>
> ofconn_set_miss_send_len(ofconn, ntohs(osc->miss_send_len));
>
> diff --git a/ofproto/ofproto.h b/ofproto/ofproto.h
> index adbb80d..538c2c6 100644
> --- a/ofproto/ofproto.h
> +++ b/ofproto/ofproto.h
> @@ -185,8 +185,8 @@ int ofproto_port_dump_done(struct ofproto_port_dump *);
> : (ofproto_port_dump_done(DUMP), false)); \
> )
>
> -#define OFPROTO_FLOW_EVICTON_THRESHOLD_DEFAULT 1000
> -#define OFPROTO_FLOW_EVICTION_THRESHOLD_MIN 100
> +#define OFPROTO_FLOW_EVICTON_THRESHOLD_DEFAULT 1000
> +#define OFPROTO_FLOW_EVICTION_THRESHOLD_MIN 100
>
> int ofproto_port_add(struct ofproto *, struct netdev *, uint16_t *ofp_portp);
> int ofproto_port_del(struct ofproto *, uint16_t ofp_port);
> --
> 1.7.2.5
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
More information about the dev
mailing list