linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] scsi: hisi_sas: Remove unnecessary print function dev_err()
@ 2022-02-15  2:05 Yang Li
  2022-02-15  8:03 ` John Garry
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Yang Li @ 2022-02-15  2:05 UTC (permalink / raw)
  To: jejb
  Cc: martin.petersen, john.garry, linux-scsi, linux-kernel, Yang Li,
	Abaci Robot

The print function dev_err() is redundant because platform_get_irq()
already prints an error.

Eliminate the follow coccicheck warnings:
./drivers/scsi/hisi_sas/hisi_sas_v1_hw.c:1661:3-10: line 1661 is
redundant because platform_get_irq() already prints an error
./drivers/scsi/hisi_sas/hisi_sas_v1_hw.c:1642:4-11: line 1642 is
redundant because platform_get_irq() already prints an error
./drivers/scsi/hisi_sas/hisi_sas_v1_hw.c:1679:3-10: line 1679 is
redundant because platform_get_irq() already prints an error

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
 drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c
index 6914e992a02e..e564c78ff910 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c
@@ -1638,11 +1638,8 @@ static int interrupt_init_v1_hw(struct hisi_hba *hisi_hba)
 		idx = i * HISI_SAS_PHY_INT_NR;
 		for (j = 0; j < HISI_SAS_PHY_INT_NR; j++, idx++) {
 			irq = platform_get_irq(pdev, idx);
-			if (irq < 0) {
-				dev_err(dev, "irq init: fail map phy interrupt %d\n",
-					idx);
+			if (irq < 0)
 				return irq;
-			}
 
 			rc = devm_request_irq(dev, irq, phy_interrupts[j], 0,
 					      DRV_NAME " phy", phy);
@@ -1657,11 +1654,8 @@ static int interrupt_init_v1_hw(struct hisi_hba *hisi_hba)
 	idx = hisi_hba->n_phy * HISI_SAS_PHY_INT_NR;
 	for (i = 0; i < hisi_hba->queue_count; i++, idx++) {
 		irq = platform_get_irq(pdev, idx);
-		if (irq < 0) {
-			dev_err(dev, "irq init: could not map cq interrupt %d\n",
-				idx);
+		if (irq < 0)
 			return irq;
-		}
 
 		rc = devm_request_irq(dev, irq, cq_interrupt_v1_hw, 0,
 				      DRV_NAME " cq", &hisi_hba->cq[i]);
@@ -1675,11 +1669,8 @@ static int interrupt_init_v1_hw(struct hisi_hba *hisi_hba)
 	idx = (hisi_hba->n_phy * HISI_SAS_PHY_INT_NR) + hisi_hba->queue_count;
 	for (i = 0; i < HISI_SAS_FATAL_INT_NR; i++, idx++) {
 		irq = platform_get_irq(pdev, idx);
-		if (irq < 0) {
-			dev_err(dev, "irq init: could not map fatal interrupt %d\n",
-				idx);
+		if (irq < 0)
 			return irq;
-		}
 
 		rc = devm_request_irq(dev, irq, fatal_interrupts[i], 0,
 				      DRV_NAME " fatal", hisi_hba);
-- 
2.20.1.7.g153144c


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

* Re: [PATCH -next] scsi: hisi_sas: Remove unnecessary print function dev_err()
  2022-02-15  2:05 [PATCH -next] scsi: hisi_sas: Remove unnecessary print function dev_err() Yang Li
@ 2022-02-15  8:03 ` John Garry
  2022-02-20  1:38 ` Martin K. Petersen
  2022-02-28  3:43 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: John Garry @ 2022-02-15  8:03 UTC (permalink / raw)
  To: Yang Li, jejb; +Cc: martin.petersen, linux-scsi, linux-kernel, Abaci Robot

On 15/02/2022 02:05, Yang Li wrote:
> The print function dev_err() is redundant because platform_get_irq()
> already prints an error.
> 
> Eliminate the follow coccicheck warnings:
> ./drivers/scsi/hisi_sas/hisi_sas_v1_hw.c:1661:3-10: line 1661 is
> redundant because platform_get_irq() already prints an error
> ./drivers/scsi/hisi_sas/hisi_sas_v1_hw.c:1642:4-11: line 1642 is
> redundant because platform_get_irq() already prints an error
> ./drivers/scsi/hisi_sas/hisi_sas_v1_hw.c:1679:3-10: line 1679 is
> redundant because platform_get_irq() already prints an error
> 
> Reported-by: Abaci Robot<abaci@linux.alibaba.com>
> Signed-off-by: Yang Li<yang.lee@linux.alibaba.com>

Acked-by: John Garry <john.garry@huawei.com>

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

* Re: [PATCH -next] scsi: hisi_sas: Remove unnecessary print function dev_err()
  2022-02-15  2:05 [PATCH -next] scsi: hisi_sas: Remove unnecessary print function dev_err() Yang Li
  2022-02-15  8:03 ` John Garry
@ 2022-02-20  1:38 ` Martin K. Petersen
  2022-02-28  3:43 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2022-02-20  1:38 UTC (permalink / raw)
  To: Yang Li
  Cc: jejb, martin.petersen, john.garry, linux-scsi, linux-kernel, Abaci Robot


Yang,

> The print function dev_err() is redundant because platform_get_irq()
> already prints an error.

Applied to 5.18/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [PATCH -next] scsi: hisi_sas: Remove unnecessary print function dev_err()
  2022-02-15  2:05 [PATCH -next] scsi: hisi_sas: Remove unnecessary print function dev_err() Yang Li
  2022-02-15  8:03 ` John Garry
  2022-02-20  1:38 ` Martin K. Petersen
@ 2022-02-28  3:43 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2022-02-28  3:43 UTC (permalink / raw)
  To: Yang Li, jejb
  Cc: Martin K . Petersen, Abaci Robot, linux-scsi, john.garry, linux-kernel

On Tue, 15 Feb 2022 10:05:24 +0800, Yang Li wrote:

> The print function dev_err() is redundant because platform_get_irq()
> already prints an error.
> 
> Eliminate the follow coccicheck warnings:
> ./drivers/scsi/hisi_sas/hisi_sas_v1_hw.c:1661:3-10: line 1661 is
> redundant because platform_get_irq() already prints an error
> ./drivers/scsi/hisi_sas/hisi_sas_v1_hw.c:1642:4-11: line 1642 is
> redundant because platform_get_irq() already prints an error
> ./drivers/scsi/hisi_sas/hisi_sas_v1_hw.c:1679:3-10: line 1679 is
> redundant because platform_get_irq() already prints an error
> 
> [...]

Applied to 5.18/scsi-queue, thanks!

[1/1] scsi: hisi_sas: Remove unnecessary print function dev_err()
      https://git.kernel.org/mkp/scsi/c/07dd40b3078f

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2022-02-28  3:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-15  2:05 [PATCH -next] scsi: hisi_sas: Remove unnecessary print function dev_err() Yang Li
2022-02-15  8:03 ` John Garry
2022-02-20  1:38 ` Martin K. Petersen
2022-02-28  3:43 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).