mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
firewire: core: remove unnecessary branch for timestamping when cancelling transaction request packets
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. Link: https://lore.kernel.org/r/20260927044407.65497-2-o-takashi@sakamocchi.jp Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
This commit is contained in:
parent
981a9c4feb
commit
87a48a22b3
|
|
@ -139,21 +139,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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user