Thread: [PATCH 0/3] firewire: core/ohci: minor code refactoring
Brought to you by:
aeb,
bencollins
From: Takashi S. <o-t...@sa...> - 2024-08-14 13:12:34
|
Hi, This series of changes include minor code refactoring in core function and 1394 OHCI driver. Takashi Sakamoto (3): firewire: ohci: use helper macro for compiler aligned attribute firewire: ohci: remove unused wrapper macro for dev_info() firewire: core/ohci: minor refactoring for computation of configuration ROM size drivers/firewire/core-device.c | 3 ++- drivers/firewire/ohci.c | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) -- 2.43.0 |
From: Takashi S. <o-t...@sa...> - 2024-08-14 13:12:40
|
The __aligned() macro has been available since v4.19 kernel by a commit 815f0ddb346c ("include/linux/compiler*.h: make compiler-*.h mutually exclusive"). This commit replaces with the macro. Signed-off-by: Takashi Sakamoto <o-t...@sa...> --- drivers/firewire/ohci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index e1d24e0ec991..198c96d75155 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c @@ -77,7 +77,7 @@ struct descriptor { __le32 branch_address; __le16 res_count; __le16 transfer_status; -} __attribute__((aligned(16))); +} __aligned(16); #define CONTROL_SET(regs) (regs) #define CONTROL_CLEAR(regs) ((regs) + 4) -- 2.43.0 |
From: Takashi S. <o-t...@sa...> - 2024-08-14 13:12:41
|
The ohci_info() macro is a thin wrapper of dev_info(), while it is never used. Signed-off-by: Takashi Sakamoto <o-t...@sa...> --- drivers/firewire/ohci.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index 198c96d75155..979f1e1f2d16 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c @@ -50,7 +50,6 @@ static u32 cond_le32_to_cpu(__le32 value, bool has_be_header_quirk); #define CREATE_TRACE_POINTS #include <trace/events/firewire_ohci.h> -#define ohci_info(ohci, f, args...) dev_info(ohci->card.device, f, ##args) #define ohci_notice(ohci, f, args...) dev_notice(ohci->card.device, f, ##args) #define ohci_err(ohci, f, args...) dev_err(ohci->card.device, f, ##args) -- 2.43.0 |
From: Takashi S. <o-t...@sa...> - 2024-08-14 13:12:43
|
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. Signed-off-by: Takashi Sakamoto <o-t...@sa...> --- drivers/firewire/core-device.c | 3 ++- drivers/firewire/ohci.c | 2 +- 2 files changed, 3 insertions(+), 2 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 diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index 979f1e1f2d16..53132eae37fe 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c @@ -174,7 +174,7 @@ struct iso_context { u8 tags; }; -#define CONFIG_ROM_SIZE 1024 +#define CONFIG_ROM_SIZE (CSR_CONFIG_ROM_END - CSR_CONFIG_ROM) struct fw_ohci { struct fw_card card; -- 2.43.0 |
From: Takashi S. <o-t...@sa...> - 2024-08-14 23:46:51
|
On Wed, Aug 14, 2024 at 10:12:19PM +0900, Takashi Sakamoto wrote: > Hi, > > This series of changes include minor code refactoring in core function > and 1394 OHCI driver. > > > Takashi Sakamoto (3): > firewire: ohci: use helper macro for compiler aligned attribute > firewire: ohci: remove unused wrapper macro for dev_info() > firewire: core/ohci: minor refactoring for computation of > configuration ROM size > > drivers/firewire/core-device.c | 3 ++- > drivers/firewire/ohci.c | 5 ++--- > 2 files changed, 4 insertions(+), 4 deletions(-) Applied to for-next branch. Regards Takashi Sakamoto |