firewire: core: use helper macro to compare against current jiffies
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Mon, 15 Sep 2025 02:42:32 +0000 (11:42 +0900)
committerTakashi Sakamoto <o-takashi@sakamocchi.jp>
Mon, 15 Sep 2025 02:49:34 +0000 (11:49 +0900)
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 <o-takashi@sakamocchi.jp>
drivers/firewire/core-card.c
drivers/firewire/core-cdev.c
drivers/firewire/core-device.c

index 2541e8b..b5e01a7 100644 (file)
@@ -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) ||
index 9e90c79..1be8f5e 100644 (file)
@@ -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 {
index 7d5821c..457a0da 100644 (file)
@@ -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;