From: Takashi Sakamoto Date: Mon, 15 Sep 2025 02:42:32 +0000 (+0900) Subject: firewire: core: use helper macro to compare against current jiffies X-Git-Tag: v6.18-rc1~159^2~20 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=931383f161c066ac5fda12035540498931739842;p=thirdparty%2Fkernel%2Flinux.git firewire: core: use helper macro to compare against current jiffies The pattern of calling either time_before64() or time_after64() with get_jiffies_64() can be replaced with the corresponding helper macros. Link: https://lore.kernel.org/r/20250915024232.851955-3-o-takashi@sakamocchi.jp Signed-off-by: Takashi Sakamoto --- diff --git a/drivers/firewire/core-card.c b/drivers/firewire/core-card.c index 2541e8bb4b75a..b5e01a7111457 100644 --- a/drivers/firewire/core-card.c +++ b/drivers/firewire/core-card.c @@ -240,7 +240,7 @@ static void br_work(struct work_struct *work) /* Delay for 2s after last reset per IEEE 1394 clause 8.2.1. */ if (card->reset_jiffies != 0 && - time_before64(get_jiffies_64(), card->reset_jiffies + secs_to_jiffies(2))) { + time_is_after_jiffies64(card->reset_jiffies + secs_to_jiffies(2))) { trace_bus_reset_postpone(card->index, card->generation, card->br_short); if (!queue_delayed_work(fw_workqueue, &card->br_work, secs_to_jiffies(2))) @@ -308,7 +308,7 @@ static void bm_work(struct work_struct *work) irm_id = card->irm_node->node_id; local_id = card->local_node->node_id; - grace = time_after64(get_jiffies_64(), card->reset_jiffies + msecs_to_jiffies(125)); + grace = time_is_before_jiffies64(card->reset_jiffies + msecs_to_jiffies(125)); if ((is_next_generation(generation, card->bm_generation) && !card->bm_abdicate) || diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c index 9e90c79becdb5..1be8f5eb3e17d 100644 --- a/drivers/firewire/core-cdev.c +++ b/drivers/firewire/core-cdev.c @@ -1324,7 +1324,7 @@ static void iso_resource_work(struct work_struct *work) todo = r->todo; // Allow 1000ms grace period for other reallocations. if (todo == ISO_RES_ALLOC && - time_before64(get_jiffies_64(), client->device->card->reset_jiffies + secs_to_jiffies(1))) { + time_is_after_jiffies64(client->device->card->reset_jiffies + secs_to_jiffies(1))) { schedule_iso_resource(r, msecs_to_jiffies(333)); skip = true; } else { diff --git a/drivers/firewire/core-device.c b/drivers/firewire/core-device.c index 7d5821cd9b371..457a0da024a76 100644 --- a/drivers/firewire/core-device.c +++ b/drivers/firewire/core-device.c @@ -855,8 +855,7 @@ static void fw_device_shutdown(struct work_struct *work) { struct fw_device *device = from_work(device, work, work.work); - if (time_before64(get_jiffies_64(), - device->card->reset_jiffies + SHUTDOWN_DELAY) + if (time_is_after_jiffies64(device->card->reset_jiffies + SHUTDOWN_DELAY) && !list_empty(&device->card->link)) { fw_schedule_device_work(device, SHUTDOWN_DELAY); return;