mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: William Zhang <william.zhang@broadcom.com>
To: Linux SPI List <linux-spi@vger.kernel.org>,
	Broadcom Kernel List <bcm-kernel-feedback-list@broadcom.com>
Cc: joel.peshkin@broadcom.com, dregan@mail.com,
	jonas.gorski@gmail.com, dan.beygelman@broadcom.com,
	f.fainelli@gmail.com, anand.gore@broadcom.com,
	kursad.oney@broadcom.com, tomer.yacoby@broadcom.com,
	William Zhang <william.zhang@broadcom.com>,
	kernel test robot <lkp@intel.com>,
	Mark Brown <broonie@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] spi: Fix cocci warnings
Date: Mon,  6 Mar 2023 17:20:04 -0800	[thread overview]
Message-ID: <20230307012004.414502-1-william.zhang@broadcom.com> (raw)

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


             reply	other threads:[~2023-03-07  1:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-07  1:20 William Zhang [this message]
2023-03-07 16:48 ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230307012004.414502-1-william.zhang@broadcom.com \
    --to=william.zhang@broadcom.com \
    --cc=anand.gore@broadcom.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=broonie@kernel.org \
    --cc=dan.beygelman@broadcom.com \
    --cc=dregan@mail.com \
    --cc=f.fainelli@gmail.com \
    --cc=joel.peshkin@broadcom.com \
    --cc=jonas.gorski@gmail.com \
    --cc=kursad.oney@broadcom.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=tomer.yacoby@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®