Skip to content

Commit

Permalink
net: cleanup include/linux
Browse files Browse the repository at this point in the history
This cleanup patch puts struct/union/enum opening braces,
in first line to ease grep games.

struct something
{

becomes :

struct something {

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Nov 4, 2009
1 parent b8883a6 commit d94d9fe
Show file tree
Hide file tree
Showing 87 changed files with 351 additions and 694 deletions.
9 changes: 3 additions & 6 deletions include/linux/dn.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,12 @@
/* Structures */


struct dn_naddr
{
struct dn_naddr {
__le16 a_len;
__u8 a_addr[DN_MAXADDL]; /* Two bytes little endian */
};

struct sockaddr_dn
{
struct sockaddr_dn {
__u16 sdn_family;
__u8 sdn_flags;
__u8 sdn_objnum;
Expand All @@ -101,8 +99,7 @@ struct optdata_dn {
__u8 opt_data[16]; /* User data */
};

struct accessdata_dn
{
struct accessdata_dn {
__u8 acc_accl;
__u8 acc_acc[DN_MAXACCL];
__u8 acc_passl;
Expand Down
6 changes: 2 additions & 4 deletions include/linux/errqueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

#include <linux/types.h>

struct sock_extended_err
{
struct sock_extended_err {
__u32 ee_errno;
__u8 ee_origin;
__u8 ee_type;
Expand All @@ -31,8 +30,7 @@ struct sock_extended_err

#define SKB_EXT_ERR(skb) ((struct sock_exterr_skb *) ((skb)->cb))

struct sock_exterr_skb
{
struct sock_exterr_skb {
union {
struct inet_skb_parm h4;
#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
Expand Down
9 changes: 3 additions & 6 deletions include/linux/fib_rules.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
/* try to find source address in routing lookups */
#define FIB_RULE_FIND_SADDR 0x00010000

struct fib_rule_hdr
{
struct fib_rule_hdr {
__u8 family;
__u8 dst_len;
__u8 src_len;
Expand All @@ -28,8 +27,7 @@ struct fib_rule_hdr
__u32 flags;
};

enum
{
enum {
FRA_UNSPEC,
FRA_DST, /* destination address */
FRA_SRC, /* source address */
Expand All @@ -52,8 +50,7 @@ enum

#define FRA_MAX (__FRA_MAX - 1)

enum
{
enum {
FR_ACT_UNSPEC,
FR_ACT_TO_TBL, /* Pass to fixed table */
FR_ACT_GOTO, /* Jump to another rule */
Expand Down
6 changes: 2 additions & 4 deletions include/linux/filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,14 @@
* the BPF code definitions which need to match so you can share filters
*/

struct sock_filter /* Filter block */
{
struct sock_filter { /* Filter block */
__u16 code; /* Actual filter code */
__u8 jt; /* Jump true */
__u8 jf; /* Jump false */
__u32 k; /* Generic multiuse field */
};

struct sock_fprog /* Required for SO_ATTACH_FILTER. */
{
struct sock_fprog { /* Required for SO_ATTACH_FILTER. */
unsigned short len; /* Number of filter blocks */
struct sock_filter __user *filter;
};
Expand Down
15 changes: 5 additions & 10 deletions include/linux/gen_stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@ enum {
* @bytes: number of seen bytes
* @packets: number of seen packets
*/
struct gnet_stats_basic
{
struct gnet_stats_basic {
__u64 bytes;
__u32 packets;
};
struct gnet_stats_basic_packed
{
struct gnet_stats_basic_packed {
__u64 bytes;
__u32 packets;
} __attribute__ ((packed));
Expand All @@ -34,8 +32,7 @@ struct gnet_stats_basic_packed
* @bps: current byte rate
* @pps: current packet rate
*/
struct gnet_stats_rate_est
{
struct gnet_stats_rate_est {
__u32 bps;
__u32 pps;
};
Expand All @@ -48,8 +45,7 @@ struct gnet_stats_rate_est
* @requeues: number of requeues
* @overlimits: number of enqueues over the limit
*/
struct gnet_stats_queue
{
struct gnet_stats_queue {
__u32 qlen;
__u32 backlog;
__u32 drops;
Expand All @@ -62,8 +58,7 @@ struct gnet_stats_queue
* @interval: sampling period
* @ewma_log: the log of measurement window weight
*/
struct gnet_estimator
{
struct gnet_estimator {
signed char interval;
unsigned char ewma_log;
};
Expand Down
15 changes: 5 additions & 10 deletions include/linux/if.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,7 @@ enum {
* being very small might be worth keeping for clean configuration.
*/

struct ifmap
{
struct ifmap {
unsigned long mem_start;
unsigned long mem_end;
unsigned short base_addr;
Expand All @@ -136,8 +135,7 @@ struct ifmap
/* 3 bytes spare */
};

struct if_settings
{
struct if_settings {
unsigned int type; /* Type of physical device or protocol */
unsigned int size; /* Size of the data allocated by the caller */
union {
Expand All @@ -161,8 +159,7 @@ struct if_settings
* remainder may be interface specific.
*/

struct ifreq
{
struct ifreq {
#define IFHWADDRLEN 6
union
{
Expand Down Expand Up @@ -211,11 +208,9 @@ struct ifreq
* must know all networks accessible).
*/

struct ifconf
{
struct ifconf {
int ifc_len; /* size of buffer */
union
{
union {
char __user *ifcu_buf;
struct ifreq __user *ifcu_req;
} ifc_ifcu;
Expand Down
9 changes: 3 additions & 6 deletions include/linux/if_addr.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
#include <linux/types.h>
#include <linux/netlink.h>

struct ifaddrmsg
{
struct ifaddrmsg {
__u8 ifa_family;
__u8 ifa_prefixlen; /* The prefix length */
__u8 ifa_flags; /* Flags */
Expand All @@ -20,8 +19,7 @@ struct ifaddrmsg
* but for point-to-point IFA_ADDRESS is DESTINATION address,
* local address is supplied in IFA_LOCAL attribute.
*/
enum
{
enum {
IFA_UNSPEC,
IFA_ADDRESS,
IFA_LOCAL,
Expand All @@ -47,8 +45,7 @@ enum
#define IFA_F_TENTATIVE 0x40
#define IFA_F_PERMANENT 0x80

struct ifa_cacheinfo
{
struct ifa_cacheinfo {
__u32 ifa_prefered;
__u32 ifa_valid;
__u32 cstamp; /* created timestamp, hundredths of seconds */
Expand Down
6 changes: 2 additions & 4 deletions include/linux/if_addrlabel.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@

#include <linux/types.h>

struct ifaddrlblmsg
{
struct ifaddrlblmsg {
__u8 ifal_family; /* Address family */
__u8 __ifal_reserved; /* Reserved */
__u8 ifal_prefixlen; /* Prefix length */
Expand All @@ -22,8 +21,7 @@ struct ifaddrlblmsg
__u32 ifal_seq; /* sequence number */
};

enum
{
enum {
IFAL_ADDRESS = 1,
IFAL_LABEL = 2,
__IFAL_MAX
Expand Down
18 changes: 6 additions & 12 deletions include/linux/if_arcnet.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@
/*
* The RFC1201-specific components of an arcnet packet header.
*/
struct arc_rfc1201
{
struct arc_rfc1201 {
__u8 proto; /* protocol ID field - varies */
__u8 split_flag; /* for use with split packets */
__be16 sequence; /* sequence number */
Expand All @@ -69,8 +68,7 @@ struct arc_rfc1201
/*
* The RFC1051-specific components.
*/
struct arc_rfc1051
{
struct arc_rfc1051 {
__u8 proto; /* ARC_P_RFC1051_ARP/RFC1051_IP */
__u8 payload[0]; /* 507 bytes */
};
Expand All @@ -81,17 +79,15 @@ struct arc_rfc1051
* The ethernet-encap-specific components. We have a real ethernet header
* and some data.
*/
struct arc_eth_encap
{
struct arc_eth_encap {
__u8 proto; /* Always ARC_P_ETHER */
struct ethhdr eth; /* standard ethernet header (yuck!) */
__u8 payload[0]; /* 493 bytes */
};
#define ETH_ENCAP_HDR_SIZE 14


struct arc_cap
{
struct arc_cap {
__u8 proto;
__u8 cookie[sizeof(int)]; /* Actually NOT sent over the network */
union {
Expand All @@ -108,8 +104,7 @@ struct arc_cap
* the _end_ of the 512-byte buffer. We hide this complexity inside the
* driver.
*/
struct arc_hardware
{
struct arc_hardware {
__u8 source, /* source ARCnet - filled in automagically */
dest, /* destination ARCnet - 0 for broadcast */
offset[2]; /* offset bytes (some weird semantics) */
Expand All @@ -120,8 +115,7 @@ struct arc_hardware
* This is an ARCnet frame header, as seen by the kernel (and userspace,
* when you do a raw packet capture).
*/
struct archdr
{
struct archdr {
/* hardware requirements */
struct arc_hardware hard;

Expand Down
3 changes: 1 addition & 2 deletions include/linux/if_arp.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ struct arpreq_old {
* This structure defines an ethernet arp header.
*/

struct arphdr
{
struct arphdr {
__be16 ar_hrd; /* format of hardware address */
__be16 ar_pro; /* format of protocol address */
unsigned char ar_hln; /* length of hardware address */
Expand Down
3 changes: 1 addition & 2 deletions include/linux/if_bonding.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ typedef struct ifbond {
__s32 miimon;
} ifbond;

typedef struct ifslave
{
typedef struct ifslave {
__s32 slave_id; /* Used as an IN param to the BOND_SLAVE_INFO_QUERY ioctl */
char slave_name[IFNAMSIZ];
__s8 link;
Expand Down
9 changes: 3 additions & 6 deletions include/linux/if_bridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@
#define BR_STATE_FORWARDING 3
#define BR_STATE_BLOCKING 4

struct __bridge_info
{
struct __bridge_info {
__u64 designated_root;
__u64 bridge_id;
__u32 root_path_cost;
Expand All @@ -72,8 +71,7 @@ struct __bridge_info
__u32 gc_timer_value;
};

struct __port_info
{
struct __port_info {
__u64 designated_root;
__u64 designated_bridge;
__u16 port_id;
Expand All @@ -89,8 +87,7 @@ struct __port_info
__u32 hold_timer_value;
};

struct __fdb_entry
{
struct __fdb_entry {
__u8 mac_addr[6];
__u8 port_no;
__u8 is_local;
Expand Down
12 changes: 4 additions & 8 deletions include/linux/if_ec.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@

/* User visible stuff. Glibc provides its own but libc5 folk will use these */

struct ec_addr
{
struct ec_addr {
unsigned char station; /* Station number. */
unsigned char net; /* Network number. */
};

struct sockaddr_ec
{
struct sockaddr_ec {
unsigned short sec_family;
unsigned char port; /* Port number. */
unsigned char cb; /* Control/flag byte. */
Expand All @@ -37,8 +35,7 @@ struct sockaddr_ec
#define EC_HLEN 6

/* This is what an Econet frame looks like on the wire. */
struct ec_framehdr
{
struct ec_framehdr {
unsigned char dst_stn;
unsigned char dst_net;
unsigned char src_stn;
Expand All @@ -62,8 +59,7 @@ static inline struct econet_sock *ec_sk(const struct sock *sk)
return (struct econet_sock *)sk;
}

struct ec_device
{
struct ec_device {
unsigned char station, net; /* Econet protocol address */
};

Expand Down
Loading

0 comments on commit d94d9fe

Please sign in to comment.