]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
firewire: core: minor code refactoring to localize table of gap count
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Tue, 17 Jun 2025 00:43:20 +0000 (09:43 +0900)
committerTakashi Sakamoto <o-takashi@sakamocchi.jp>
Tue, 17 Jun 2025 00:56:42 +0000 (09:56 +0900)
The table for gap count is accessed by a single function. In this case,
it can be localized to the function.

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

index b3e48ca516fe29c2fdcda287a139799a8f0ddca0..aae774e7a5c3eb155e9d7bf51979bad4e058d4dd 100644 (file)
@@ -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;