public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] firewire: core/ohci: minor code refactoring
@ 2024-08-14 13:12 Takashi Sakamoto
  2024-08-14 13:12 ` [PATCH 1/3] firewire: ohci: use helper macro for compiler aligned attribute Takashi Sakamoto
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Takashi Sakamoto @ 2024-08-14 13:12 UTC (permalink / raw)
  To: linux1394-devel; +Cc: linux-kernel

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/3] firewire: ohci: use helper macro for compiler aligned attribute
  2024-08-14 13:12 [PATCH 0/3] firewire: core/ohci: minor code refactoring Takashi Sakamoto
@ 2024-08-14 13:12 ` Takashi Sakamoto
  2024-08-14 13:12 ` [PATCH 2/3] firewire: ohci: remove unused wrapper macro for dev_info() Takashi Sakamoto
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Takashi Sakamoto @ 2024-08-14 13:12 UTC (permalink / raw)
  To: linux1394-devel; +Cc: linux-kernel

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-takashi@sakamocchi.jp>
---
 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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] firewire: ohci: remove unused wrapper macro for dev_info()
  2024-08-14 13:12 [PATCH 0/3] firewire: core/ohci: minor code refactoring Takashi Sakamoto
  2024-08-14 13:12 ` [PATCH 1/3] firewire: ohci: use helper macro for compiler aligned attribute Takashi Sakamoto
@ 2024-08-14 13:12 ` Takashi Sakamoto
  2024-08-14 13:12 ` [PATCH 3/3] firewire: core/ohci: minor refactoring for computation of configuration ROM size Takashi Sakamoto
  2024-08-14 23:46 ` [PATCH 0/3] firewire: core/ohci: minor code refactoring Takashi Sakamoto
  3 siblings, 0 replies; 5+ messages in thread
From: Takashi Sakamoto @ 2024-08-14 13:12 UTC (permalink / raw)
  To: linux1394-devel; +Cc: linux-kernel

The ohci_info() macro is a thin wrapper of dev_info(), while it is never
used.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
---
 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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] firewire: core/ohci: minor refactoring for computation of configuration ROM size
  2024-08-14 13:12 [PATCH 0/3] firewire: core/ohci: minor code refactoring Takashi Sakamoto
  2024-08-14 13:12 ` [PATCH 1/3] firewire: ohci: use helper macro for compiler aligned attribute Takashi Sakamoto
  2024-08-14 13:12 ` [PATCH 2/3] firewire: ohci: remove unused wrapper macro for dev_info() Takashi Sakamoto
@ 2024-08-14 13:12 ` Takashi Sakamoto
  2024-08-14 23:46 ` [PATCH 0/3] firewire: core/ohci: minor code refactoring Takashi Sakamoto
  3 siblings, 0 replies; 5+ messages in thread
From: Takashi Sakamoto @ 2024-08-14 13:12 UTC (permalink / raw)
  To: linux1394-devel; +Cc: linux-kernel

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-takashi@sakamocchi.jp>
---
 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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/3] firewire: core/ohci: minor code refactoring
  2024-08-14 13:12 [PATCH 0/3] firewire: core/ohci: minor code refactoring Takashi Sakamoto
                   ` (2 preceding siblings ...)
  2024-08-14 13:12 ` [PATCH 3/3] firewire: core/ohci: minor refactoring for computation of configuration ROM size Takashi Sakamoto
@ 2024-08-14 23:46 ` Takashi Sakamoto
  3 siblings, 0 replies; 5+ messages in thread
From: Takashi Sakamoto @ 2024-08-14 23:46 UTC (permalink / raw)
  To: linux1394-devel; +Cc: linux-kernel

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-08-14 23:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-14 13:12 [PATCH 0/3] firewire: core/ohci: minor code refactoring Takashi Sakamoto
2024-08-14 13:12 ` [PATCH 1/3] firewire: ohci: use helper macro for compiler aligned attribute Takashi Sakamoto
2024-08-14 13:12 ` [PATCH 2/3] firewire: ohci: remove unused wrapper macro for dev_info() Takashi Sakamoto
2024-08-14 13:12 ` [PATCH 3/3] firewire: core/ohci: minor refactoring for computation of configuration ROM size Takashi Sakamoto
2024-08-14 23:46 ` [PATCH 0/3] firewire: core/ohci: minor code refactoring Takashi Sakamoto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox