Skip to content

Commit e8b89bc

Browse files
committed
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/[email protected] Signed-off-by: Takashi Sakamoto <[email protected]>
1 parent d4dcb33 commit e8b89bc

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

drivers/firewire/core-device.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,8 @@ static int read_rom(struct fw_device *device,
564564
return rcode;
565565
}
566566

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))
568569

569570
/*
570571
* Read the bus info block, perform a speed probe, and read all of the rest of

drivers/firewire/ohci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ struct iso_context {
174174
u8 tags;
175175
};
176176

177-
#define CONFIG_ROM_SIZE 1024
177+
#define CONFIG_ROM_SIZE (CSR_CONFIG_ROM_END - CSR_CONFIG_ROM)
178178

179179
struct fw_ohci {
180180
struct fw_card card;

0 commit comments

Comments
 (0)