Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3038225imu; Mon, 19 Nov 2018 09:41:57 -0800 (PST) X-Google-Smtp-Source: AFSGD/UuQ8xpsfhe56NWbSmWpAMiP/Db5QnvEF2IMAbK2c9hvNpfaOBw3sxwA9PSCSPDl67LGngc X-Received: by 2002:a63:5455:: with SMTP id e21mr2007829pgm.316.1542649317117; Mon, 19 Nov 2018 09:41:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542649317; cv=none; d=google.com; s=arc-20160816; b=ZIWTchnvGhF7JRjQ1aQ/1nYCagZbWXVYlrksT0w9wRMR9h1vx8aad1k0QeHJj+5GJP PHJW2suBmfz03dH45tF6Z2KU3HxkLZos+XGMU2rIW4n0FdKGHFlbcAUk+MrC7KPTy+iS h8AIjsQafGhAEjAgZVIJeIlUWZwda4dinjB4OsMflkB4oh9Z29JqT8ialFAeuGavHJtO vBlZ2GZZ/kfYiWUa+pDp3GeZ6kW/x1rnOyITD4z/Wu7dHbrSG9JSYsAVpLiKErKZoQAi GZkJ6QBUL0oQC9aMIL8s3qUo7pEkHw+1j5WGeB0FWT7Xrszs03n++LJBPn0+aYXAk6nH 1YlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=TBj7dfpa+U8h46WD+4NySIE9tsDlf+POa8Goj9njoeE=; b=hwN/jVDQGl+ZIJuN7FP862ogyDsrqThUWUH9+5kxKk9l5GYxss6Wvi3/2s1XqHLxhE b94BYgzsWSiJTamu+m3Cl7t99ib1MJ2kKq5gIYrcz2SVlQCzBfLXpHLtmux39x509kGC 5ko6K3c0PuR23YWZX3E/ffJSzB2/0idDcusHmxD5TkdGvILBsOBrUxrUXqNrn8/lFBKW 7/g7bMHvMJmh9C4jpixOeQzU1Iztqg0Ho5MnmTy8e19IqheM5AdBDdZkSfpp7dxCHYnp UWdVvYFd/FFgJrnDRUd/mLX/RkghbWkeDrUoJTArjESD6dcsPQilLqy8TLPZmoIgCIuW +/+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g8si12562416pgb.128.2018.11.19.09.41.39; Mon, 19 Nov 2018 09:41:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390087AbeKTEEA (ORCPT + 99 others); Mon, 19 Nov 2018 23:04:00 -0500 Received: from mail.bootlin.com ([62.4.15.54]:54123 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388998AbeKTDN4 (ORCPT ); Mon, 19 Nov 2018 22:13:56 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id C8B9420791; Mon, 19 Nov 2018 17:49:42 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.2 Received: from bbrezillon (aaubervilliers-681-1-13-146.w90-88.abo.wanadoo.fr [90.88.134.146]) by mail.bootlin.com (Postfix) with ESMTPSA id 4DF5120D27; Mon, 19 Nov 2018 17:49:26 +0100 (CET) Date: Mon, 19 Nov 2018 17:49:25 +0100 From: Boris Brezillon To: vitor Cc: Colin King , , Subject: Re: [PATCH][i3c-next] i3c: master: fix mask operation by using the correct operator Message-ID: <20181119174925.0733862e@bbrezillon> In-Reply-To: <7d569740-e5d3-b8a6-79cf-9885039e53de@synopsys.com> References: <20181116184223.28240-1-colin.king@canonical.com> <7d569740-e5d3-b8a6-79cf-9885039e53de@synopsys.com> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 19 Nov 2018 12:41:10 +0000 vitor wrote: > Hi Coling, > > > Thanks for your report. > > On 16/11/18 18:42, Colin King wrote: > > From: Colin Ian King > > > > 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 > > --- > > 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); > > > Acked-by: Vitor Soares Applied. Thanks, Boris