[PATCH] firewire: core: minor code refactoring to localize table of gap count

Takashi Sakamoto posted 1 patch 3 months, 3 weeks ago
drivers/firewire/core-card.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
[PATCH] firewire: core: minor code refactoring to localize table of gap count
Posted by Takashi Sakamoto 3 months, 3 weeks ago
The table for gap count is accessed by a single function. In this case,
it can be localized to the function.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
---
 drivers/firewire/core-card.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/firewire/core-card.c b/drivers/firewire/core-card.c
index b3e48ca516fe..aae774e7a5c3 100644
--- a/drivers/firewire/core-card.c
+++ b/drivers/firewire/core-card.c
@@ -273,10 +273,6 @@ static void allocate_broadcast_channel(struct fw_card *card, int generation)
 			      fw_device_set_broadcast_channel);
 }
 
-static const char gap_count_table[] = {
-	63, 5, 7, 8, 10, 13, 16, 18, 21, 24, 26, 29, 32, 35, 37, 40
-};
-
 void fw_schedule_bm_work(struct fw_card *card, unsigned long delay)
 {
 	fw_card_get(card);
@@ -286,6 +282,9 @@ void fw_schedule_bm_work(struct fw_card *card, unsigned long delay)
 
 static void bm_work(struct work_struct *work)
 {
+	static const char gap_count_table[] = {
+		63, 5, 7, 8, 10, 13, 16, 18, 21, 24, 26, 29, 32, 35, 37, 40
+	};
 	struct fw_card *card = from_work(card, work, bm_work.work);
 	struct fw_device *root_device, *irm_device;
 	struct fw_node *root_node;

base-commit: aef6bcc0f278eba408751f8b3e0beae992e9faec
-- 
2.48.1
Re: [PATCH] firewire: core: minor code refactoring to localize table of gap count
Posted by Takashi Sakamoto 3 months, 3 weeks ago
On Tue, Jun 17, 2025 at 09:43:20AM +0900, Takashi Sakamoto wrote:
> The table for gap count is accessed by a single function. In this case,
> it can be localized to the function.
> 
> Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
> ---
>  drivers/firewire/core-card.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)

Applied to for-next branch.


Thanks

Takashi Sakamoto