spi: fix platform_no_drv_owner.cocci warning
PATCH 2/2 spi: fix platform_no_drv_owner.cocci warning
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.
--- drivers/spi/spi-microchip-core.c | 1 - 1 file changed, 1 deletion(-)
drivers/spi/spi-microchip-core.c +0 -1
@@ -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, };
Signature · 1 line
2.20.1.7.g153144c
PATCH 1/2 spi: Remove unnecessary print function dev_err()
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
--- drivers/spi/spi-microchip-core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/spi/spi-microchip-core.c +1 -2
@@ -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; }
Signature · 1 line
2.20.1.7.g153144c
Mark Brown
maintainerRe: [PATCH -next 1/2] spi: Remove unnecessary print function dev_err()
Quoted 2 lines · Yang Li
The function
platform_get_irq()never returns 0, and the print functiondev_err()is redundant becauseplatform_get_irq()already prints an error.
Are you sure it never returns 0? Note that 0 is a valid IRQ number on some architectures.
Re: [PATCH -next 1/2] spi: Remove unnecessary print function dev_err()
Quoted 6 lines · Mark Brown
Quoted 2 lines · Yang Li
The function
platform_get_irq()never returns 0, and the print functiondev_err()is redundant becauseplatform_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.
Mark Brown
maintainerRe: (subset) [PATCH -next 1/2] spi: Remove unnecessary print function dev_err()
In reply to Yang LiQuoted 8 lines · Yang Li
The function
platform_get_irq()never returns 0, and the print functiondev_err()is redundant becauseplatform_get_irq()already prints an error.Eliminate the follow coccicheck warning:
./drivers/spi/spi-microchip-core.c:543:2-9: line 543 is redundant becauseplatform_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