From: Takashi Sakamoto Date: Wed, 20 May 2026 13:08:38 +0000 (+0900) Subject: firewire: core: minor code refactoring for case-dependent parameters of iso resources... X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7cc812e634bdea9958606eaa9d5ba3e5ec52e6b7;p=thirdparty%2Fkernel%2Fstable.git firewire: core: minor code refactoring for case-dependent parameters of iso resources management 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 --- diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c index c166e7617d2a..c669c9e42d34 100644 --- a/drivers/firewire/core-cdev.c +++ b/drivers/firewire/core-cdev.c @@ -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,