aboutsummaryrefslogtreecommitdiffstats
path: root/net/rxrpc
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2011-12-19 08:56:45 -0500
committerDavid S. Miller <davem@davemloft.net>2011-12-19 22:27:29 -0500
commit3db1cd5c05f35fb43eb134df6f321de4e63141f2 (patch)
tree960039f3f4f0a524b37e94434624da154859bc64 /net/rxrpc
parenta8e510f682fe6d7671c11887e07c55f86caaf3c1 (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/rxrpc')
-rw-r--r--net/rxrpc/ar-ack.c14
-rw-r--r--net/rxrpc/ar-output.c4
2 files changed, 9 insertions, 9 deletions
diff --git a/net/rxrpc/ar-ack.c b/net/rxrpc/ar-ack.c
index f99cfce7ca97..c3126e864f3c 100644
--- a/net/rxrpc/ar-ack.c
+++ b/net/rxrpc/ar-ack.c
@@ -195,7 +195,7 @@ static void rxrpc_resend(struct rxrpc_call *call)
195 sp = rxrpc_skb(txb); 195 sp = rxrpc_skb(txb);
196 196
197 if (sp->need_resend) { 197 if (sp->need_resend) {
198 sp->need_resend = 0; 198 sp->need_resend = false;
199 199
200 /* each Tx packet has a new serial number */ 200 /* each Tx packet has a new serial number */
201 sp->hdr.serial = 201 sp->hdr.serial =
@@ -216,7 +216,7 @@ static void rxrpc_resend(struct rxrpc_call *call)
216 } 216 }
217 217
218 if (time_after_eq(jiffies + 1, sp->resend_at)) { 218 if (time_after_eq(jiffies + 1, sp->resend_at)) {
219 sp->need_resend = 1; 219 sp->need_resend = true;
220 resend |= 1; 220 resend |= 1;
221 } else if (resend & 2) { 221 } else if (resend & 2) {
222 if (time_before(sp->resend_at, resend_at)) 222 if (time_before(sp->resend_at, resend_at))
@@ -265,7 +265,7 @@ static void rxrpc_resend_timer(struct rxrpc_call *call)
265 if (sp->need_resend) { 265 if (sp->need_resend) {
266 ; 266 ;
267 } else if (time_after_eq(jiffies + 1, sp->resend_at)) { 267 } else if (time_after_eq(jiffies + 1, sp->resend_at)) {
268 sp->need_resend = 1; 268 sp->need_resend = true;
269 resend |= 1; 269 resend |= 1;
270 } else if (resend & 2) { 270 } else if (resend & 2) {
271 if (time_before(sp->resend_at, resend_at)) 271 if (time_before(sp->resend_at, resend_at))
@@ -314,11 +314,11 @@ static int rxrpc_process_soft_ACKs(struct rxrpc_call *call,
314 314
315 switch (sacks[loop]) { 315 switch (sacks[loop]) {
316 case RXRPC_ACK_TYPE_ACK: 316 case RXRPC_ACK_TYPE_ACK:
317 sp->need_resend = 0; 317 sp->need_resend = false;
318 *p_txb |= 1; 318 *p_txb |= 1;
319 break; 319 break;
320 case RXRPC_ACK_TYPE_NACK: 320 case RXRPC_ACK_TYPE_NACK:
321 sp->need_resend = 1; 321 sp->need_resend = true;
322 *p_txb &= ~1; 322 *p_txb &= ~1;
323 resend = 1; 323 resend = 1;
324 break; 324 break;
@@ -344,13 +344,13 @@ static int rxrpc_process_soft_ACKs(struct rxrpc_call *call,
344 344
345 if (*p_txb & 1) { 345 if (*p_txb & 1) {
346 /* packet must have been discarded */ 346 /* packet must have been discarded */
347 sp->need_resend = 1; 347 sp->need_resend = true;
348 *p_txb &= ~1; 348 *p_txb &= ~1;
349 resend |= 1; 349 resend |= 1;
350 } else if (sp->need_resend) { 350 } else if (sp->need_resend) {
351 ; 351 ;
352 } else if (time_after_eq(jiffies + 1, sp->resend_at)) { 352 } else if (time_after_eq(jiffies + 1, sp->resend_at)) {
353 sp->need_resend = 1; 353 sp->need_resend = true;
354 resend |= 1; 354 resend |= 1;
355 } else if (resend & 2) { 355 } else if (resend & 2) {
356 if (time_before(sp->resend_at, resend_at)) 356 if (time_before(sp->resend_at, resend_at))
diff --git a/net/rxrpc/ar-output.c b/net/rxrpc/ar-output.c
index 338d793c7113..16ae88762d00 100644
--- a/net/rxrpc/ar-output.c
+++ b/net/rxrpc/ar-output.c
@@ -486,7 +486,7 @@ static void rxrpc_queue_packet(struct rxrpc_call *call, struct sk_buff *skb,
486 _proto("Tx DATA %%%u { #%u }", 486 _proto("Tx DATA %%%u { #%u }",
487 ntohl(sp->hdr.serial), ntohl(sp->hdr.seq)); 487 ntohl(sp->hdr.serial), ntohl(sp->hdr.seq));
488 488
489 sp->need_resend = 0; 489 sp->need_resend = false;
490 sp->resend_at = jiffies + rxrpc_resend_timeout * HZ; 490 sp->resend_at = jiffies + rxrpc_resend_timeout * HZ;
491 if (!test_and_set_bit(RXRPC_CALL_RUN_RTIMER, &call->flags)) { 491 if (!test_and_set_bit(RXRPC_CALL_RUN_RTIMER, &call->flags)) {
492 _debug("run timer"); 492 _debug("run timer");
@@ -508,7 +508,7 @@ static void rxrpc_queue_packet(struct rxrpc_call *call, struct sk_buff *skb,
508 508
509 if (ret < 0) { 509 if (ret < 0) {
510 _debug("need instant resend %d", ret); 510 _debug("need instant resend %d", ret);
511 sp->need_resend = 1; 511 sp->need_resend = true;
512 rxrpc_instant_resend(call); 512 rxrpc_instant_resend(call);
513 } 513 }
514 514