Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2691542imu; Mon, 19 Nov 2018 04:43:26 -0800 (PST) X-Google-Smtp-Source: AJdET5cAdOFCNWHqHIYS6+Kc/7uJKTLdHox9shhh+Q35bKOTrJGMEKZvH+kc9Ss4jqaeTpGkaVAJ X-Received: by 2002:a63:5907:: with SMTP id n7mr19807182pgb.435.1542631406060; Mon, 19 Nov 2018 04:43:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542631406; cv=none; d=google.com; s=arc-20160816; b=N/SlUhYRm/rehZZLGx5TL/eSCtDghH/r5qfyuEqvptvCLDhZAx4cXoPZIASkKO6hDs 259F6x/LsbGC2bf9HXjYFLznVNpTgUtnSDNyiWEF5KaEYZ+x5jxJ7dZPbuARv6lqxH/f MEQyO3aRV2TE4FKFLY47Ign/uob7bKhxoOyQbT1YuJCg+gM0OzGSK5rLJMFyREfwdGq3 YkdnC8kibS8Jk06BL1cU0IfW6QAcuU5oQoI4pw40QJsff1bs/eq+zwjhuF9Fgi52H/Q0 AUkAfIqZHMd3lNaHbZ85G6hQzbe36pbn8KqizxkdAIpRlbobPGtzR2VQd9hgtGy83fGC pvrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=DTBnJ0ts6dTE62rhxKd0jWIUMQXwJME/fxwJ57jfYFY=; b=ZQlH+QY3I5luQpP4zj56jJgOBgnoNt6SiNP3JFdPeAN0FQqjNFu/+SlGd3t3ucP2WU uWDA3fFpyRFQCiLq4cacgUc/7/p0DjCOnqo3DCNjIg4OdaS7Mkig0SE9KQfA16LpOynB rIcwZw08LZDofS/wV2Pcdggnm2kPbcCvi+1hY6d2m61yHiTM8Vt1looXYtDgy/4Cpwu6 0ao5zVyioZXkqDkQF1QF0tCfPDEq3N00qiS7lxjkYz2KQ6y5WeKCqIhjZdqaAGqUEISR oVYCK9aY4xrxqDl+Tx5yT943KKidjYyIHiMddF1J4FaE+8Bpd9OsrPdsJWC0EGY9dqWD G3Dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=YLPygiRe; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 88-v6si40379866plc.34.2018.11.19.04.43.11; Mon, 19 Nov 2018 04:43:26 -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; dkim=pass header.i=@synopsys.com header.s=mail header.b=YLPygiRe; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728861AbeKSXEt (ORCPT + 99 others); Mon, 19 Nov 2018 18:04:49 -0500 Received: from smtprelay2.synopsys.com ([198.182.60.111]:40292 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728724AbeKSXEt (ORCPT ); Mon, 19 Nov 2018 18:04:49 -0500 Received: from mailhost.synopsys.com (mailhost2.synopsys.com [10.13.184.66]) by smtprelay.synopsys.com (Postfix) with ESMTP id BF76A10C1605; Mon, 19 Nov 2018 04:41:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1542631278; bh=F/lL5bPeEpK1wkZhlwxly1NwJSypToXOf9t0LA+Tm/4=; h=Subject:To:CC:References:From:Date:In-Reply-To:From; b=YLPygiReVpSV8nNFqgslHsFftdYF5/xmsLuFG//NF2FnKupCLUcprA5NaQjvhe5Gx IKhF7QMm7Y5ctjiRopIDw4uKpVavs2hkkpb1BHc6ke669MTfnpTbkI3fs9WbPN2tbz 6pKkOU+WdOynuL0uIYykxNtR0E/bIUDbfwFfjEkOOls27VvxCQAjI8caviGerkN7YP 6GwnklhxzB+r00FBjoz2r7BI+9jLzxXSZLVcyGrdzjSIAf0Q6WCwG355RQKW/bEAEQ WxsMFxm0LDLXRhDKdrepGbWV8zNlpx65aCl7CH5I3iBkyHDGrn3xhpkC5jVhIbJVEW z3yCBv8hgTHdw== Received: from US01WEHTC2.internal.synopsys.com (us01wehtc2.internal.synopsys.com [10.12.239.237]) by mailhost.synopsys.com (Postfix) with ESMTP id 84BE23A1E; Mon, 19 Nov 2018 04:41:18 -0800 (PST) Received: from DE02WEHTCB.internal.synopsys.com (10.225.19.94) by US01WEHTC2.internal.synopsys.com (10.12.239.237) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 19 Nov 2018 04:41:18 -0800 Received: from DE02WEHTCA.internal.synopsys.com (10.225.19.92) by DE02WEHTCB.internal.synopsys.com (10.225.19.94) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 19 Nov 2018 13:41:15 +0100 Received: from [10.0.2.15] (10.107.19.165) by DE02WEHTCA.internal.synopsys.com (10.225.19.80) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 19 Nov 2018 13:41:14 +0100 Subject: Re: [PATCH][i3c-next] i3c: master: fix mask operation by using the correct operator To: Colin King , Vitor Soares , Boris Brezillon CC: , References: <20181116184223.28240-1-colin.king@canonical.com> From: vitor Message-ID: <7d569740-e5d3-b8a6-79cf-9885039e53de@synopsys.com> Date: Mon, 19 Nov 2018 12:41:10 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181116184223.28240-1-colin.king@canonical.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.107.19.165] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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