All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next 2/2] spi: fix platform_no_drv_owner.cocci warning
@ 2022-06-09  5:55 ` Yang Li
  0 siblings, 0 replies; 10+ messages in thread
From: Yang Li @ 2022-06-09  5:55 UTC (permalink / raw)
  To: broonie
  Cc: conor.dooley, lewis.hanly, linux-riscv, linux-spi, linux-kernel,
	Yang Li, Abaci Robot

Remove .owner field if calls are used which set it automatically.

Eliminate the following coccicheck warning:
./drivers/spi/spi-microchip-core.c:624:3-8: No need to set .owner here.
The core will do it.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
 drivers/spi/spi-microchip-core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/spi/spi-microchip-core.c b/drivers/spi/spi-microchip-core.c
index 5b2aee30fa04..3bd285dd4964 100644
--- a/drivers/spi/spi-microchip-core.c
+++ b/drivers/spi/spi-microchip-core.c
@@ -621,7 +621,6 @@ static struct platform_driver mchp_corespi_driver = {
 		.name = "microchip-corespi",
 		.pm = MICROCHIP_SPI_PM_OPS,
 		.of_match_table = of_match_ptr(mchp_corespi_dt_ids),
-		.owner = THIS_MODULE,
 	},
 	.remove = mchp_corespi_remove,
 };
-- 
2.20.1.7.g153144c


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

* [PATCH -next 2/2] spi: fix platform_no_drv_owner.cocci warning
@ 2022-06-09  5:55 ` Yang Li
  0 siblings, 0 replies; 10+ messages in thread
From: Yang Li @ 2022-06-09  5:55 UTC (permalink / raw)
  To: broonie
  Cc: conor.dooley, lewis.hanly, linux-riscv, linux-spi, linux-kernel,
	Yang Li, Abaci Robot

Remove .owner field if calls are used which set it automatically.

Eliminate the following coccicheck warning:
./drivers/spi/spi-microchip-core.c:624:3-8: No need to set .owner here.
The core will do it.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
 drivers/spi/spi-microchip-core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/spi/spi-microchip-core.c b/drivers/spi/spi-microchip-core.c
index 5b2aee30fa04..3bd285dd4964 100644
--- a/drivers/spi/spi-microchip-core.c
+++ b/drivers/spi/spi-microchip-core.c
@@ -621,7 +621,6 @@ static struct platform_driver mchp_corespi_driver = {
 		.name = "microchip-corespi",
 		.pm = MICROCHIP_SPI_PM_OPS,
 		.of_match_table = of_match_ptr(mchp_corespi_dt_ids),
-		.owner = THIS_MODULE,
 	},
 	.remove = mchp_corespi_remove,
 };
-- 
2.20.1.7.g153144c


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* [PATCH -next 1/2] spi: Remove unnecessary print function dev_err()
  2022-06-09  5:55 ` Yang Li
@ 2022-06-09  5:55   ` Yang Li
  -1 siblings, 0 replies; 10+ messages in thread
From: Yang Li @ 2022-06-09  5:55 UTC (permalink / raw)
  To: broonie
  Cc: conor.dooley, lewis.hanly, linux-riscv, linux-spi, linux-kernel,
	Yang Li, Abaci Robot

The function platform_get_irq() never returns 0, and the print function
dev_err() is redundant because platform_get_irq() already prints an error.

Eliminate the follow coccicheck warning:
./drivers/spi/spi-microchip-core.c:543:2-9: line 543 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/spi/spi-microchip-core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/spi/spi-microchip-core.c b/drivers/spi/spi-microchip-core.c
index 3bd285dd4964..d8ae25ccffa8 100644
--- a/drivers/spi/spi-microchip-core.c
+++ b/drivers/spi/spi-microchip-core.c
@@ -539,8 +539,7 @@ static int mchp_corespi_probe(struct platform_device *pdev)
 	}
 
 	spi->irq = platform_get_irq(pdev, 0);
