[PATCH 1/2] firewire: core: remove unnecessary branch for timestamping when cancelling transaction request packets
From: Takashi Sakamoto
Date: Sun Sep 27 2026 - 00:44:27 EST
When fw_card_driver.cancel_packet() returns a non-zero value, the request
subaction of the transaction has already finished. It means that the
packet for the request subaction has already received an ack code and a
timestamp, so there is no need to check them.
Remove the unnecessary branch for the ack code and timestamp.
Signed-off-by: Takashi Sakamoto <o-takashi@xxxxxxxxxxxxx>
---
drivers/firewire/core-transaction.c | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-transaction.c
index 8ef04d84011b..1e4c104c7e91 100644
--- a/drivers/firewire/core-transaction.c
+++ b/drivers/firewire/core-transaction.c
@@ -135,21 +135,16 @@ int fw_cancel_transaction(struct fw_card *card,
if (card->driver->cancel_packet(card, &transaction->packet) == 0)
return 0;
+ u32 curr_cycle_time = 0;
+
+ // Timestamping on behalf of hardware.
+ (void)fw_card_read_cycle_time(card, &curr_cycle_time);
+ tstamp = cycle_time_to_ohci_tstamp(curr_cycle_time);
+
/*
* If the request packet has already been sent, we need to see
* if the transaction is still pending and remove it in that case.
*/
-
- if (transaction->packet.ack == 0) {
- // The timestamp is reused since it was just read now.
- tstamp = transaction->packet.timestamp;
- } else {
- u32 curr_cycle_time = 0;
-
- (void)fw_card_read_cycle_time(card, &curr_cycle_time);
- tstamp = cycle_time_to_ohci_tstamp(curr_cycle_time);
- }
-
return close_transaction(transaction, card, RCODE_CANCELLED, tstamp);
}
EXPORT_SYMBOL(fw_cancel_transaction);
--
2.53.0