diff options
| author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2024-08-14 22:12:22 +0900 |
|---|---|---|
| committer | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2024-08-14 22:12:22 +0900 |
| commit | e8b89bc158199b60f3ae6c655ced4461c42d650b (patch) | |
| tree | 9a71a19aab4d7599c7c24ffa9f4c82d92b7819ef /drivers/firewire/core-device.c | |
| parent | d4dcb339739e84bc1de335b567ee24f4f89fc19a (diff) | |
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>
Diffstat (limited to 'drivers/firewire/core-device.c')
| -rw-r--r-- | drivers/firewire/core-device.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/firewire/core-device.c b/drivers/firewire/core-device.c index 32ac0f115793..f71e118ef60a 100644 --- a/drivers/firewire/core-device.c +++ b/drivers/firewire/core-device.c @@ -564,7 +564,8 @@ static int read_rom(struct fw_device *device, return rcode; } -#define MAX_CONFIG_ROM_SIZE 256 +// By quadlet unit. +#define MAX_CONFIG_ROM_SIZE ((CSR_CONFIG_ROM_END - CSR_CONFIG_ROM) / sizeof(u32)) /* * Read the bus info block, perform a speed probe, and read all of the rest of |
