staging: media: atomisp: clean up atomisp_v4l2.c style warnings
Subsystems (4)
PATCH 1/1 staging: media: atomisp: clean up atomisp_v4l2.c style warnings
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.
--- .../staging/media/atomisp/pci/atomisp_v4l2.c | 30 +++++++------------ 1 file changed, 11 insertions(+), 19 deletions(-)
drivers/staging/media/atomisp/pci/atomisp_v4l2.c +11 -19
@@ -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:
Signature · 1 line
2.54.0
Quoted 7 lines · Ruziev Miraly
Fix checkpatch.pl warnings in
atomisp_v4l2.cregarding 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.
...
drivers/staging/media/atomisp/pci/atomisp_v4l2.c static int atomisp_mrfld_pre_power_down(struct atomisp_device *isp) · line 464
Quoted 2 lines
drivers/staging/media/atomisp/pci/atomisp_v4l2.c +0
-0@@ -468,22 +464,18 @@ static int atomisp_mrfld_pre_power_down(struct atomisp_device *isp) __func__, irq);
^^^
Quoted 6 lines
drivers/staging/media/atomisp/pci/atomisp_v4l2.c +0
-4spin_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);
drivers/staging/media/atomisp/pci/atomisp_v4l2.c static int atomisp_mrfld_pre_power_down(struct atomisp_device *isp) · line 483
Quoted 10 lines
drivers/staging/media/atomisp/pci/atomisp_v4l2.c +0
-9- -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.
Quoted 14 lines
drivers/staging/media/atomisp/pci/atomisp_v4l2.c +11
-2-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 ;
Signature · 2 lines
With Best Regards, Andy Shevchenko