The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] firewire: ohci: use from_work() macro to expand parent structure of work_struct
@ 2025-06-08 23:38 Takashi Sakamoto
  2025-06-09 23:04 ` Takashi Sakamoto
  0 siblings, 1 reply; 2+ messages in thread
From: Takashi Sakamoto @ 2025-06-08 23:38 UTC (permalink / raw)
  To: linux1394-devel; +Cc: linux-kernel

A commit 60b2ebf48526 ("workqueue: Introduce from_work() helper for cleaner
callback declarations") introduces a new macro to retrieve a poiner for the
parent structure of the work item. It is convenient to reduce input text.

This commit uses the macro in PCI driver for 1394 OHCI.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
---
 drivers/firewire/ohci.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c
index 27e3e998e6fc..40313a3ec63e 100644
--- a/drivers/firewire/ohci.c
+++ b/drivers/firewire/ohci.c
@@ -1190,7 +1190,7 @@ static void context_tasklet(unsigned long data)
 
 static void ohci_isoc_context_work(struct work_struct *work)
 {
-	struct fw_iso_context *base = container_of(work, struct fw_iso_context, work);
+	struct fw_iso_context *base = from_work(base, work, work);
 	struct iso_context *isoc_ctx = container_of(base, struct iso_context, base);
 
 	context_retire_descriptors(&isoc_ctx->context);
@@ -2028,8 +2028,7 @@ static int find_and_insert_self_id(struct fw_ohci *ohci, int self_id_count)
 
 static void bus_reset_work(struct work_struct *work)
 {
-	struct fw_ohci *ohci =
-		container_of(work, struct fw_ohci, bus_reset_work);
+	struct fw_ohci *ohci = from_work(ohci, work, bus_reset_work);
 	int self_id_count, generation, new_generation, i, j;
 	u32 reg, quadlet;
 	void *free_rom = NULL;
-- 
2.48.1


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

* Re: [PATCH] firewire: ohci: use from_work() macro to expand parent structure of work_struct
  2025-06-08 23:38 [PATCH] firewire: ohci: use from_work() macro to expand parent structure of work_struct Takashi Sakamoto
@ 2025-06-09 23:04 ` Takashi Sakamoto
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Sakamoto @ 2025-06-09 23:04 UTC (permalink / raw)
  To: linux1394-devel; +Cc: linux-kernel

Hi,

On Mon, Jun 09, 2025 at 08:38:07AM +0900, Takashi Sakamoto wrote:
> A commit 60b2ebf48526 ("workqueue: Introduce from_work() helper for cleaner
> callback declarations") introduces a new macro to retrieve a poiner for the
> parent structure of the work item. It is convenient to reduce input text.
> 
> This commit uses the macro in PCI driver for 1394 OHCI.
> 
> Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
> ---
>  drivers/firewire/ohci.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)


Applied to for-next branch.


Regards

Takashi Sakamoto

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

end of thread, other threads:[~2025-06-09 23:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-08 23:38 [PATCH] firewire: ohci: use from_work() macro to expand parent structure of work_struct Takashi Sakamoto
2025-06-09 23:04 ` Takashi Sakamoto

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