Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1654242ybz; Sun, 26 Apr 2020 01:14:34 -0700 (PDT) X-Google-Smtp-Source: APiQypKl3fLshLQtPAluJTz+7CT23oVmFghshR+GJnGlMXTSswwcEZV+nBwq77VWfW7ygTLKEksq X-Received: by 2002:aa7:dac4:: with SMTP id x4mr12826376eds.127.1587888874131; Sun, 26 Apr 2020 01:14:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587888874; cv=none; d=google.com; s=arc-20160816; b=tkUBLohnh7yZGL2cW4LJAggTqVRcAVEiMSv/shW/NdjnzhEUyOnaTSlEhwNw6w9a9x 4s4Ku/fNK+uPqMVIHdlHGDzah/ZHXzP/lZkV3OCnvbIVppEK+U9J3hg7RdaAEQjbzQgk 6t84+3RvNokXInFphthONqcH9ZBN64xyEUniY/EM1ClSi9Z91AZMeSn/X2YvDq7+3Nx7 KRmvUB6/mLnjsSPY43RLG++JK9IB7XaRqUcMtRS1356bhyt5+WGZy3wBBP4NhnOcOu+v 1QE6jM3x+2tbV5lxWsBL+GmVzutKoAm+NYdTrrGEfcFKUvGi3zhzhuj5pnPutI27I77P +AHw== 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 :message-id:date:subject:cc:to:from; bh=g20GxOr0ZrQtUbMEqihEZHqisWlxylfUMgArBDCLh+Y=; b=BaMvjlovPtitlX2z+vj4z9oqOspCBTnBeJep5nYkTpVy2UMSxHhUTEGygReJY0eTa4 +fFTMquV55deN4G+xxxehB5H/k3T3HmhxzZiOPnWmoMark5ouMDy2//TeVRzlup7ZbsG xxJnsYNuL5Bt/6Kq/w4hPDVOz+r6kZ8nsLFxumpRX55v91Xltz6sgWxMc5zYD8jZ8hJ3 6wt6wIExXdinTLTacKd15jV8FFFgvtAESK4x6dGByb8XJ4R/Eezca3LGwMqvkSIEgJqW vmpEuWpOgTawQWB+Fq2vyHlQJpJyIhs1iSpbplM0WlwztE3bVAaotYZCs4E4f9U4ofhj CAvA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gr24si6659145ejb.162.2020.04.26.01.14.10; Sun, 26 Apr 2020 01:14:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726135AbgDZIMS (ORCPT + 99 others); Sun, 26 Apr 2020 04:12:18 -0400 Received: from sauhun.de ([88.99.104.3]:43174 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726112AbgDZIMS (ORCPT ); Sun, 26 Apr 2020 04:12:18 -0400 Received: from localhost (p54B33954.dip0.t-ipconnect.de [84.179.57.84]) by pokefinder.org (Postfix) with ESMTPSA id 304122C01E8; Sun, 26 Apr 2020 10:12:16 +0200 (CEST) From: Wolfram Sang To: linux-i2c@vger.kernel.org Cc: Stefan Wahren , Wolfram Sang , Kamal Dasu , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH RFT] i2c: brcmstb: properly check NACK condition Date: Sun, 26 Apr 2020 10:12:10 +0200 Message-Id: <20200426081211.10876-1-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wolfram Sang cppcheck rightfully complains about: drivers/i2c/busses/i2c-brcmstb.c:319:7: warning: Condition 'CMD_RD' is always true [knownConditionTrueFalse] drivers/i2c/busses/i2c-brcmstb.c:319:17: warning: Condition 'CMD_WR' is always false [knownConditionTrueFalse] if ((CMD_RD || CMD_WR) && Compare the values to the 'cmd' variable. Fixes: dd1aa2524bc5 ("i2c: brcmstb: Add Broadcom settop SoC i2c controller driver") Signed-off-by: Wolfram Sang --- Not tested on HW. drivers/i2c/busses/i2c-brcmstb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-brcmstb.c b/drivers/i2c/busses/i2c-brcmstb.c index d4e0a0f6732a..ba766d24219e 100644 --- a/drivers/i2c/busses/i2c-brcmstb.c +++ b/drivers/i2c/busses/i2c-brcmstb.c @@ -316,7 +316,7 @@ static int brcmstb_send_i2c_cmd(struct brcmstb_i2c_dev *dev, goto cmd_out; } - if ((CMD_RD || CMD_WR) && + if ((cmd == CMD_RD || cmd == CMD_WR) && bsc_readl(dev, iic_enable) & BSC_IIC_EN_NOACK_MASK) { rc = -EREMOTEIO; dev_dbg(dev->device, "controller received NOACK intr for %s\n", -- 2.20.1