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

firewire: core/ohci: minor refactoring for computation of configuration ROM size

The size of space for configuration ROM is defined by IEEE 1212. The start
and end offsets are available as some macros in UAPI header.

This commit uses these macros to compute the size.

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

+3 -2
+2 -1
drivers/firewire/core-device.c
··· 564 564 return rcode; 565 565 } 566 566 567 - #define MAX_CONFIG_ROM_SIZE 256 567 + // By quadlet unit. 568 + #define MAX_CONFIG_ROM_SIZE ((CSR_CONFIG_ROM_END - CSR_CONFIG_ROM) / sizeof(u32)) 568 569 569 570 /* 570 571 * Read the bus info block, perform a speed probe, and read all of the rest of
+1 -1
drivers/firewire/ohci.c
··· 174 174 u8 tags; 175 175 }; 176 176 177 - #define CONFIG_ROM_SIZE 1024 177 + #define CONFIG_ROM_SIZE (CSR_CONFIG_ROM_END - CSR_CONFIG_ROM) 178 178 179 179 struct fw_ohci { 180 180 struct fw_card card;