Skip to contentSkip to conversation

dmaengine: dw-axi-dmac: Coding style cleanups

PATCH Superseded Khairul Anuar Romli 2 participants 8 messages Jan 26 – Feb 1

Subsystems (2)

v5 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v5 cover dmaengine: dw-axi-dmac: Coding style cleanups

This series contains a single patch that fixes minor coding style issues in the Synopsys DesignWare AXI DMA Controller platform driver. This adjustment possibilities were detected with the help of the analysis tool “checkpatch.pl".

The changes are purely cosmetic:
- Adjust indentation of function arguments and debug messages
- Remove an unnecessary return; statement
- Add a blank line for readability between functions

These updates improve code readability and maintain consistency with kernel coding style guidelines. No functional changes are introduced.

---
Notes:
This patch series is applied on dmaengine maintainer's tree
https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine.git/log/?h=next

Changes in v5:
- Refine the commit message of each patch to mention the use of checkpatch.pl analysis tool for the fix.
Changes in v4:
- Improve the description on every patch.
- Mentioned the commit the patches addressed.
Changes in v3:
- Split into smaller patches based on warning type
Changes in v2:
- Rebase on top of newer merge commit
v1:
https://lore.kernel.org/all/[email protected]/
---
Khairul Anuar Romli (3):
dmaengine: dw-axi-dmac: fix Alignment should match open parenthesis
dmaengine: dw-axi-dmac: Add blank line after function
dmaengine: dw-axi-dmac: Remove not useful void return function
statements

 drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)
Signature · 1 line
2.43.0
#1 lore raw

PATCH v5 1/3 dmaengine: dw-axi-dmac: fix Alignment should match open parenthesis

Correct alignment issue so that continuation lines properly match the position of the opening parenthesis. This alignment issue were detected with the help of the checkpatch.pl analysis tool with --strict --file option.

The fix applies to code introduced in:
- 'commit 1fe20f1b8454 ("dmaengine: Introduce DW AXI DMAC driver")'
- 'commit e32634f466a9 ("dma: dw-axi-dmac: support per channel interrupt")'

---
 drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c +7 -7
index 493c2a32b0fe..8bb97fb8fd4c 100644
@@ -342,8 +342,8 @@ static void axi_desc_put(struct axi_dma_desc *desc)
 	kfree(desc);
 	atomic_sub(descs_put, &chan->descs_allocated);
 	dev_vdbg(chan2dev(chan), "%s: %d descs put, %d still allocated\n",
-		axi_chan_name(chan), descs_put,
-		atomic_read(&chan->descs_allocated));
+		 axi_chan_name(chan), descs_put,
+		 atomic_read(&chan->descs_allocated));
 }
 
 static void vchan_desc_put(struct virt_dma_desc *vdesc)
@@ -353,7 +353,7 @@ static void vchan_desc_put(struct virt_dma_desc *vdesc)
 
 static enum dma_status
 dma_chan_tx_status(struct dma_chan *dchan, dma_cookie_t cookie,
-		  struct dma_tx_state *txstate)
+		   struct dma_tx_state *txstate)
 {
 	struct axi_dma_chan *chan = dchan_to_axi_dma_chan(dchan);
 	struct virt_dma_desc *vdesc;
@@ -491,7 +491,7 @@ static void axi_chan_start_first_queued(struct axi_dma_chan *chan)
 
 	desc = vd_to_axi_desc(vd);
 	dev_vdbg(chan2dev(chan), "%s: started %u\n", axi_chan_name(chan),
-		vd->tx.cookie);
+		 vd->tx.cookie);
 	axi_chan_block_xfer_start(chan, desc);
 }
 
@@ -1162,7 +1162,7 @@ static irqreturn_t dw_axi_dma_interrupt(int irq, void *dev_id)
 		axi_chan_irq_clear(chan, status);
 
 		dev_vdbg(chip->dev, "%s %u IRQ status: 0x%08x\n",
-			axi_chan_name(chan), i, status);
+			 axi_chan_name(chan), i, status);
 
 		if (status & DWAXIDMAC_IRQ_ALL_ERR)
 			axi_chan_handle_err(chan, status);
@@ -1451,7 +1451,7 @@ static int axi_req_irqs(struct platform_device *pdev, struct axi_dma_chip *chip)
 		if (chip->irq[i] < 0)
 			return chip->irq[i];
 		ret = devm_request_irq(chip->dev, chip->irq[i], dw_axi_dma_interrupt,
-				IRQF_SHARED, KBUILD_MODNAME, chip);
+				       IRQF_SHARED, KBUILD_MODNAME, chip);
 		if (ret < 0)
 			return ret;
 	}
@@ -1645,7 +1645,7 @@ static void dw_remove(struct platform_device *pdev)
 	of_dma_controller_free(chip->dev->of_node);
 
 	list_for_each_entry_safe(chan, _chan, &dw->dma.channels,
-			vc.chan.device_node) {
+				 vc.chan.device_node) {
 		list_del(&chan->vc.chan.device_node);
 		tasklet_kill(&chan->vc.task);
 	}
Signature · 1 line
2.43.0
#5 lore raw

