Skip to content

Commit 34ddb8c

Browse files
jukkarnashif
authored andcommitted
net: includes: Fix indentation in header files
The indentation went wrong when the integer types was changed from the type "u8_t" to type "uint8_t". This changed the length of the type and caused the code to look bad in places. Signed-off-by: Jukka Rissanen <[email protected]>
1 parent d75e1a8 commit 34ddb8c

File tree

12 files changed

+58
-49
lines changed

12 files changed

+58
-49
lines changed

include/net/buf.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ struct net_buf_simple {
119119
#define NET_BUF_SIMPLE(_size) \
120120
((struct net_buf_simple *)(&(struct { \
121121
struct net_buf_simple buf; \
122-
uint8_t data[_size]; \
122+
uint8_t data[_size]; \
123123
}) { \
124124
.buf.size = _size, \
125125
}))
@@ -790,7 +790,8 @@ struct net_buf {
790790
};
791791

792792
struct net_buf_data_cb {
793-
uint8_t * (*alloc)(struct net_buf *buf, size_t *size, k_timeout_t timeout);
793+
uint8_t * (*alloc)(struct net_buf *buf, size_t *size,
794+
k_timeout_t timeout);
794795
uint8_t * (*ref)(struct net_buf *buf, uint8_t *data);
795796
void (*unref)(struct net_buf *buf, uint8_t *data);
796797
};
@@ -840,7 +841,7 @@ struct net_buf_pool {
840841
#if defined(CONFIG_NET_BUF_POOL_USAGE)
841842
#define NET_BUF_POOL_INITIALIZER(_pool, _alloc, _bufs, _count, _destroy) \
842843
{ \
843-
.free = Z_LIFO_INITIALIZER(_pool.free), \
844+
.free = Z_LIFO_INITIALIZER(_pool.free), \
844845
.buf_count = _count, \
845846
.uninit_count = _count, \
846847
.avail_count = _count, \
@@ -852,7 +853,7 @@ struct net_buf_pool {
852853
#else
853854
#define NET_BUF_POOL_INITIALIZER(_pool, _alloc, _bufs, _count, _destroy) \
854855
{ \
855-
.free = Z_LIFO_INITIALIZER(_pool.free), \
856+
.free = Z_LIFO_INITIALIZER(_pool.free), \
856857
.buf_count = _count, \
857858
.uninit_count = _count, \
858859
.destroy = _destroy, \
@@ -935,10 +936,10 @@ extern const struct net_buf_data_cb net_buf_fixed_cb;
935936
*/
936937
#define NET_BUF_POOL_FIXED_DEFINE(_name, _count, _data_size, _destroy) \
937938
static struct net_buf net_buf_##_name[_count] __noinit; \
938-
static uint8_t __noinit net_buf_data_##_name[_count][_data_size]; \
939+
static uint8_t __noinit net_buf_data_##_name[_count][_data_size]; \
939940
static const struct net_buf_pool_fixed net_buf_fixed_##_name = { \
940941
.data_size = _data_size, \
941-
.data_pool = (uint8_t *)net_buf_data_##_name, \
942+
.data_pool = (uint8_t *)net_buf_data_##_name, \
942943
}; \
943944
static const struct net_buf_data_alloc net_buf_fixed_alloc_##_name = {\
944945
.cb = &net_buf_fixed_cb, \

include/net/coap.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,8 @@ uint16_t coap_header_get_id(const struct coap_packet *cpkt);
313313
* @return data pointer and length if payload exists
314314
* NULL pointer and length set to 0 in case there is no payload
315315
*/
316-
const uint8_t *coap_packet_get_payload(const struct coap_packet *cpkt, uint16_t *len);
316+
const uint8_t *coap_packet_get_payload(const struct coap_packet *cpkt,
317+
uint16_t *len);
317318

318319
/**
319320
* @brief Parses the CoAP packet in data, validating it and

include/net/ethernet_mgmt.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,8 @@ static inline void ethernet_mgmt_raise_vlan_enabled_event(struct net_if *iface,
184184
* @param tag VLAN tag which is disabled.
185185
*/
186186
#if defined(CONFIG_NET_L2_ETHERNET_MGMT)
187-
void ethernet_mgmt_raise_vlan_disabled_event(struct net_if *iface, uint16_t tag);
187+
void ethernet_mgmt_raise_vlan_disabled_event(struct net_if *iface,
188+
uint16_t tag);
188189
#else
189190
static inline void ethernet_mgmt_raise_vlan_disabled_event(struct net_if *iface,
190191
uint16_t tag)

include/net/lldp.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ int net_lldp_config(struct net_if *iface, const struct net_lldpdu *lldpdu);
189189
*
190190
* @return 0 if ok, <0 if error
191191
*/
192-
int net_lldp_config_optional(struct net_if *iface, const uint8_t *tlv, size_t len);
192+
int net_lldp_config_optional(struct net_if *iface, const uint8_t *tlv,
193+
size_t len);
193194

194195
/**
195196
* @brief Initialize LLDP engine.

include/net/lwm2m.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ struct lwm2m_ctx {
134134
* @return Callback returns a pointer to the data buffer or NULL for failure.
135135
*/
136136
typedef void *(*lwm2m_engine_get_data_cb_t)(uint16_t obj_inst_id,
137-
uint16_t res_id, uint16_t res_inst_id,
137+
uint16_t res_id,
138+
uint16_t res_inst_id,
138139
size_t *data_len);
139140

140141
/**
@@ -784,8 +785,8 @@ int lwm2m_engine_set_res_data(char *pathstr, void *data_ptr, uint16_t data_len,
784785
*
785786
* @return 0 for success or negative in case of error.
786787
*/
787-
int lwm2m_engine_get_res_data(char *pathstr, void **data_ptr, uint16_t *data_len,
788-
uint8_t *data_flags);
788+
int lwm2m_engine_get_res_data(char *pathstr, void **data_ptr,
789+
uint16_t *data_len, uint8_t *data_flags);
789790

790791
/**
791792
* @brief Create a resource instance

include/net/net_if.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -716,8 +716,8 @@ static inline void net_if_stop_rs(struct net_if *iface)
716716
* @brief Set a network interface's link address
717717
*
718718
* @param iface Pointer to a network interface structure
719-
* @param addr A pointer to a uint8_t buffer representing the address. The buffer
720-
* must remain valid throughout interface lifetime.
719+
* @param addr A pointer to a uint8_t buffer representing the address.
720+
* The buffer must remain valid throughout interface lifetime.
721721
* @param len length of the address buffer
722722
* @param type network bearer type of this link address
723723
*

include/net/net_ip.h

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -166,50 +166,50 @@ typedef size_t socklen_t;
166166
/** Socket address struct for IPv6. */
167167
struct sockaddr_in6 {
168168
sa_family_t sin6_family; /* AF_INET6 */
169-
uint16_t sin6_port; /* Port number */
169+
uint16_t sin6_port; /* Port number */
170170
struct in6_addr sin6_addr; /* IPv6 address */
171171
uint8_t sin6_scope_id; /* interfaces for a scope */
172172
};
173173

174174
struct sockaddr_in6_ptr {
175175
sa_family_t sin6_family; /* AF_INET6 */
176-
uint16_t sin6_port; /* Port number */
176+
uint16_t sin6_port; /* Port number */
177177
struct in6_addr *sin6_addr; /* IPv6 address */
178178
uint8_t sin6_scope_id; /* interfaces for a scope */
179179
};
180180

181181
/** Socket address struct for IPv4. */
182182
struct sockaddr_in {
183183
sa_family_t sin_family; /* AF_INET */
184-
uint16_t sin_port; /* Port number */
184+
uint16_t sin_port; /* Port number */
185185
struct in_addr sin_addr; /* IPv4 address */
186186
};
187187

188188
struct sockaddr_in_ptr {
189189
sa_family_t sin_family; /* AF_INET */
190-
uint16_t sin_port; /* Port number */
190+
uint16_t sin_port; /* Port number */
191191
struct in_addr *sin_addr; /* IPv4 address */
192192
};
193193

194194
/** Socket address struct for packet socket. */
195195
struct sockaddr_ll {
196196
sa_family_t sll_family; /* Always AF_PACKET */
197-
uint16_t sll_protocol; /* Physical-layer protocol */
197+
uint16_t sll_protocol; /* Physical-layer protocol */
198198
int sll_ifindex; /* Interface number */
199-
uint16_t sll_hatype; /* ARP hardware type */
200-
uint8_t sll_pkttype; /* Packet type */
201-
uint8_t sll_halen; /* Length of address */
202-
uint8_t sll_addr[8]; /* Physical-layer address */
199+
uint16_t sll_hatype; /* ARP hardware type */
200+
uint8_t sll_pkttype; /* Packet type */
201+
uint8_t sll_halen; /* Length of address */
202+
uint8_t sll_addr[8]; /* Physical-layer address */
203203
};
204204

205205
struct sockaddr_ll_ptr {
206206
sa_family_t sll_family; /* Always AF_PACKET */
207-
uint16_t sll_protocol; /* Physical-layer protocol */
207+
uint16_t sll_protocol; /* Physical-layer protocol */
208208
int sll_ifindex; /* Interface number */
209-
uint16_t sll_hatype; /* ARP hardware type */
210-
uint8_t sll_pkttype; /* Packet type */
211-
uint8_t sll_halen; /* Length of address */
212-
uint8_t *sll_addr; /* Physical-layer address */
209+
uint16_t sll_hatype; /* ARP hardware type */
210+
uint8_t sll_pkttype; /* Packet type */
211+
uint8_t sll_halen; /* Length of address */
212+
uint8_t *sll_addr; /* Physical-layer address */
213213
};
214214

215215
struct sockaddr_can_ptr {
@@ -260,11 +260,11 @@ struct cmsghdr {
260260
#if !defined(CMSG_NXTHDR)
261261
#define CMSG_NXTHDR(msghdr, cmsg) \
262262
(((cmsg) == NULL) ? CMSG_FIRSTHDR(msghdr) : \
263-
(((uint8_t *)(cmsg) + ALIGN_H((cmsg)->cmsg_len) + \
263+
(((uint8_t *)(cmsg) + ALIGN_H((cmsg)->cmsg_len) + \
264264
ALIGN_D(sizeof(struct cmsghdr)) > \
265265
(uint8_t *)((msghdr)->msg_control) + (msghdr)->msg_controllen) ? \
266266
NULL : \
267-
(struct cmsghdr *)((uint8_t *)(cmsg) + \
267+
(struct cmsghdr *)((uint8_t *)(cmsg) + \
268268
ALIGN_H((cmsg)->cmsg_len))))
269269
#endif
270270

@@ -415,8 +415,8 @@ enum net_priority {
415415
struct net_tuple {
416416
struct net_addr *remote_addr; /**< IPv6/IPv4 remote address */
417417
struct net_addr *local_addr; /**< IPv6/IPv4 local address */
418-
uint16_t remote_port; /**< UDP/TCP remote port */
419-
uint16_t local_port; /**< UDP/TCP local port */
418+
uint16_t remote_port; /**< UDP/TCP remote port */
419+
uint16_t local_port; /**< UDP/TCP local port */
420420
enum net_ip_protocol ip_proto; /**< IP protocol */
421421
};
422422

include/net/net_mgmt.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,8 @@ void net_mgmt_del_event_callback(struct net_mgmt_event_callback *cb);
221221
void net_mgmt_event_notify_with_info(uint32_t mgmt_event, struct net_if *iface,
222222
void *info, size_t length);
223223

224-
static inline void net_mgmt_event_notify(uint32_t mgmt_event, struct net_if *iface)
224+
static inline void net_mgmt_event_notify(uint32_t mgmt_event,
225+
struct net_if *iface)
225226
{
226227
net_mgmt_event_notify_with_info(mgmt_event, iface, NULL, 0);
227228
}

include/net/net_pkt.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,10 @@ struct net_pkt {
184184
};
185185

186186
#if defined(CONFIG_NET_TCP)
187-
uint8_t tcp_first_msg : 1; /* Is this the first time this pkt is sent,
188-
* or is this a resend of a TCP segment.
189-
*/
187+
uint8_t tcp_first_msg : 1; /* Is this the first time this pkt is
188+
* sent, or is this a resend of a TCP
189+
* segment.
190+
*/
190191
#endif
191192

192193
union {
@@ -478,7 +479,8 @@ static inline uint8_t net_pkt_ipv6_next_hdr(struct net_pkt *pkt)
478479
return pkt->ipv6_next_hdr;
479480
}
480481

481-
static inline void net_pkt_set_ipv6_next_hdr(struct net_pkt *pkt, uint8_t next_hdr)
482+
static inline void net_pkt_set_ipv6_next_hdr(struct net_pkt *pkt,
483+
uint8_t next_hdr)
482484
{
483485
pkt->ipv6_next_hdr = next_hdr;
484486
}
@@ -536,7 +538,8 @@ static inline uint8_t net_pkt_ipv6_next_hdr(struct net_pkt *pkt)
536538
return 0;
537539
}
538540

539-
static inline void net_pkt_set_ipv6_next_hdr(struct net_pkt *pkt, uint8_t next_hdr)
541+
static inline void net_pkt_set_ipv6_next_hdr(struct net_pkt *pkt,
542+
uint8_t next_hdr)
540543
{
541544
ARG_UNUSED(pkt);
542545
ARG_UNUSED(next_hdr);

include/net/socket.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ struct zsock_pollfd {
123123
/** @} */
124124

125125
/* Valid values for TLS_PEER_VERIFY option */
126-
#define TLS_PEER_VERIFY_NONE 0 /**< Peer verification disabled. */
126+
#define TLS_PEER_VERIFY_NONE 0 /**< Peer verification disabled. */
127127
#define TLS_PEER_VERIFY_OPTIONAL 1 /**< Peer verification optional. */
128128
#define TLS_PEER_VERIFY_REQUIRED 2 /**< Peer verification required. */
129129

include/net/trickle.h

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,18 @@ typedef void (*net_trickle_cb_t)(struct net_trickle *trickle,
5151
* only via the Trickle API.
5252
*/
5353
struct net_trickle {
54-
uint32_t Imin; /* Min interval size in ms */
55-
uint8_t Imax; /* Max number of doublings */
56-
uint8_t k; /* Redundancy constant */
54+
uint32_t Imin; /**< Min interval size in ms */
55+
uint8_t Imax; /**< Max number of doublings */
56+
uint8_t k; /**< Redundancy constant */
5757

58-
uint32_t I; /* Current interval size */
59-
uint32_t Istart; /* Start of the interval in ms */
60-
uint8_t c; /* Consistency counter */
58+
uint32_t I; /**< Current interval size */
59+
uint32_t Istart; /**< Start of the interval in ms */
60+
uint8_t c; /**< Consistency counter */
6161

62-
uint32_t Imax_abs; /* Max interval size in ms (not doublings)
63-
*/
62+
uint32_t Imax_abs; /**< Max interval size in ms (not doublings) */
6463

6564
struct k_delayed_work timer;
66-
net_trickle_cb_t cb; /* Callback to be called when timer expires */
65+
net_trickle_cb_t cb; /**< Callback to be called when timer expires */
6766
void *user_data;
6867
};
6968

include/net/websocket.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ int websocket_send_msg(int ws_sock, const uint8_t *payload, size_t payload_len,
169169
* @return <0 if error, >=0 amount of bytes received
170170
*/
171171
int websocket_recv_msg(int ws_sock, uint8_t *buf, size_t buf_len,
172-
uint32_t *message_type, uint64_t *remaining, int32_t timeout);
172+
uint32_t *message_type, uint64_t *remaining,
173+
int32_t timeout);
173174

174175
/**
175176
* @brief Close websocket.

0 commit comments

Comments
 (0)