* [PATCH] spi: Fix cocci warnings
@ 2023-03-07 1:20 William Zhang
2023-03-07 16:48 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: William Zhang @ 2023-03-07 1:20 UTC (permalink / raw)
To: Linux SPI List, Broadcom Kernel List
Cc: joel.peshkin, dregan, jonas.gorski, dan.beygelman, f.fainelli,
anand.gore, kursad.oney, tomer.yacoby, William Zhang,
kernel test robot, Mark Brown, linux-kernel
cocci reported warning: !A || A && B is equivalent to !A || B. This fix
simplified the condition check to !A || B.
Fixes: 76a85704cb91 ("spi: spi-mem: Allow controller supporting mem_ops without exec_op")
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/oe-kbuild-all/202303010051.HrHWSr9y-lkp@intel.com/
Signed-off-by: William Zhang <william.zhang@broadcom.com>
---
drivers/spi/spi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 798030c0c5ce..503eb04826e7 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -3076,7 +3076,7 @@ static int spi_controller_check_ops(struct spi_controller *ctlr)
* If ->mem_ops or ->mem_ops->exec_op is NULL, we request that at least
* one of the ->transfer_xxx() method be implemented.
*/
- if (!ctlr->mem_ops || (ctlr->mem_ops && !ctlr->mem_ops->exec_op)) {
+ if (!ctlr->mem_ops || !ctlr->mem_ops->exec_op) {
if (!ctlr->transfer && !ctlr->transfer_one &&
!ctlr->transfer_one_message) {
return -EINVAL;
--
2.37.3
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] spi: Fix cocci warnings
2023-03-07 1:20 [PATCH] spi: Fix cocci warnings William Zhang
@ 2023-03-07 16:48 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2023-03-07 16:48 UTC (permalink / raw)
To: Linux SPI List, Broadcom Kernel List, William Zhang
Cc: joel.peshkin, dregan, jonas.gorski, dan.beygelman, f.fainelli,
anand.gore, kursad.oney, tomer.yacoby, kernel test robot,
linux-kernel
On Mon, 06 Mar 2023 17:20:04 -0800, William Zhang wrote:
> cocci reported warning: !A || A && B is equivalent to !A || B. This fix
> simplified the condition check to !A || B.
>
> Fixes: 76a85704cb91 ("spi: spi-mem: Allow controller supporting mem_ops without exec_op")
> Reported-by: kernel test robot <lkp@intel.com>
> Link: https://lore.kernel.org/oe-kbuild-all/202303010051.HrHWSr9y-lkp@intel.com/
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
Thanks!
[1/1] spi: Fix cocci warnings
commit: 20064c47f63e995216e0dfb0a6ea37b653ed534c
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] 2+ messages in thread
end of thread, other threads:[~2023-03-07 16:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-07 1:20 [PATCH] spi: Fix cocci warnings William Zhang
2023-03-07 16:48 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®