aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2008-03-11 16:22:26 -0400
committerStefan Richter <stefanr@s5r6.in-berlin.de>2008-04-18 11:55:34 -0400
commit43286568adb3ccd4b2f1d0cb7393c355f03e4f39 (patch)
tree17316d441def72d84e94d59df2dd83c88e6b0a16 /drivers/firewire
parentad3c0fe8b8d1656a56ce2ef05ed5ccba790b4566 (diff)
firewire: fw-ohci: untangle a mixed unsigned/signed expression
and make another expression more readable. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire')
-rw-r--r--drivers/firewire/fw-ohci.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index b564b1aae52f..533788f227dc 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -494,6 +494,7 @@ static __le32 *handle_ar_packet(struct ar_context *ctx, __le32 *buffer)
494 struct fw_ohci *ohci = ctx->ohci; 494 struct fw_ohci *ohci = ctx->ohci;
495 struct fw_packet p; 495 struct fw_packet p;
496 u32 status, length, tcode; 496 u32 status, length, tcode;
497 int evt;
497 498
498 p.header[0] = cond_le32_to_cpu(buffer[0]); 499 p.header[0] = cond_le32_to_cpu(buffer[0]);
499 p.header[1] = cond_le32_to_cpu(buffer[1]); 500 p.header[1] = cond_le32_to_cpu(buffer[1]);
@@ -536,13 +537,14 @@ static __le32 *handle_ar_packet(struct ar_context *ctx, __le32 *buffer)
536 /* FIXME: What to do about evt_* errors? */ 537 /* FIXME: What to do about evt_* errors? */
537 length = (p.header_length + p.payload_length + 3) / 4; 538 length = (p.header_length + p.payload_length + 3) / 4;
538 status = cond_le32_to_cpu(buffer[length]); 539 status = cond_le32_to_cpu(buffer[length]);
540 evt = (status >> 16) & 0x1f;
539 541
540 p.ack = ((status >> 16) & 0x1f) - 16; 542 p.ack = evt - 16;
541 p.speed = (status >> 21) & 0x7; 543 p.speed = (status >> 21) & 0x7;
542 p.timestamp = status & 0xffff; 544 p.timestamp = status & 0xffff;
543 p.generation = ohci->request_generation; 545 p.generation = ohci->request_generation;
544 546
545 log_ar_at_event('R', p.speed, p.header, status >> 16 & 0x1f); 547 log_ar_at_event('R', p.speed, p.header, evt);
546 548
547 /* 549 /*
548 * The OHCI bus reset handler synthesizes a phy packet with 550 * The OHCI bus reset handler synthesizes a phy packet with
@@ -554,7 +556,7 @@ static __le32 *handle_ar_packet(struct ar_context *ctx, __le32 *buffer)
554 * request. 556 * request.
555 */ 557 */
556 558
557 if (p.ack + 16 == 0x09) 559 if (evt == OHCI1394_evt_bus_reset)
558 ohci->request_generation = (p.header[2] >> 16) & 0xff; 560 ohci->request_generation = (p.header[2] >> 16) & 0xff;
559 else if (ctx == &ohci->ar_request_ctx) 561 else if (ctx == &ohci->ar_request_ctx)
560 fw_core_handle_request(&ohci->card, &p); 562 fw_core_handle_request(&ohci->card, &p);