diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2011-12-19 08:56:45 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-12-19 22:27:29 -0500 |
commit | 3db1cd5c05f35fb43eb134df6f321de4e63141f2 (patch) | |
tree | 960039f3f4f0a524b37e94434624da154859bc64 /net/dccp | |
parent | a8e510f682fe6d7671c11887e07c55f86caaf3c1 (diff) |
net: fix assignment of 0/1 to bool variables.
DaveM said:
Please, this kind of stuff rots forever and not using bool properly
drives me crazy.
Joe Perches <joe@perches.com> gave me the spatch script:
@@
bool b;
@@
-b = 0
+b = false
@@
bool b;
@@
-b = 1
+b = true
I merely installed coccinelle, read the documentation and took credit.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp')
-rw-r--r-- | net/dccp/feat.c | 16 | ||||
-rw-r--r-- | net/dccp/options.c | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/net/dccp/feat.c b/net/dccp/feat.c index 23cea0ee3101..78a2ad70e1b0 100644 --- a/net/dccp/feat.c +++ b/net/dccp/feat.c | |||
@@ -490,8 +490,8 @@ static int dccp_feat_push_change(struct list_head *fn_list, u8 feat, u8 local, | |||
490 | new->feat_num = feat; | 490 | new->feat_num = feat; |
491 | new->is_local = local; | 491 | new->is_local = local; |
492 | new->state = FEAT_INITIALISING; | 492 | new->state = FEAT_INITIALISING; |
493 | new->needs_confirm = 0; | 493 | new->needs_confirm = false; |
494 | new->empty_confirm = 0; | 494 | new->empty_confirm = false; |
495 | new->val = *fval; | 495 | new->val = *fval; |
496 | new->needs_mandatory = mandatory; | 496 | new->needs_mandatory = mandatory; |
497 | 497 | ||
@@ -517,12 +517,12 @@ static int dccp_feat_push_confirm(struct list_head *fn_list, u8 feat, u8 local, | |||
517 | new->feat_num = feat; | 517 | new->feat_num = feat; |
518 | new->is_local = local; | 518 | new->is_local = local; |
519 | new->state = FEAT_STABLE; /* transition in 6.6.2 */ | 519 | new->state = FEAT_STABLE; /* transition in 6.6.2 */ |
520 | new->needs_confirm = 1; | 520 | new->needs_confirm = true; |
521 | new->empty_confirm = (fval == NULL); | 521 | new->empty_confirm = (fval == NULL); |
522 | new->val.nn = 0; /* zeroes the whole structure */ | 522 | new->val.nn = 0; /* zeroes the whole structure */ |
523 | if (!new->empty_confirm) | 523 | if (!new->empty_confirm) |
524 | new->val = *fval; | 524 | new->val = *fval; |
525 | new->needs_mandatory = 0; | 525 | new->needs_mandatory = false; |
526 | 526 | ||
527 | return 0; | 527 | return 0; |
528 | } | 528 | } |
@@ -1155,7 +1155,7 @@ static u8 dccp_feat_change_recv(struct list_head *fn, u8 is_mandatory, u8 opt, | |||
1155 | } | 1155 | } |
1156 | 1156 | ||
1157 | if (dccp_feat_reconcile(&entry->val, val, len, server, true)) { | 1157 | if (dccp_feat_reconcile(&entry->val, val, len, server, true)) { |
1158 | entry->empty_confirm = 0; | 1158 | entry->empty_confirm = false; |
1159 | } else if (is_mandatory) { | 1159 | } else if (is_mandatory) { |
1160 | return DCCP_RESET_CODE_MANDATORY_ERROR; | 1160 | return DCCP_RESET_CODE_MANDATORY_ERROR; |
1161 | } else if (entry->state == FEAT_INITIALISING) { | 1161 | } else if (entry->state == FEAT_INITIALISING) { |
@@ -1171,10 +1171,10 @@ static u8 dccp_feat_change_recv(struct list_head *fn, u8 is_mandatory, u8 opt, | |||
1171 | defval = dccp_feat_default_value(feat); | 1171 | defval = dccp_feat_default_value(feat); |
1172 | if (!dccp_feat_reconcile(&entry->val, &defval, 1, server, true)) | 1172 | if (!dccp_feat_reconcile(&entry->val, &defval, 1, server, true)) |
1173 | return DCCP_RESET_CODE_OPTION_ERROR; | 1173 | return DCCP_RESET_CODE_OPTION_ERROR; |
1174 | entry->empty_confirm = 1; | 1174 | entry->empty_confirm = true; |
1175 | } | 1175 | } |
1176 | entry->needs_confirm = 1; | 1176 | entry->needs_confirm = true; |
1177 | entry->needs_mandatory = 0; | 1177 | entry->needs_mandatory = false; |
1178 | entry->state = FEAT_STABLE; | 1178 | entry->state = FEAT_STABLE; |
1179 | return 0; | 1179 | return 0; |
1180 | 1180 | ||
diff --git a/net/dccp/options.c b/net/dccp/options.c index 4b2ab657ac8e..68fa6b7a3e01 100644 --- a/net/dccp/options.c +++ b/net/dccp/options.c | |||
@@ -544,7 +544,7 @@ int dccp_insert_fn_opt(struct sk_buff *skb, u8 type, u8 feat, | |||
544 | } | 544 | } |
545 | 545 | ||
546 | if (unlikely(val == NULL || len == 0)) | 546 | if (unlikely(val == NULL || len == 0)) |
547 | len = repeat_first = 0; | 547 | len = repeat_first = false; |
548 | tot_len = 3 + repeat_first + len; | 548 | tot_len = 3 + repeat_first + len; |
549 | 549 | ||
550 | if (DCCP_SKB_CB(skb)->dccpd_opt_len + tot_len > DCCP_MAX_OPT_LEN) { | 550 | if (DCCP_SKB_CB(skb)->dccpd_opt_len + tot_len > DCCP_MAX_OPT_LEN) { |