* [PATCH v2 0/2] dmaengine: Use named initializers for arrays of pci_device_id @ 2026-06-11 7:45 Uwe Kleine-König (The Capable Hub) 2026-06-11 7:45 ` [PATCH v2 1/2] dmaengine: hsu: Drop unused platform driver data Uwe Kleine-König (The Capable Hub) 2026-06-11 7:45 ` [PATCH v2 2/2] dmaengine: Consistently define pci_device_ids using named initializers Uwe Kleine-König (The Capable Hub) 0 siblings, 2 replies; 6+ messages in thread From: Uwe Kleine-König (The Capable Hub) @ 2026-06-11 7:45 UTC (permalink / raw) To: Andy Shevchenko, Vinod Koul, Basavaraj Natikar, Manivannan Sadhasivam, Viresh Kumar Cc: Uwe Kleine-König, Frank Li, linux-kernel, dmaengine, Andy Shevchenko From: Uwe Kleine-König <ukleinek@kernel.org> Hello, (implicit) v1 of this series was only a single patch, it's archived at https://lore.kernel.org/all/20260504102008.1996139-2-u.kleine-koenig@baylibre.com . Andy criticised that the changes to the HSU driver don't fit to the remaining stuff in that patch. So I put that change in a separate patch. Andy also suggested to use the PCI_DEVICE_DATA(). I didn't implement that as we don't agree about this being better. He likes it being compact, I don't like it as it hides assignments in a macro that I prefer to be explicit. Best regards Uwe Uwe Kleine-König (The Capable Hub) (2): dmaengine: hsu: Drop unused platform driver data dmaengine: Consistently define pci_device_ids using named initializers drivers/dma/amd/ptdma/ptdma-pci.c | 4 ++-- drivers/dma/dw-edma/dw-edma-pcie.c | 2 +- drivers/dma/dw/pci.c | 22 +++++++++++----------- drivers/dma/hsu/pci.c | 4 ++-- drivers/dma/pch_dma.c | 26 +++++++++++++------------- 5 files changed, 29 insertions(+), 29 deletions(-) base-commit: abe651837cb394f76d738a7a747322fca3bf17ba -- 2.47.3 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 1/2] dmaengine: hsu: Drop unused platform driver data 2026-06-11 7:45 [PATCH v2 0/2] dmaengine: Use named initializers for arrays of pci_device_id Uwe Kleine-König (The Capable Hub) @ 2026-06-11 7:45 ` Uwe Kleine-König (The Capable Hub) 2026-06-11 8:11 ` sashiko-bot 2026-06-11 8:30 ` Andy Shevchenko 2026-06-11 7:45 ` [PATCH v2 2/2] dmaengine: Consistently define pci_device_ids using named initializers Uwe Kleine-König (The Capable Hub) 1 sibling, 2 replies; 6+ messages in thread From: Uwe Kleine-König (The Capable Hub) @ 2026-06-11 7:45 UTC (permalink / raw) To: Andy Shevchenko, Vinod Koul; +Cc: Frank Li, linux-kernel, dmaengine The driver explicitly sets the .driver_data member of struct pnp_device_id to zero without relying on that value. Drop these unused assignments. This patch doesn't modify the compiled array, only its representation in source form benefits. The former was confirmed with builds on x86 and arm64. Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com> --- drivers/dma/hsu/pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/dma/hsu/pci.c b/drivers/dma/hsu/pci.c index 0fcc0c0c22fc..b42c9c0887a8 100644 --- a/drivers/dma/hsu/pci.c +++ b/drivers/dma/hsu/pci.c @@ -116,8 +116,8 @@ static int hsu_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) } static const struct pci_device_id hsu_pci_id_table[] = { - { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_MFLD_HSU_DMA), 0 }, - { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_MRFLD_HSU_DMA), 0 }, + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_MFLD_HSU_DMA) }, + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_MRFLD_HSU_DMA) }, { } }; MODULE_DEVICE_TABLE(pci, hsu_pci_id_table); -- 2.47.3 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2 1/2] dmaengine: hsu: Drop unused platform driver data 2026-06-11 7:45 ` [PATCH v2 1/2] dmaengine: hsu: Drop unused platform driver data Uwe Kleine-König (The Capable Hub) @ 2026-06-11 8:11 ` sashiko-bot 2026-06-11 8:30 ` Andy Shevchenko 1 sibling, 0 replies; 6+ messages in thread From: sashiko-bot @ 2026-06-11 8:11 UTC (permalink / raw) Cc: dmaengine, vkoul, Frank.Li Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] The commit message incorrectly states that it modifies struct pnp_device_id instead of struct pci_device_id. -- commit 5cb66572eea17e218716d84ce22cd0b73ee38c30 Author: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com> dmaengine: hsu: Drop unused platform driver data This patch drops the unused .driver_data assignments from the hsu_pci_id_table array. It only modifies the source code representation and does not affect the compiled output. > The driver explicitly sets the .driver_data member of struct > pnp_device_id to zero without relying on that value. Drop these unused > assignments. [Severity: Low] This isn't a bug, but the commit message states that the driver sets the member of struct pnp_device_id, while the patch actually modifies an array of struct pci_device_id in drivers/dma/hsu/pci.c. Should the commit message be updated to reference the correct struct? -- Sashiko AI review · https://sashiko.dev/#/patchset/cover.1781161455.git.ukleinek@kernel.org?part=1 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 1/2] dmaengine: hsu: Drop unused platform driver data 2026-06-11 7:45 ` [PATCH v2 1/2] dmaengine: hsu: Drop unused platform driver data Uwe Kleine-König (The Capable Hub) 2026-06-11 8:11 ` sashiko-bot @ 2026-06-11 8:30 ` Andy Shevchenko 1 sibling, 0 replies; 6+ messages in thread From: Andy Shevchenko @ 2026-06-11 8:30 UTC (permalink / raw) To: Uwe Kleine-König (The Capable Hub) Cc: Andy Shevchenko, Vinod Koul, Frank Li, linux-kernel, dmaengine On Thu, Jun 11, 2026 at 09:45:09AM +0200, Uwe Kleine-König (The Capable Hub) wrote: > The driver explicitly sets the .driver_data member of struct > pnp_device_id to zero without relying on that value. Drop these unused > assignments. > > This patch doesn't modify the compiled array, only its representation in > source form benefits. The former was confirmed with builds on x86 and > arm64. Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 2/2] dmaengine: Consistently define pci_device_ids using named initializers 2026-06-11 7:45 [PATCH v2 0/2] dmaengine: Use named initializers for arrays of pci_device_id Uwe Kleine-König (The Capable Hub) 2026-06-11 7:45 ` [PATCH v2 1/2] dmaengine: hsu: Drop unused platform driver data Uwe Kleine-König (The Capable Hub) @ 2026-06-11 7:45 ` Uwe Kleine-König (The Capable Hub) 2026-06-11 8:33 ` Andy Shevchenko 1 sibling, 1 reply; 6+ messages in thread From: Uwe Kleine-König (The Capable Hub) @ 2026-06-11 7:45 UTC (permalink / raw) To: Basavaraj Natikar, Vinod Koul, Manivannan Sadhasivam, Viresh Kumar Cc: Frank Li, Andy Shevchenko, dmaengine, linux-kernel The .driver_data member of the various struct pci_device_id arrays were initialized by list expressions. This isn't easily readable if you're not into PCI. Using named initializers is more explicit and thus easier to parse. While touching these arrays, unify the list terminators to be just an empty struct with no trailing comma. This change doesn't introduce changes to the compiled pci_device_id arrays, which was confirmed using x86 and arm64 builds. Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com> --- drivers/dma/amd/ptdma/ptdma-pci.c | 4 ++-- drivers/dma/dw-edma/dw-edma-pcie.c | 2 +- drivers/dma/dw/pci.c | 22 +++++++++++----------- drivers/dma/pch_dma.c | 26 +++++++++++++------------- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/drivers/dma/amd/ptdma/ptdma-pci.c b/drivers/dma/amd/ptdma/ptdma-pci.c index 22739ff0c3c5..0b226bec950c 100644 --- a/drivers/dma/amd/ptdma/ptdma-pci.c +++ b/drivers/dma/amd/ptdma/ptdma-pci.c @@ -223,9 +223,9 @@ static const struct pt_dev_vdata dev_vdata[] = { }; static const struct pci_device_id pt_pci_table[] = { - { PCI_VDEVICE(AMD, 0x1498), (kernel_ulong_t)&dev_vdata[0] }, + { PCI_VDEVICE(AMD, 0x1498), .driver_data = (kernel_ulong_t)&dev_vdata[0] }, /* Last entry must be zero */ - { 0, } + { } }; MODULE_DEVICE_TABLE(pci, pt_pci_table); diff --git a/drivers/dma/dw-edma/dw-edma-pcie.c b/drivers/dma/dw-edma/dw-edma-pcie.c index 791c46e8ae4c..a27112de5497 100644 --- a/drivers/dma/dw-edma/dw-edma-pcie.c +++ b/drivers/dma/dw-edma/dw-edma-pcie.c @@ -563,7 +563,7 @@ static void dw_edma_pcie_remove(struct pci_dev *pdev) static const struct pci_device_id dw_edma_pcie_id_table[] = { { PCI_DEVICE_DATA(SYNOPSYS, EDDA, &snps_edda_data) }, { PCI_VDEVICE(XILINX, PCI_DEVICE_ID_XILINX_B054), - (kernel_ulong_t)&xilinx_mdb_data }, + .driver_data = (kernel_ulong_t)&xilinx_mdb_data }, { PCI_VDEVICE(XILINX, PCI_DEVICE_ID_XILINX_B00F), .driver_data = (kernel_ulong_t)&xilinx_cpm6_dma_data }, { } diff --git a/drivers/dma/dw/pci.c b/drivers/dma/dw/pci.c index a3aae3d1c093..99565fab3565 100644 --- a/drivers/dma/dw/pci.c +++ b/drivers/dma/dw/pci.c @@ -98,29 +98,29 @@ static const struct dev_pm_ops dw_pci_dev_pm_ops = { static const struct pci_device_id dw_pci_id_table[] = { /* Medfield (GPDMA) */ - { PCI_VDEVICE(INTEL, 0x0827), (kernel_ulong_t)&dw_dma_chip_pdata }, + { PCI_VDEVICE(INTEL, 0x0827), .driver_data = (kernel_ulong_t)&dw_dma_chip_pdata }, /* BayTrail */ - { PCI_VDEVICE(INTEL, 0x0f06), (kernel_ulong_t)&dw_dma_chip_pdata }, - { PCI_VDEVICE(INTEL, 0x0f40), (kernel_ulong_t)&dw_dma_chip_pdata }, + { PCI_VDEVICE(INTEL, 0x0f06), .driver_data = (kernel_ulong_t)&dw_dma_chip_pdata }, + { PCI_VDEVICE(INTEL, 0x0f40), .driver_data = (kernel_ulong_t)&dw_dma_chip_pdata }, /* Merrifield */ - { PCI_VDEVICE(INTEL, 0x11a2), (kernel_ulong_t)&idma32_chip_pdata }, + { PCI_VDEVICE(INTEL, 0x11a2), .driver_data = (kernel_ulong_t)&idma32_chip_pdata }, /* Braswell */ - { PCI_VDEVICE(INTEL, 0x2286), (kernel_ulong_t)&dw_dma_chip_pdata }, - { PCI_VDEVICE(INTEL, 0x22c0), (kernel_ulong_t)&dw_dma_chip_pdata }, + { PCI_VDEVICE(INTEL, 0x2286), .driver_data = (kernel_ulong_t)&dw_dma_chip_pdata }, + { PCI_VDEVICE(INTEL, 0x22c0), .driver_data = (kernel_ulong_t)&dw_dma_chip_pdata }, /* Elkhart Lake iDMA 32-bit (PSE DMA) */ - { PCI_VDEVICE(INTEL, 0x4bb4), (kernel_ulong_t)&xbar_chip_pdata }, - { PCI_VDEVICE(INTEL, 0x4bb5), (kernel_ulong_t)&xbar_chip_pdata }, - { PCI_VDEVICE(INTEL, 0x4bb6), (kernel_ulong_t)&xbar_chip_pdata }, + { PCI_VDEVICE(INTEL, 0x4bb4), .driver_data = (kernel_ulong_t)&xbar_chip_pdata }, + { PCI_VDEVICE(INTEL, 0x4bb5), .driver_data = (kernel_ulong_t)&xbar_chip_pdata }, + { PCI_VDEVICE(INTEL, 0x4bb6), .driver_data = (kernel_ulong_t)&xbar_chip_pdata }, /* Haswell */ - { PCI_VDEVICE(INTEL, 0x9c60), (kernel_ulong_t)&dw_dma_chip_pdata }, + { PCI_VDEVICE(INTEL, 0x9c60), .driver_data = (kernel_ulong_t)&dw_dma_chip_pdata }, /* Broadwell */ - { PCI_VDEVICE(INTEL, 0x9ce0), (kernel_ulong_t)&dw_dma_chip_pdata }, + { PCI_VDEVICE(INTEL, 0x9ce0), .driver_data = (kernel_ulong_t)&dw_dma_chip_pdata }, { } }; diff --git a/drivers/dma/pch_dma.c b/drivers/dma/pch_dma.c index bf805f1024f6..152939e7c6fd 100644 --- a/drivers/dma/pch_dma.c +++ b/drivers/dma/pch_dma.c @@ -956,19 +956,19 @@ static void pch_dma_remove(struct pci_dev *pdev) #define PCI_DEVICE_ID_ML7831_DMA2_4CH 0x8815 static const struct pci_device_id pch_dma_id_table[] = { - { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_EG20T_PCH_DMA_8CH), 8 }, - { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_EG20T_PCH_DMA_4CH), 4 }, - { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7213_DMA1_8CH), 8}, /* UART Video */ - { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7213_DMA2_8CH), 8}, /* PCMIF SPI */ - { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7213_DMA3_4CH), 4}, /* FPGA */ - { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7213_DMA4_12CH), 12}, /* I2S */ - { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7223_DMA1_4CH), 4}, /* UART */ - { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7223_DMA2_4CH), 4}, /* Video SPI */ - { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7223_DMA3_4CH), 4}, /* Security */ - { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7223_DMA4_4CH), 4}, /* FPGA */ - { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7831_DMA1_8CH), 8}, /* UART */ - { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7831_DMA2_4CH), 4}, /* SPI */ - { 0, }, + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_EG20T_PCH_DMA_8CH), .driver_data = 8 }, + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_EG20T_PCH_DMA_4CH), .driver_data = 4 }, + { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7213_DMA1_8CH), .driver_data = 8 }, /* UART Video */ + { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7213_DMA2_8CH), .driver_data = 8 }, /* PCMIF SPI */ + { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7213_DMA3_4CH), .driver_data = 4 }, /* FPGA */ + { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7213_DMA4_12CH), .driver_data = 12 }, /* I2S */ + { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7223_DMA1_4CH), .driver_data = 4 }, /* UART */ + { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7223_DMA2_4CH), .driver_data = 4 }, /* Video SPI */ + { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7223_DMA3_4CH), .driver_data = 4 }, /* Security */ + { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7223_DMA4_4CH), .driver_data = 4 }, /* FPGA */ + { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7831_DMA1_8CH), .driver_data = 8 }, /* UART */ + { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7831_DMA2_4CH), .driver_data = 4 }, /* SPI */ + { } }; MODULE_DEVICE_TABLE(pci, pch_dma_id_table); -- 2.47.3 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2 2/2] dmaengine: Consistently define pci_device_ids using named initializers 2026-06-11 7:45 ` [PATCH v2 2/2] dmaengine: Consistently define pci_device_ids using named initializers Uwe Kleine-König (The Capable Hub) @ 2026-06-11 8:33 ` Andy Shevchenko 0 siblings, 0 replies; 6+ messages in thread From: Andy Shevchenko @ 2026-06-11 8:33 UTC (permalink / raw) To: Uwe Kleine-König (The Capable Hub) Cc: Basavaraj Natikar, Vinod Koul, Manivannan Sadhasivam, Viresh Kumar, Frank Li, dmaengine, linux-kernel On Thu, Jun 11, 2026 at 09:45:10AM +0200, Uwe Kleine-König (The Capable Hub) wrote: > The .driver_data member of the various struct pci_device_id arrays were > initialized by list expressions. This isn't easily readable if you're > not into PCI. Using named initializers is more explicit and thus easier > to parse. > > While touching these arrays, unify the list terminators to be just an > empty struct with no trailing comma. > > This change doesn't introduce changes to the compiled pci_device_id > arrays, which was confirmed using x86 and arm64 builds. ... > static const struct pci_device_id pch_dma_id_table[] = { This case is almost ready to use PCI_DEVICE_DATA() and I see no reason to not go with it. The disadvantages of the proposed change here is that it makes lines much longer without any good benefit. So, just to state again: I disagree with changing this driver (pch_dma) in the proposed way. > - { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_EG20T_PCH_DMA_8CH), 8 }, > - { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_EG20T_PCH_DMA_4CH), 4 }, > - { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7213_DMA1_8CH), 8}, /* UART Video */ > - { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7213_DMA2_8CH), 8}, /* PCMIF SPI */ > - { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7213_DMA3_4CH), 4}, /* FPGA */ > - { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7213_DMA4_12CH), 12}, /* I2S */ > - { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7223_DMA1_4CH), 4}, /* UART */ > - { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7223_DMA2_4CH), 4}, /* Video SPI */ > - { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7223_DMA3_4CH), 4}, /* Security */ > - { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7223_DMA4_4CH), 4}, /* FPGA */ > - { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7831_DMA1_8CH), 8}, /* UART */ > - { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7831_DMA2_4CH), 4}, /* SPI */ > - { 0, }, > + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_EG20T_PCH_DMA_8CH), .driver_data = 8 }, > + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_EG20T_PCH_DMA_4CH), .driver_data = 4 }, > + { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7213_DMA1_8CH), .driver_data = 8 }, /* UART Video */ > + { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7213_DMA2_8CH), .driver_data = 8 }, /* PCMIF SPI */ > + { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7213_DMA3_4CH), .driver_data = 4 }, /* FPGA */ > + { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7213_DMA4_12CH), .driver_data = 12 }, /* I2S */ > + { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7223_DMA1_4CH), .driver_data = 4 }, /* UART */ > + { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7223_DMA2_4CH), .driver_data = 4 }, /* Video SPI */ > + { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7223_DMA3_4CH), .driver_data = 4 }, /* Security */ > + { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7223_DMA4_4CH), .driver_data = 4 }, /* FPGA */ > + { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7831_DMA1_8CH), .driver_data = 8 }, /* UART */ > + { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7831_DMA2_4CH), .driver_data = 4 }, /* SPI */ > + { } > }; -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-06-11 8:34 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-06-11 7:45 [PATCH v2 0/2] dmaengine: Use named initializers for arrays of pci_device_id Uwe Kleine-König (The Capable Hub) 2026-06-11 7:45 ` [PATCH v2 1/2] dmaengine: hsu: Drop unused platform driver data Uwe Kleine-König (The Capable Hub) 2026-06-11 8:11 ` sashiko-bot 2026-06-11 8:30 ` Andy Shevchenko 2026-06-11 7:45 ` [PATCH v2 2/2] dmaengine: Consistently define pci_device_ids using named initializers Uwe Kleine-König (The Capable Hub) 2026-06-11 8:33 ` Andy Shevchenko
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.