Skip to content

Commit 2a0b46a

Browse files
committed
firewire: ohci: replace hard-coded values with common macros
In the helper function for logging in 1394 ohci driver includes the hard-coded variables for transaction code. They can be replaced with the enumerations in UAPI header. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Sakamoto <[email protected]>
1 parent 4af4361 commit 2a0b46a

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

drivers/firewire/ohci.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -533,11 +533,17 @@ static void log_ar_at_event(struct fw_ohci *ohci,
533533
}
534534

535535
switch (tcode) {
536-
case 0x0: case 0x6: case 0x8:
536+
case TCODE_WRITE_QUADLET_REQUEST:
537+
case TCODE_READ_QUADLET_RESPONSE:
538+
case TCODE_CYCLE_START:
537539
snprintf(specific, sizeof(specific), " = %08x",
538540
be32_to_cpu((__force __be32)header[3]));
539541
break;
540-
case 0x1: case 0x5: case 0x7: case 0x9: case 0xb:
542+
case TCODE_WRITE_BLOCK_REQUEST:
543+
case TCODE_READ_BLOCK_REQUEST:
544+
case TCODE_READ_BLOCK_RESPONSE:
545+
case TCODE_LOCK_REQUEST:
546+
case TCODE_LOCK_RESPONSE:
541547
snprintf(specific, sizeof(specific), " %x,%x",
542548
async_header_get_data_length(header),
543549
async_header_get_extended_tcode(header));
@@ -547,15 +553,19 @@ static void log_ar_at_event(struct fw_ohci *ohci,
547553
}
548554

549555
switch (tcode) {
550-
case 0xa:
556+
case TCODE_STREAM_DATA:
551557
ohci_notice(ohci, "A%c %s, %s\n",
552558
dir, evts[evt], tcodes[tcode]);
553559
break;
554560
case 0xe:
555561
ohci_notice(ohci, "A%c %s, PHY %08x %08x\n",
556562
dir, evts[evt], header[1], header[2]);
557563
break;
558-
case 0x0: case 0x1: case 0x4: case 0x5: case 0x9:
564+
case TCODE_WRITE_QUADLET_REQUEST:
565+
case TCODE_WRITE_BLOCK_REQUEST:
566+
case TCODE_READ_QUADLET_REQUEST:
567+
case TCODE_READ_BLOCK_REQUEST:
568+
case TCODE_LOCK_REQUEST:
559569
ohci_notice(ohci,
560570
"A%c spd %x tl %02x, %04x -> %04x, %s, %s, %012llx%s\n",
561571
dir, speed, async_header_get_tlabel(header),

0 commit comments

Comments
 (0)