ef8ca9eeb798afcde4d007ec87fad92404aead49 Multiples issues on skbuff.h file. include/linux/skbuff.h | 114 ++++++++++++++++++++++++------------------------- 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 15d0df9..2365b01 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -536,8 +536,8 @@ static inline u32 skb_mstamp_us_delta(const struct skb_mstamp *t1, /* If delta_us is negative, this might be because interval is too big, * or local_clock() drift is too big : fallback using jiffies. */ - if (delta_us <= 0 || - delta_jiffies >= (INT_MAX / (USEC_PER_SEC / HZ))) + if ((delta_us <= 0) || + (delta_jiffies >= (INT_MAX / (USEC_PER_SEC / HZ)))) delta_us = jiffies_to_usecs(delta_jiffies); @@ -551,7 +551,7 @@ static inline bool skb_mstamp_after(const struct skb_mstamp *t1, if (!diff) diff = t1->stamp_us - t0->stamp_us; - return diff > 0; + return (diff > 0); } /** @@ -866,7 +866,7 @@ static inline void skb_dst_set_noref(struct sk_buff *skb, struct dst_entry *dst) */ static inline bool skb_dst_is_noref(const struct sk_buff *skb) { - return (skb->_skb_refdst & SKB_DST_NOREF) && skb_dst(skb); + return ((skb->_skb_refdst & SKB_DST_NOREF) && skb_dst(skb)); } static inline struct rtable *skb_rtable(const struct sk_buff *skb) @@ -925,9 +925,9 @@ static inline bool skb_fclone_busy(const struct sock *sk, fclones = container_of(skb, struct sk_buff_fclones, skb1); - return skb->fclone == SKB_FCLONE_ORIG && - atomic_read(&fclones->fclone_ref) > 1 && - fclones->skb2.sk == sk; + return ((skb->fclone == SKB_FCLONE_ORIG) && + (atomic_read(&fclones->fclone_ref) > 1) && + (fclones->skb2.sk == sk)); } static inline struct sk_buff *alloc_skb_fclone(unsigned int size, @@ -1052,7 +1052,7 @@ static inline void skb_set_hash(struct sk_buff *skb, __u32 hash, enum pkt_hash_types type) { /* Used by drivers to set hash from HW */ - __skb_set_hash(skb, hash, false, type == PKT_HASH_TYPE_L4); + __skb_set_hash(skb, hash, false, (type == PKT_HASH_TYPE_L4)); } static inline void @@ -1164,7 +1164,7 @@ static inline void skb_copy_hash(struct sk_buff *to, const struct sk_buff *from) #ifdef NET_SKBUFF_DATA_USES_OFFSET static inline unsigned char *skb_end_pointer(const struct sk_buff *skb) { - return skb->head + skb->end; + return (skb->head + skb->end); } static inline unsigned int skb_end_offset(const struct sk_buff *skb) @@ -1179,7 +1179,7 @@ static inline unsigned char *skb_end_pointer(const struct sk_buff *skb) static inline unsigned int skb_end_offset(const struct sk_buff *skb) { - return skb->end - skb->head; + return (skb->end - skb->head); } #endif @@ -1199,7 +1199,7 @@ static inline struct skb_shared_hwtstamps *skb_hwtstamps(struct sk_buff *skb) */ static inline int skb_queue_empty(const struct sk_buff_head *list) { - return list->next == (const struct sk_buff *) list; + return (list->next == (const struct sk_buff *) list); } /** @@ -1212,7 +1212,7 @@ static inline int skb_queue_empty(const struct sk_buff_head *list) static inline bool skb_queue_is_last(const struct sk_buff_head *list, const struct sk_buff *skb) { - return skb->next == (const struct sk_buff *) list; + return (skb->next == (const struct sk_buff *) list); } /** @@ -1225,7 +1225,7 @@ static inline bool skb_queue_is_last(const struct sk_buff_head *list, static inline bool skb_queue_is_first(const struct sk_buff_head *list, const struct sk_buff *skb) { - return skb->prev == (const struct sk_buff *) list; + return (skb->prev == (const struct sk_buff *) list); } /** @@ -1292,8 +1292,8 @@ static inline struct sk_buff *skb_get(struct sk_buff *skb) */ static inline int skb_cloned(const struct sk_buff *skb) { - return skb->cloned && - (atomic_read(&skb_shinfo(skb)->dataref) & SKB_DATAREF_MASK) != 1; + return (skb->cloned && + ((atomic_read(&skb_shinfo(skb)->dataref) & SKB_DATAREF_MASK) != 1)); } static inline int skb_unclone(struct sk_buff *skb, gfp_t pri) @@ -1322,7 +1322,7 @@ static inline int skb_header_cloned(const struct sk_buff *skb) dataref = atomic_read(&skb_shinfo(skb)->dataref); dataref = (dataref & SKB_DATAREF_MASK) - (dataref >> SKB_DATAREF_SHIFT); - return dataref != 1; + return (dataref != 1); } /** @@ -1364,7 +1364,7 @@ static inline void __skb_header_release(struct sk_buff *skb) */ static inline int skb_shared(const struct sk_buff *skb) { - return atomic_read(&skb->users) != 1; + return (atomic_read(&skb->users) != 1); } /** @@ -1760,7 +1760,7 @@ static inline bool skb_is_nonlinear(const struct sk_buff *skb) static inline unsigned int skb_headlen(const struct sk_buff *skb) { - return skb->len - skb->data_len; + return (skb->len - skb->data_len); } static inline int skb_pagelen(const struct sk_buff *skb) @@ -1769,7 +1769,7 @@ static inline int skb_pagelen(const struct sk_buff *skb) for (i = (int)skb_shinfo(skb)->nr_frags - 1; i >= 0; i--) len += skb_frag_size(&skb_shinfo(skb)->frags[i]); - return len + skb_headlen(skb); + return (len + skb_headlen(skb)); } /** @@ -1838,7 +1838,7 @@ void skb_coalesce_rx_frag(struct sk_buff *skb, int i, int size, #ifdef NET_SKBUFF_DATA_USES_OFFSET static inline unsigned char *skb_tail_pointer(const struct sk_buff *skb) { - return skb->head + skb->tail; + return (skb->head + skb->tail); } static inline void skb_reset_tail_pointer(struct sk_buff *skb) @@ -1927,7 +1927,7 @@ static inline int pskb_may_pull(struct sk_buff *skb, unsigned int len) return 1; if (unlikely(len > skb->len)) return 0; - return __pskb_pull_tail(skb, len - skb_headlen(skb)) != NULL; + return (__pskb_pull_tail(skb, len - skb_headlen(skb)) != NULL); } /** @@ -1938,7 +1938,7 @@ static inline int pskb_may_pull(struct sk_buff *skb, unsigned int len) */ static inline unsigned int skb_headroom(const struct sk_buff *skb) { - return skb->data - skb->head; + return (skb->data - skb->head); } /** @@ -1964,7 +1964,7 @@ static inline int skb_availroom(const struct sk_buff *skb) if (skb_is_nonlinear(skb)) return 0; - return skb->end - skb->tail - skb->reserved_tailroom; + return (skb->end - skb->tail - skb->reserved_tailroom); } /** @@ -2037,12 +2037,12 @@ static inline void skb_reset_mac_len(struct sk_buff *skb) static inline unsigned char *skb_inner_transport_header(const struct sk_buff *skb) { - return skb->head + skb->inner_transport_header; + return (skb->head + skb->inner_transport_header); } static inline int skb_inner_transport_offset(const struct sk_buff *skb) { - return skb_inner_transport_header(skb) - skb->data; + return (skb_inner_transport_header(skb) - skb->data); } static inline void skb_reset_inner_transport_header(struct sk_buff *skb) @@ -2059,7 +2059,7 @@ static inline void skb_set_inner_transport_header(struct sk_buff *skb, static inline unsigned char *skb_inner_network_header(const struct sk_buff *skb) { - return skb->head + skb->inner_network_header; + return (skb->head + skb->inner_network_header); } static inline void skb_reset_inner_network_header(struct sk_buff *skb) @@ -2076,7 +2076,7 @@ static inline void skb_set_inner_network_header(struct sk_buff *skb, static inline unsigned char *skb_inner_mac_header(const struct sk_buff *skb) { - return skb->head + skb->inner_mac_header; + return (skb->head + skb->inner_mac_header); } static inline void skb_reset_inner_mac_header(struct sk_buff *skb) @@ -2097,7 +2097,7 @@ static inline bool skb_transport_header_was_set(const struct sk_buff *skb) static inline unsigned char *skb_transport_header(const struct sk_buff *skb) { - return skb->head + skb->transport_header; + return (skb->head + skb->transport_header); } static inline void skb_reset_transport_header(struct sk_buff *skb) @@ -2114,7 +2114,7 @@ static inline void skb_set_transport_header(struct sk_buff *skb, static inline unsigned char *skb_network_header(const struct sk_buff *skb) { - return skb->head + skb->network_header; + return (skb->head + skb->network_header); } static inline void skb_reset_network_header(struct sk_buff *skb) @@ -2130,7 +2130,7 @@ static inline void skb_set_network_header(struct sk_buff *skb, const int offset) static inline unsigned char *skb_mac_header(const struct sk_buff *skb) { - return skb->head + skb->mac_header; + return (skb->head + skb->mac_header); } static inline int skb_mac_header_was_set(const struct sk_buff *skb) @@ -2179,37 +2179,37 @@ static inline void skb_mac_header_rebuild(struct sk_buff *skb) static inline int skb_checksum_start_offset(const struct sk_buff *skb) { - return skb->csum_start - skb_headroom(skb); + return (skb->csum_start - skb_headroom(skb)); } static inline unsigned char *skb_checksum_start(const struct sk_buff *skb) { - return skb->head + skb->csum_start; + return (skb->head + skb->csum_start); } static inline int skb_transport_offset(const struct sk_buff *skb) { - return skb_transport_header(skb) - skb->data; + return (skb_transport_header(skb) - skb->data); } static inline u32 skb_network_header_len(const struct sk_buff *skb) { - return skb->transport_header - skb->network_header; + return (skb->transport_header - skb->network_header); } static inline u32 skb_inner_network_header_len(const struct sk_buff *skb) { - return skb->inner_transport_header - skb->inner_network_header; + return (skb->inner_transport_header - skb->inner_network_header); } static inline int skb_network_offset(const struct sk_buff *skb) { - return skb_network_header(skb) - skb->data; + return (skb_network_header(skb) - skb->data); } static inline int skb_inner_network_offset(const struct sk_buff *skb) { - return skb_inner_network_header(skb) - skb->data; + return (skb_inner_network_header(skb) - skb->data); } static inline int pskb_network_may_pull(struct sk_buff *skb, unsigned int len) @@ -2556,7 +2556,7 @@ static inline void skb_frag_unref(struct sk_buff *skb, int f) */ static inline void *skb_frag_address(const skb_frag_t *frag) { - return page_address(skb_frag_page(frag)) + frag->page_offset; + return (page_address(skb_frag_page(frag)) + frag->page_offset); } /** @@ -2572,7 +2572,7 @@ static inline void *skb_frag_address_safe(const skb_frag_t *frag) if (unlikely(!ptr)) return NULL; - return ptr + frag->page_offset; + return (ptr + frag->page_offset); } /** @@ -2647,15 +2647,15 @@ static inline struct sk_buff *pskb_copy_for_clone(struct sk_buff *skb, */ static inline int skb_clone_writable(const struct sk_buff *skb, unsigned int len) { - return !skb_header_cloned(skb) && - skb_headroom(skb) + len <= skb->hdr_len; + return (!skb_header_cloned(skb) && + ((skb_headroom(skb) + len) <= skb->hdr_len)); } static inline int skb_try_make_writable(struct sk_buff *skb, unsigned int write_len) { - return skb_cloned(skb) && !skb_clone_writable(skb, write_len) && - pskb_expand_head(skb, 0, 0, GFP_ATOMIC); + return (skb_cloned(skb) && !skb_clone_writable(skb, write_len) && + pskb_expand_head(skb, 0, 0, GFP_ATOMIC)); } static inline int __skb_cow(struct sk_buff *skb, unsigned int headroom, @@ -2719,7 +2719,7 @@ static inline int skb_padto(struct sk_buff *skb, unsigned int len) unsigned int size = skb->len; if (likely(size >= len)) return 0; - return skb_pad(skb, len - size); + return skb_pad(skb, (len - size)); } /** @@ -2770,8 +2770,8 @@ static inline bool skb_can_coalesce(struct sk_buff *skb, int i, if (i) { const struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[i - 1]; - return page == skb_frag_page(frag) && - off == frag->page_offset + skb_frag_size(frag); + return ((page == skb_frag_page(frag)) && + (off == (frag->page_offset + skb_frag_size(frag)))); } return false; } @@ -2802,8 +2802,8 @@ static inline int skb_linearize(struct sk_buff *skb) */ static inline bool skb_has_shared_frag(const struct sk_buff *skb) { - return skb_is_nonlinear(skb) && - skb_shinfo(skb)->tx_flags & SKBTX_SHARED_FRAG; + return (skb_is_nonlinear(skb) && + skb_shinfo(skb)->tx_flags & SKBTX_SHARED_FRAG); } /** @@ -2913,7 +2913,7 @@ static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len) static inline bool skb_has_frag_list(const struct sk_buff *skb) { - return skb_shinfo(skb)->frag_list != NULL; + return (skb_shinfo(skb)->frag_list != NULL); } static inline void skb_frag_list_init(struct sk_buff *skb) @@ -2980,12 +2980,12 @@ int skb_vlan_push(struct sk_buff *skb, __be16 vlan_proto, u16 vlan_tci); static inline int memcpy_from_msg(void *data, struct msghdr *msg, int len) { - return copy_from_iter(data, len, &msg->msg_iter) == len ? 0 : -EFAULT; + return (copy_from_iter(data, len, &msg->msg_iter) == len) ? 0 : -EFAULT; } static inline int memcpy_to_msg(struct msghdr *msg, void *data, int len) { - return copy_to_iter(data, len, &msg->msg_iter) == len ? 0 : -EFAULT; + return (copy_to_iter(data, len, &msg->msg_iter) == len) ? 0 : -EFAULT; } struct skb_checksum_ops { @@ -3002,8 +3002,8 @@ static inline void * __must_check __skb_header_pointer(const struct sk_buff *skb, int offset, int len, void *data, int hlen, void *buffer) { - if (hlen - offset >= len) - return data + offset; + if ((hlen - offset) >= len) + return (data + offset); if (!skb || skb_copy_bits(skb, offset, buffer, len) < 0) @@ -3380,7 +3380,7 @@ static inline __wsum null_compute_pseudo(struct sk_buff *skb, int proto) static inline bool __skb_checksum_convert_check(struct sk_buff *skb) { - return (skb->ip_summed == CHECKSUM_NONE && + return ((skb->ip_summed == CHECKSUM_NONE) && skb->csum_valid && !skb->csum_bad); } @@ -3560,12 +3560,12 @@ static inline void skb_record_rx_queue(struct sk_buff *skb, u16 rx_queue) static inline u16 skb_get_rx_queue(const struct sk_buff *skb) { - return skb->queue_mapping - 1; + return (skb->queue_mapping - 1); } static inline bool skb_rx_queue_recorded(const struct sk_buff *skb) { - return skb->queue_mapping != 0; + return (skb->queue_mapping != 0); } static inline struct sec_path *skb_sec_path(struct sk_buff *skb) @@ -3752,7 +3752,7 @@ static inline __wsum lco_csum(struct sk_buff *skb) /* Add in checksum of our headers (incl. outer checksum * adjustment filled in by caller) and return result. */ - return csum_partial(l4_hdr, csum_start - l4_hdr, partial); + return csum_partial(l4_hdr, (csum_start - l4_hdr), partial); } #endif /* __KERNEL__ */ -- 2.7.4