]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
firewire: core: minor code refactoring for case-dependent parameters of iso resources...
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Wed, 20 May 2026 13:08:38 +0000 (22:08 +0900)
committerTakashi Sakamoto <o-takashi@sakamocchi.jp>
Thu, 21 May 2026 09:43:25 +0000 (18:43 +0900)
The generation parameter is specific to the auto case of iso resources
management, while it is in the common parameter structure.

Move the generation member to the structure specific to auto case.

Link: https://lore.kernel.org/r/20260520130840.629934-2-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
drivers/firewire/core-cdev.c

index c166e7617d2abf40d62e6eb9417d61c13d5efe91..c669c9e42d34d2207f10833e8ec41344fd3b0a03 100644 (file)
@@ -129,7 +129,6 @@ struct descriptor_resource {
 };
 
 struct iso_resource_params {
-       int generation;
        u64 channels;
        s32 bandwidth;
 };
@@ -144,6 +143,7 @@ struct iso_resource_auto {
                ISO_RES_AUTO_REALLOC,
                ISO_RES_AUTO_DEALLOC,
        } todo;
+       int generation;
        struct iso_resource_params params;
        struct iso_resource_event *e_alloc, *e_dealloc;
 };
@@ -1316,7 +1316,6 @@ static int fill_iso_resource_params(struct iso_resource_params *params,
            request->bandwidth > BANDWIDTH_AVAILABLE_INITIAL)
                return -EINVAL;
 
-       params->generation = -1;
        params->channels = request->channels;
        params->bandwidth = request->bandwidth;
 
@@ -1336,8 +1335,8 @@ static void iso_resource_auto_work(struct work_struct *work)
        scoped_guard(spinlock_irq, &client->lock) {
                reset_jiffies = client->device->card->reset_jiffies;
                current_generation = client->device->generation;
-               resource_generation = r->params.generation;
-               r->params.generation = current_generation;
+               resource_generation = r->generation;
+               r->generation = current_generation;
                todo = r->todo;
        }
 
@@ -1495,7 +1494,6 @@ static void iso_resource_once_work(struct work_struct *work)
        scoped_guard(spinlock_irq, &client->lock)
                generation = client->device->generation;
 
-       r->params.generation = generation;
        bandwidth = r->params.bandwidth;
 
        fw_iso_resource_manage(client->device->card, generation, r->params.channels, &channel,