-	if (spi->irq <= 0) {
-		dev_err(&pdev->dev, "invalid IRQ %d for SPI controller\n", spi->irq);
+	if (spi->irq < 0) {
 		ret = spi->irq;
 		goto error_release_master;
 	}
-- 
2.20.1.7.g153144c


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

* [PATCH -next 1/2] spi: Remove unnecessary print function dev_err()
@ 2022-06-09  5:55   ` Yang Li
  0 siblings, 0 replies; 10+ messages in thread
From: Yang Li @ 2022-06-09  5:55 UTC (permalink / raw)
  To: broonie
  Cc: conor.dooley, lewis.hanly, linux-riscv, linux-spi, linux-kernel,
	Yang Li, Abaci Robot

The function platform_get_irq() never returns 0, and the print function
dev_err() is redundant because platform_get_irq() already prints an error.

Eliminate the follow coccicheck warning:
./drivers/spi/spi-microchip-core.c:543:2-9: line 543 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/spi/spi-microchip-core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/spi/spi-microchip-core.c b/drivers/spi/spi-microchip-core.c
index 3bd285dd4964..d8ae25ccffa8 100644
--- a/drivers/spi/spi-microchip-core.c
+++ b/drivers/spi/spi-microchip-core.c
@@ -539,8 +539,7 @@ static int mchp_corespi_probe(struct platform_device *pdev)
 	}
 
 	spi->irq = platform_get_irq(pdev, 0);
-	if (spi->irq <= 0) {
-		dev_err(&pdev->dev, "invalid IRQ %d for SPI controller\n", spi->irq);
+	if (spi->irq < 0) {
 		ret = spi->irq;
 		goto error_release_master;
 	}
-- 
2.20.1.7.g153144c


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH -next 1/2] spi: Remove unnecessary print function dev_err()
  2022-06-09  5:55   ` Yang Li
@ 2022-06-09 10:55     ` Mark Brown
  -1 siblings, 0 replies; 10+ messages in thread
From: Mark Brown @ 2022-06-09 10:55 UTC (permalink / raw)
  To: Yang Li
  Cc: conor.dooley, lewis.hanly, linux-riscv, linux-spi, linux-kernel,
	Abaci Robot

[-- Attachment #1: Type: text/plain, Size: 300 bytes --]

On Thu, Jun 09, 2022 at 01:55:33PM +0800, Yang Li wrote:
> The function platform_get_irq() never returns 0, and the print function
> dev_err() is redundant because platform_get_irq() already prints an error.

Are you sure it never returns 0?  Note that 0 is a valid IRQ number on
some architectures.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH -next 1/2] spi: Remove unnecessary print function dev_err()
@ 2022-06-09 10:55     ` Mark Brown
  0 siblings, 0 replies; 10+ messages in thread
From: Mark Brown @ 2022-06-09 10:55 UTC (permalink / raw)
  To: Yang Li
  Cc: conor.dooley, lewis.hanly, linux-riscv, linux-spi, linux-kernel,
	Abaci Robot


[-- Attachment #1.1: Type: text/plain, Size: 300 bytes --]

On Thu, Jun 09, 2022 at 01:55:33PM +0800, Yang Li wrote:
> The function platform_get_irq() never returns 0, and the print function
> dev_err() is redundant because platform_get_irq() already prints an error.

Are you sure it never returns 0?  Note that 0 is a valid IRQ number on
some architectures.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 161 bytes --]

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: (subset) [PATCH -next 1/2] spi: Remove unnecessary print function dev_err()
  2022-06-09  5:55   ` Yang Li
@ 2022-06-09 14:13     ` Mark Brown
  -1 siblings, 0 replies; 10+ messages in thread
From: Mark Brown @ 2022-06-09 14:13 UTC (permalink / raw)
  To: yang.lee
  Cc: abaci, lewis.hanly, linux-spi, linux-kernel, conor.dooley, linux-riscv

On Thu, 9 Jun 2022 13:55:33 +0800, Yang Li wrote:
> The function platform_get_irq() never returns 0, and the print function
> dev_err() is redundant because platform_get_irq() already prints an error.
> 
> Eliminate the follow coccicheck warning:
> ./drivers/spi/spi-microchip-core.c:543:2-9: line 543 is redundant
> because platform_get_irq() already prints an error
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[2/2] spi: fix platform_no_drv_owner.cocci warning
      commit: a4f26ba2608c9ff736a9ad1348aa8078f0b03f81

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

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

* Re: (subset) [PATCH -next 1/2] spi: Remove unnecessary print function dev_err()
@ 2022-06-09 14:13     ` Mark Brown
  0 siblings, 0 replies; 10+ messages in thread
From: Mark Brown @ 2022-06-09 14:13 UTC (permalink / raw)
  To: yang.lee
  Cc: abaci, lewis.hanly, linux-spi, linux-kernel, conor.dooley, linux-riscv

On Thu, 9 Jun 2022 13:55:33 +0800, Yang Li wrote:
> The function platform_get_irq() never returns 0, and the print function
> dev_err() is redundant because platform_get_irq() already prints an error.
> 
> Eliminate the follow coccicheck warning:
> ./drivers/spi/spi-microchip-core.c:543:2-9: line 543 is redundant
> because platform_get_irq() already prints an error
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[2/2] spi: fix platform_no_drv_owner.cocci warning
      commit: a4f26ba2608c9ff736a9ad1348aa8078f0b03f81

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH -next 1/2] spi: Remove unnecessary print function dev_err()
  2022-06-09 10:55     ` Mark Brown
@ 2022-06-09 15:15       ` Conor.Dooley
  -1 siblings, 0 replies; 10+ messages in thread
From: Conor.Dooley @ 2022-06-09 15:15 UTC (permalink / raw)
  To: broonie, yang.lee
  Cc: Conor.Dooley, Lewis.Hanly, linux-riscv, linux-spi, linux-kernel, abaci

On 09/06/2022 11:55, Mark Brown wrote:
> On Thu, Jun 09, 2022 at 01:55:33PM +0800, Yang Li wrote:
>> The function platform_get_irq() never returns 0, and the print function
>> dev_err() is redundant because platform_get_irq() already prints an error.
> 
> Are you sure it never returns 0?  Note that 0 is a valid IRQ number on
> some architectures.

If anything, I think I need to go in the other direction and make sure
that in my i2c and pwm drivers I also check for zero - it's an FPGA
after all.

Thanks,
Conor.

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

* Re: [PATCH -next 1/2] spi: Remove unnecessary print function dev_err()
@ 2022-06-09 15:15       ` Conor.Dooley
  0 siblings, 0 replies; 10+ messages in thread
From: Conor.Dooley @ 2022-06-09 15:15 UTC (permalink / raw)
  To: broonie, yang.lee
  Cc: Conor.Dooley, Lewis.Hanly, linux-riscv, linux-spi, linux-kernel, abaci

On 09/06/2022 11:55, Mark Brown wrote:
> On Thu, Jun 09, 2022 at 01:55:33PM +0800, Yang Li wrote:
>> The function platform_get_irq() never returns 0, and the print function
>> dev_err() is redundant because platform_get_irq() already prints an error.
> 
> Are you sure it never returns 0?  Note that 0 is a valid IRQ number on
> some architectures.

If anything, I think I need to go in the other direction and make sure
that in my i2c and pwm drivers I also check for zero - it's an FPGA
after all.

Thanks,
Conor.
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

end of thread, other threads:[~2022-06-09 15:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-09  5:55 [PATCH -next 2/2] spi: fix platform_no_drv_owner.cocci warning Yang Li
2022-06-09  5:55 ` Yang Li
2022-06-09  5:55 ` [PATCH -next 1/2] spi: Remove unnecessary print function dev_err() Yang Li
2022-06-09  5:55   ` Yang Li
2022-06-09 10:55   ` Mark Brown
2022-06-09 10:55     ` Mark Brown
2022-06-09 15:15     ` Conor.Dooley
2022-06-09 15:15       ` Conor.Dooley
2022-06-09 14:13   ` (subset) " Mark Brown
2022-06-09 14:13     ` Mark Brown

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.