Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

firewire: core: use macro expression for gap count mismatch

The gap_count field is assigned to zero when mismatch is detected. In such
case, the macro expression is preferable since it is easy to understand
the situation.

This commit applies the idea.

Link: https://lore.kernel.org/r/20250913105737.778038-2-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>

+5 -2
+1 -1
drivers/firewire/core-card.c
··· 425 425 */ 426 426 card->bm_generation = generation; 427 427 428 - if (card->gap_count == 0) { 428 + if (card->gap_count == GAP_COUNT_MISMATCHED) { 429 429 /* 430 430 * If self IDs have inconsistent gap counts, do a 431 431 * bus reset ASAP. The config rom read might never
+1 -1
drivers/firewire/core-topology.c
··· 241 241 // If PHYs report different gap counts, set an invalid count which will force a gap 242 242 // count reconfiguration and a reset. 243 243 if (phy_packet_self_id_zero_get_gap_count(self_id_sequence[0]) != gap_count) 244 - gap_count = 0; 244 + gap_count = GAP_COUNT_MISMATCHED; 245 245 246 246 update_hop_count(node); 247 247
+3
drivers/firewire/core.h
··· 27 27 28 28 /* -card */ 29 29 30 + // This is the arbitrary value we use to indicate a mismatched gap count. 31 + #define GAP_COUNT_MISMATCHED 0 32 + 30 33 extern __printf(2, 3) 31 34 void fw_err(const struct fw_card *card, const char *fmt, ...); 32 35 extern __printf(2, 3)