[PATCH] staging: media: atomisp: clean up atomisp_v4l2.c style warnings

Ruziev Miraly posted 1 patch 4 hours ago
.../staging/media/atomisp/pci/atomisp_v4l2.c  | 30 +++++++------------
1 file changed, 11 insertions(+), 19 deletions(-)
[PATCH] staging: media: atomisp: clean up atomisp_v4l2.c style warnings
Posted by Ruziev Miraly 4 hours ago
Fix checkpatch.pl warnings in atomisp_v4l2.c regarding unnecessary
ftrace-like logging and redundant else statements after return.

Remove dev_dbg() calls that only log function entry, as ftrace should
be preferred for this purpose. Also, remove the unnecessary else block
following a return statement to flatten the code structure.

Signed-off-by: Ruziev Miraly <miraly.dev@gmail.com>
---
 .../staging/media/atomisp/pci/atomisp_v4l2.c  | 30 +++++++------------
 1 file changed, 11 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
index 812230397..2d72467eb 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
@@ -345,8 +345,6 @@ static int atomisp_save_iunit_reg(struct atomisp_device *isp)
 {
 	struct pci_dev *pdev = to_pci_dev(isp->dev);
 
-	dev_dbg(isp->dev, "%s\n", __func__);
-
 	pci_read_config_word(pdev, PCI_COMMAND, &isp->saved_regs.pcicmdsts);
 	/* isp->saved_regs.ispmmadr is set from the atomisp_pci_probe() */
 	pci_read_config_dword(pdev, PCI_MSI_CAPID, &isp->saved_regs.msicap);
@@ -400,8 +398,6 @@ static int atomisp_restore_iunit_reg(struct atomisp_device *isp)
 {
 	struct pci_dev *pdev = to_pci_dev(isp->dev);
 
-	dev_dbg(isp->dev, "%s\n", __func__);
-
 	pci_write_config_word(pdev, PCI_COMMAND, isp->saved_regs.pcicmdsts);
 	pci_write_config_dword(pdev, PCI_BASE_ADDRESS_0, isp->saved_regs.ispmmadr);
 	pci_write_config_dword(pdev, PCI_MSI_CAPID, isp->saved_regs.msicap);
@@ -468,22 +464,18 @@ static int atomisp_mrfld_pre_power_down(struct atomisp_device *isp)
 			__func__, irq);
 		spin_unlock_irqrestore(&isp->lock, flags);
 		return -EAGAIN;
-	} else {
-		pci_read_config_dword(pdev, PCI_INTERRUPT_CTRL, &irq);
-		irq &= BIT(INTR_IIR);
-		pci_write_config_dword(pdev, PCI_INTERRUPT_CTRL, irq);
-
-		pci_read_config_dword(pdev, PCI_INTERRUPT_CTRL, &irq);
-		if (!(irq & BIT(INTR_IIR))) {
-			atomisp_css2_hw_store_32(MRFLD_INTR_ENABLE_REG, 0x0);
-			goto done;
-		}
-		dev_err(isp->dev,
-			"%s: error in iunit interrupt. status reg=0x%x\n",
-			__func__, irq);
-		spin_unlock_irqrestore(&isp->lock, flags);
-		return -EAGAIN;
 	}
+	pci_read_config_dword(pdev, PCI_INTERRUPT_CTRL, &irq);
+	irq &= BIT(INTR_IIR);
+	pci_write_config_dword(pdev, PCI_INTERRUPT_CTRL, irq);
+
+	pci_read_config_dword(pdev, PCI_INTERRUPT_CTRL, &irq);
+	if (!(irq & BIT(INTR_IIR))) {
+		atomisp_css2_hw_store_32(MRFLD_INTR_ENABLE_REG, 0x0);
+		goto done;
+	}
+	spin_unlock_irqrestore(&isp->lock, flags);
+	return -EAGAIN;
 done:
 	/*
 	 * MRFLD WORKAROUND:
-- 
2.54.0
Re: [PATCH] staging: media: atomisp: clean up atomisp_v4l2.c style warnings
Posted by Andy Shevchenko 2 hours ago
On Sat, Jul 4, 2026 at 5:01 PM Ruziev Miraly <miraly.dev@gmail.com> wrote:
>
> Fix checkpatch.pl warnings in atomisp_v4l2.c regarding unnecessary
> ftrace-like logging and redundant else statements after return.
>
> Remove dev_dbg() calls that only log function entry, as ftrace should
> be preferred for this purpose. Also, remove the unnecessary else block
> following a return statement to flatten the code structure.

...

> @@ -468,22 +464,18 @@ static int atomisp_mrfld_pre_power_down(struct atomisp_device *isp)
>                         __func__, irq);

^^^

>                 spin_unlock_irqrestore(&isp->lock, flags);
>                 return -EAGAIN;
> -       } else {
> -               pci_read_config_dword(pdev, PCI_INTERRUPT_CTRL, &irq);
> -               irq &= BIT(INTR_IIR);
> -               pci_write_config_dword(pdev, PCI_INTERRUPT_CTRL, irq);
> -
> -               pci_read_config_dword(pdev, PCI_INTERRUPT_CTRL, &irq);
> -               if (!(irq & BIT(INTR_IIR))) {
> -                       atomisp_css2_hw_store_32(MRFLD_INTR_ENABLE_REG, 0x0);
> -                       goto done;
> -               }

> -               dev_err(isp->dev,
> -                       "%s: error in iunit interrupt. status reg=0x%x\n",
> -                       __func__, irq);

You removed this one and the above branch seems to have the similar
one. Be consistent.

> -               spin_unlock_irqrestore(&isp->lock, flags);
> -               return -EAGAIN;
>         }
> +       pci_read_config_dword(pdev, PCI_INTERRUPT_CTRL, &irq);
> +       irq &= BIT(INTR_IIR);
> +       pci_write_config_dword(pdev, PCI_INTERRUPT_CTRL, irq);
> +
> +       pci_read_config_dword(pdev, PCI_INTERRUPT_CTRL, &irq);
> +       if (!(irq & BIT(INTR_IIR))) {
> +               atomisp_css2_hw_store_32(MRFLD_INTR_ENABLE_REG, 0x0);
> +               goto done;
> +       }
> +       spin_unlock_irqrestore(&isp->lock, flags);
> +       return -EAGAIN;

-- 
With Best Regards,
Andy Shevchenko