diff options
author | Antonio Quartulli <ordex@autistici.org> | 2013-01-15 07:17:19 -0500 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2013-03-13 17:53:48 -0400 |
commit | c1d07431b9f7fe3c5eb372f3a35d7cd7a18c3b15 (patch) | |
tree | f50b0439743d4c59e030902e2f5a4d8c4e198ba0 /net/batman-adv/unicast.c | |
parent | f86ce0ad107bc0e33ead8ba2498fc22dfb747479 (diff) |
batman-adv: don't use !! in bool conversion
In C standard any expression different from 0 will be converted to
'true' when casting to bool (whatever is the length of the value).
Therefore all the "!!" conversions can be removed.
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Diffstat (limited to 'net/batman-adv/unicast.c')
-rw-r--r-- | net/batman-adv/unicast.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/batman-adv/unicast.c b/net/batman-adv/unicast.c index 50e079f00be6..0bb3b5982f94 100644 --- a/net/batman-adv/unicast.c +++ b/net/batman-adv/unicast.c | |||
@@ -122,7 +122,7 @@ batadv_frag_search_packet(struct list_head *head, | |||
122 | { | 122 | { |
123 | struct batadv_frag_packet_list_entry *tfp; | 123 | struct batadv_frag_packet_list_entry *tfp; |
124 | struct batadv_unicast_frag_packet *tmp_up = NULL; | 124 | struct batadv_unicast_frag_packet *tmp_up = NULL; |
125 | int is_head_tmp, is_head; | 125 | bool is_head_tmp, is_head; |
126 | uint16_t search_seqno; | 126 | uint16_t search_seqno; |
127 | 127 | ||
128 | if (up->flags & BATADV_UNI_FRAG_HEAD) | 128 | if (up->flags & BATADV_UNI_FRAG_HEAD) |
@@ -130,7 +130,7 @@ batadv_frag_search_packet(struct list_head *head, | |||
130 | else | 130 | else |
131 | search_seqno = ntohs(up->seqno)-1; | 131 | search_seqno = ntohs(up->seqno)-1; |
132 | 132 | ||
133 | is_head = !!(up->flags & BATADV_UNI_FRAG_HEAD); | 133 | is_head = up->flags & BATADV_UNI_FRAG_HEAD; |
134 | 134 | ||
135 | list_for_each_entry(tfp, head, list) { | 135 | list_for_each_entry(tfp, head, list) { |
136 | if (!tfp->skb) | 136 | if (!tfp->skb) |
@@ -142,7 +142,7 @@ batadv_frag_search_packet(struct list_head *head, | |||
142 | tmp_up = (struct batadv_unicast_frag_packet *)tfp->skb->data; | 142 | tmp_up = (struct batadv_unicast_frag_packet *)tfp->skb->data; |
143 | 143 | ||
144 | if (tfp->seqno == search_seqno) { | 144 | if (tfp->seqno == search_seqno) { |
145 | is_head_tmp = !!(tmp_up->flags & BATADV_UNI_FRAG_HEAD); | 145 | is_head_tmp = tmp_up->flags & BATADV_UNI_FRAG_HEAD; |
146 | if (is_head_tmp != is_head) | 146 | if (is_head_tmp != is_head) |
147 | return tfp; | 147 | return tfp; |
148 | else | 148 | else |