PATCH v5 2/3 dmaengine: dw-axi-dmac: Add blank line after function

In reply to Khairul Anuar Romli

Resolved checkpatch.pl --strict warning by inserting a blank line after declaration.

---
 drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 1 +
 1 file changed, 1 insertion(+)
drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c +1 -0
index 8bb97fb8fd4c..e59725376f8e 100644
@@ -419,6 +419,7 @@ static void dw_axi_dma_set_byte_halfword(struct axi_dma_chan *chan, bool set)
 
 	iowrite32(val, chan->chip->apb_regs + offset);
 }
+
 /* Called in chan locked context */
 static void axi_chan_block_xfer_start(struct axi_dma_chan *chan,
 				      struct axi_dma_desc *first)
Signature · 1 line
2.43.0
#6 lore raw

PATCH v5 3/3 dmaengine: dw-axi-dmac: Remove not useful void return function statements

In reply to Khairul Anuar Romli

Remove an unnecessary return statement from a dw_axi_dma_set_hw_channel(). This resolves a coding style issue introduced by 'commit 32286e279385 ("dmaengine: dw-axi-dmac: Remove free slot check algorithm in dw_axi_dma_set_hw_channel")' and ensures proper function semantic. This unnecessary return were detected with the help of the checkpatch.pl analysis tool with --strict --file option.

---
 drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 2 --
 1 file changed, 2 deletions(-)
drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c +0 -2
index e59725376f8e..c124ac6c8df6 100644
@@ -593,8 +593,6 @@ static void dw_axi_dma_set_hw_channel(struct axi_dma_chan *chan, bool set)
 			(chan->id * DMA_APB_HS_SEL_BIT_SIZE));
 	reg_value |= (val << (chan->id * DMA_APB_HS_SEL_BIT_SIZE));
 	lo_hi_writeq(reg_value, chip->apb_regs + DMAC_APB_HW_HS_SEL_0);
-
-	return;
 }
 
 /*
Signature · 1 line
2.43.0
#2 lore raw

Re: [PATCH v5 1/3] dmaengine: dw-axi-dmac: fix Alignment should match open parenthesis

In reply to Khairul Anuar Romli
Quoted 2 lines

Correct alignment issue so that continuation lines properly match the position of the opening parenthesis.

Line break?

Quoted 1 line

This alignment issue were detected

This issue was?

Quoted 2 lines

with the help of the checkpatch.pl analysis tool with --strict --file option.

Would it be nicer to put such information into another paragraph?

Quoted 3 lines

- 'commit 1fe20f1b8454 ("dmaengine: Introduce DW AXI DMAC driver")'
- 'commit e32634f466a9 ("dma: dw-axi-dmac: support per channel interrupt")'

Is there a need to reformat such details a bit more?

How do you think about to refine the summary phrase another bit?

Regards,
Markus

#7 lore raw

Re: [PATCH v5 3/3] dmaengine: dw-axi-dmac: Remove not useful void return function statements

In reply to Khairul Anuar Romli
Quoted 1 line

Remove an unnecessary return statement from a

Would such information be also appropriate for a summary phrase?

…

Quoted 2 lines

semantic. This unnecessary return were detected with the help of the checkpatch.pl analysis tool with --strict --file option.

How do you think about to mention a “warning” better in the change description?

Would it be nicer to put such a hint into another paragraph?

Regards,
Markus

#3 lore raw

Re: [PATCH v5 1/3] dmaengine: dw-axi-dmac: fix Alignment should match open parenthesis

In reply to Markus Elfring
Quoted 4 lines · Markus Elfring
Quoted 2 lines

Correct alignment issue so that continuation lines properly match the position of the opening parenthesis.

Line break?

Sure.

Quoted 6 lines
Quoted 3 lines

This alignment issue were detected

This issue was?

Will put it in the next version

Quoted 6 lines
Quoted 3 lines

with the help of the checkpatch.pl analysis tool with --strict --file option.

Would it be nicer to put such information into another paragraph?

Yeah, I will do this.

Quoted 7 lines
Quoted 4 lines

- 'commit 1fe20f1b8454 ("dmaengine: Introduce DW AXI DMAC driver")'
- 'commit e32634f466a9 ("dma: dw-axi-dmac: support per channel interrupt")'

Is there a need to reformat such details a bit more?

We are going back in the circle. I already put the details in the form of line and code but you mentioned I shall not list all the effected line before.

Quoted 2 lines

How do you think about to refine the summary phrase another bit?

I'll refine it.

Quoted 3 lines

Regards,
Markus

Thanks.

Regards,
Khairul

#4 lore raw

Re: [v5 1/3] dmaengine: dw-axi-dmac: fix Alignment should match open parenthesis

Quoted 3 lines
Quoted 2 lines

Is there a need to reformat such details a bit more?

We are going back in the circle.

I hope not.

But we are stumbling on recurring challenges according to collateral evolution and some communication difficulties.

Quoted 1 line

I already put the details in the form of line and code but you mentioned I shall not list all the effected line before.

It seems that you interpreted a bit of my patch review feedback
in undesirable directions.
Further contributors might become more helpful for corresponding clarifications.

Regards,
Markus