public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Colin King <colin.king@canonical.com>
To: Vitor Soares <vitor.soares@synopsys.com>,
	Boris Brezillon <boris.brezillon@bootlin.com>
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH][i3c-next] i3c: master: fix mask operation by using the correct operator
Date: Fri, 16 Nov 2018 18:42:23 +0000	[thread overview]
Message-ID: <20181116184223.28240-1-colin.king@canonical.com> (raw)

From: Colin Ian King <colin.king@canonical.com>

The masking operation on status is using a bitwise 'or' rather than
a bitwise 'and' operator, and hence the result is always non-zero
which is probably not what is intended. Fix this by using the correct
operator.

Detected by CoverityScan, CID#1475523 ("Wrong operator used")

Fixes: 88acc98a712a ("i3c: master: Add driver for Synopsys DesignWare IP")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/i3c/master/dw-i3c-master.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
index 0153e6e9de52..b532e2c9cf5c 100644
--- a/drivers/i3c/master/dw-i3c-master.c
+++ b/drivers/i3c/master/dw-i3c-master.c
@@ -1085,7 +1085,7 @@ static irqreturn_t dw_i3c_master_irq_handler(int irq, void *dev_id)
 
 	spin_lock(&master->xferqueue.lock);
 	dw_i3c_master_end_xfer_locked(master, status);
-	if (status | INTR_TRANSFER_ERR_STAT)
+	if (status & INTR_TRANSFER_ERR_STAT)
 		writel(INTR_TRANSFER_ERR_STAT, master->regs + INTR_STATUS);
 	spin_unlock(&master->xferqueue.lock);
 
-- 
2.19.1

             reply	other threads:[~2018-11-16 18:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-16 18:42 Colin King [this message]
2018-11-19 12:41 ` [PATCH][i3c-next] i3c: master: fix mask operation by using the correct operator vitor
2018-11-19 16:49   ` Boris Brezillon

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=20181116184223.28240-1-colin.king@canonical.com \
    --to=colin.king@canonical.com \
    --cc=boris.brezillon@bootlin.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vitor.soares@synopsys.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