Skip to content

Commit d94d9fe

Browse files
Eric Dumazetdavem330
authored andcommitted
net: cleanup include/linux
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>
1 parent b8883a6 commit d94d9fe

87 files changed

Lines changed: 351 additions & 694 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

include/linux/dn.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,12 @@
7171
/* Structures */
7272

7373

74-
struct dn_naddr
75-
{
74+
struct dn_naddr {
7675
__le16 a_len;
7776
__u8 a_addr[DN_MAXADDL]; /* Two bytes little endian */
7877
};
7978

80-
struct sockaddr_dn
81-
{
79+
struct sockaddr_dn {
8280
__u16 sdn_family;
8381
__u8 sdn_flags;
8482
__u8 sdn_objnum;
@@ -101,8 +99,7 @@ struct optdata_dn {
10199
__u8 opt_data[16]; /* User data */
102100
};
103101

104-
struct accessdata_dn
105-
{
102+
struct accessdata_dn {
106103
__u8 acc_accl;
107104
__u8 acc_acc[DN_MAXACCL];
108105
__u8 acc_passl;

include/linux/errqueue.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33

44
#include <linux/types.h>
55

6-
struct sock_extended_err
7-
{
6+
struct sock_extended_err {
87
__u32 ee_errno;
98
__u8 ee_origin;
109
__u8 ee_type;
@@ -31,8 +30,7 @@ struct sock_extended_err
3130

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

34-
struct sock_exterr_skb
35-
{
33+
struct sock_exterr_skb {
3634
union {
3735
struct inet_skb_parm h4;
3836
#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)

include/linux/fib_rules.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
/* try to find source address in routing lookups */
1414
#define FIB_RULE_FIND_SADDR 0x00010000
1515

16-
struct fib_rule_hdr
17-
{
16+
struct fib_rule_hdr {
1817
__u8 family;
1918
__u8 dst_len;
2019
__u8 src_len;
@@ -28,8 +27,7 @@ struct fib_rule_hdr
2827
__u32 flags;
2928
};
3029

31-
enum
32-
{
30+
enum {
3331
FRA_UNSPEC,
3432
FRA_DST, /* destination address */
3533
FRA_SRC, /* source address */
@@ -52,8 +50,7 @@ enum
5250

5351
#define FRA_MAX (__FRA_MAX - 1)
5452

55-
enum
56-
{
53+
enum {
5754
FR_ACT_UNSPEC,
5855
FR_ACT_TO_TBL, /* Pass to fixed table */
5956
FR_ACT_GOTO, /* Jump to another rule */

include/linux/filter.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,14 @@
2323
* the BPF code definitions which need to match so you can share filters
2424
*/
2525

26-
struct sock_filter /* Filter block */
27-
{
26+
struct sock_filter { /* Filter block */
2827
__u16 code; /* Actual filter code */
2928
__u8 jt; /* Jump true */
3029
__u8 jf; /* Jump false */
3130
__u32 k; /* Generic multiuse field */
3231
};
3332

34-
struct sock_fprog /* Required for SO_ATTACH_FILTER. */
35-
{
33+
struct sock_fprog { /* Required for SO_ATTACH_FILTER. */
3634
unsigned short len; /* Number of filter blocks */
3735
struct sock_filter __user *filter;
3836
};

include/linux/gen_stats.h

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,11 @@ enum {
1818
* @bytes: number of seen bytes
1919
* @packets: number of seen packets
2020
*/
21-
struct gnet_stats_basic
22-
{
21+
struct gnet_stats_basic {
2322
__u64 bytes;
2423
__u32 packets;
2524
};
26-
struct gnet_stats_basic_packed
27-
{
25+
struct gnet_stats_basic_packed {
2826
__u64 bytes;
2927
__u32 packets;
3028
} __attribute__ ((packed));
@@ -34,8 +32,7 @@ struct gnet_stats_basic_packed
3432
* @bps: current byte rate
3533
* @pps: current packet rate
3634
*/
37-
struct gnet_stats_rate_est
38-
{
35+
struct gnet_stats_rate_est {
3936
__u32 bps;
4037
__u32 pps;
4138
};
@@ -48,8 +45,7 @@ struct gnet_stats_rate_est
4845
* @requeues: number of requeues
4946
* @overlimits: number of enqueues over the limit
5047
*/
51-
struct gnet_stats_queue
52-
{
48+
struct gnet_stats_queue {
5349
__u32 qlen;
5450
__u32 backlog;
5551
__u32 drops;
@@ -62,8 +58,7 @@ struct gnet_stats_queue
6258
* @interval: sampling period
6359
* @ewma_log: the log of measurement window weight
6460
*/
65-
struct gnet_estimator
66-
{
61+
struct gnet_estimator {
6762
signed char interval;
6863
unsigned char ewma_log;
6964
};

include/linux/if.h

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,7 @@ enum {
125125
* being very small might be worth keeping for clean configuration.
126126
*/
127127

128-
struct ifmap
129-
{
128+
struct ifmap {
130129
unsigned long mem_start;
131130
unsigned long mem_end;
132131
unsigned short base_addr;
@@ -136,8 +135,7 @@ struct ifmap
136135
/* 3 bytes spare */
137136
};
138137

139-
struct if_settings
140-
{
138+
struct if_settings {
141139
unsigned int type; /* Type of physical device or protocol */
142140
unsigned int size; /* Size of the data allocated by the caller */
143141
union {
@@ -161,8 +159,7 @@ struct if_settings
161159
* remainder may be interface specific.
162160
*/
163161

164-
struct ifreq
165-
{
162+
struct ifreq {
166163
#define IFHWADDRLEN 6
167164
union
168165
{
@@ -211,11 +208,9 @@ struct ifreq
211208
* must know all networks accessible).
212209
*/
213210

214-
struct ifconf
215-
{
211+
struct ifconf {
216212
int ifc_len; /* size of buffer */
217-
union
218-
{
213+
union {
219214
char __user *ifcu_buf;
220215
struct ifreq __user *ifcu_req;
221216
} ifc_ifcu;

include/linux/if_addr.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
#include <linux/types.h>
55
#include <linux/netlink.h>
66

7-
struct ifaddrmsg
8-
{
7+
struct ifaddrmsg {
98
__u8 ifa_family;
109
__u8 ifa_prefixlen; /* The prefix length */
1110
__u8 ifa_flags; /* Flags */
@@ -20,8 +19,7 @@ struct ifaddrmsg
2019
* but for point-to-point IFA_ADDRESS is DESTINATION address,
2120
* local address is supplied in IFA_LOCAL attribute.
2221
*/
23-
enum
24-
{
22+
enum {
2523
IFA_UNSPEC,
2624
IFA_ADDRESS,
2725
IFA_LOCAL,
@@ -47,8 +45,7 @@ enum
4745
#define IFA_F_TENTATIVE 0x40
4846
#define IFA_F_PERMANENT 0x80
4947

50-
struct ifa_cacheinfo
51-
{
48+
struct ifa_cacheinfo {
5249
__u32 ifa_prefered;
5350
__u32 ifa_valid;
5451
__u32 cstamp; /* created timestamp, hundredths of seconds */

include/linux/if_addrlabel.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212

1313
#include <linux/types.h>
1414

15-
struct ifaddrlblmsg
16-
{
15+
struct ifaddrlblmsg {
1716
__u8 ifal_family; /* Address family */
1817
__u8 __ifal_reserved; /* Reserved */
1918
__u8 ifal_prefixlen; /* Prefix length */
@@ -22,8 +21,7 @@ struct ifaddrlblmsg
2221
__u32 ifal_seq; /* sequence number */
2322
};
2423

25-
enum
26-
{
24+
enum {
2725
IFAL_ADDRESS = 1,
2826
IFAL_LABEL = 2,
2927
__IFAL_MAX

include/linux/if_arcnet.h

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@
5656
/*
5757
* The RFC1201-specific components of an arcnet packet header.
5858
*/
59-
struct arc_rfc1201
60-
{
59+
struct arc_rfc1201 {
6160
__u8 proto; /* protocol ID field - varies */
6261
__u8 split_flag; /* for use with split packets */
6362
__be16 sequence; /* sequence number */
@@ -69,8 +68,7 @@ struct arc_rfc1201
6968
/*
7069
* The RFC1051-specific components.
7170
*/
72-
struct arc_rfc1051
73-
{
71+
struct arc_rfc1051 {
7472
__u8 proto; /* ARC_P_RFC1051_ARP/RFC1051_IP */
7573
__u8 payload[0]; /* 507 bytes */
7674
};
@@ -81,17 +79,15 @@ struct arc_rfc1051
8179
* The ethernet-encap-specific components. We have a real ethernet header
8280
* and some data.
8381
*/
84-
struct arc_eth_encap
85-
{
82+
struct arc_eth_encap {
8683
__u8 proto; /* Always ARC_P_ETHER */
8784
struct ethhdr eth; /* standard ethernet header (yuck!) */
8885
__u8 payload[0]; /* 493 bytes */
8986
};
9087
#define ETH_ENCAP_HDR_SIZE 14
9188

9289

93-
struct arc_cap
94-
{
90+
struct arc_cap {
9591
__u8 proto;
9692
__u8 cookie[sizeof(int)]; /* Actually NOT sent over the network */
9793
union {
@@ -108,8 +104,7 @@ struct arc_cap
108104
* the _end_ of the 512-byte buffer. We hide this complexity inside the
109105
* driver.
110106
*/
111-
struct arc_hardware
112-
{
107+
struct arc_hardware {
113108
__u8 source, /* source ARCnet - filled in automagically */
114109
dest, /* destination ARCnet - 0 for broadcast */
115110
offset[2]; /* offset bytes (some weird semantics) */
@@ -120,8 +115,7 @@ struct arc_hardware
120115
* This is an ARCnet frame header, as seen by the kernel (and userspace,
121116
* when you do a raw packet capture).
122117
*/
123-
struct archdr
124-
{
118+
struct archdr {
125119
/* hardware requirements */
126120
struct arc_hardware hard;
127121

include/linux/if_arp.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,7 @@ struct arpreq_old {
133133
* This structure defines an ethernet arp header.
134134
*/
135135

136-
struct arphdr
137-
{
136+
struct arphdr {
138137
__be16 ar_hrd; /* format of hardware address */
139138
__be16 ar_pro; /* format of protocol address */
140139
unsigned char ar_hln; /* length of hardware address */

0 commit comments

Comments
 (0)