summaryrefslogtreecommitdiff
path: root/drivers/spi/spi.c
diff options
context:
space:
mode:
authorWilliam Zhang <william.zhang@broadcom.com>2023-03-07 04:20:04 +0300
committerMark Brown <broonie@kernel.org>2023-03-07 16:58:41 +0300
commit20064c47f63e995216e0dfb0a6ea37b653ed534c (patch)
treedcba6ea2a57a7e7a74e0ecf37b92bc273c99d519 /drivers/spi/spi.c
parentdc2eb79496322d5f4790d38776c487bf7aa69be3 (diff)
downloadlinux-20064c47f63e995216e0dfb0a6ea37b653ed534c.tar.xz
spi: Fix cocci warnings
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> Link: https://lore.kernel.org/r/20230307012004.414502-1-william.zhang@broadcom.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi.c')
-rw-r--r--drivers/spi/spi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 295d02e7f0a8..c725b4bab7af 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;