Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp404825pxb; Wed, 3 Mar 2021 06:20:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJwt4hwstPrBvPX6tBvspoF06AMnUGuwsQxhL5hK8E0xOYYghmFaa83im71RsX3H97KIQmID X-Received: by 2002:aa7:c356:: with SMTP id j22mr324568edr.109.1614781202433; Wed, 03 Mar 2021 06:20:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614781202; cv=none; d=google.com; s=arc-20160816; b=OlFTnaw38JyeZ4iayIjC4JPDbtGu5+ksTGor770ms0hHGys+/YrcIwBbg4o/SeZKHU eXnkQsQk7ZVPhEjYNIODk+6/mduReYmKVzNQQPTUEHfdHlrsJXkp9pxr1KGUMHulOWQa URpcWLuWvNEJgeqgMt9T1oH8rHhow4HIBuYsdcjyd32oxM3vmnyeyD5xrvyHHftp9s0L nmnAJlH9qpAeoISY2nQlTbrUklhoIsKFqYlIL7x6oj+od3dPk6T7zhYWkKhL25a+pk7l xoZzZ4NII3irJDM+RN7bSeG01vzwfp3kvOnXaLR/cFuhp0fckzXwLxArPKQ/cQxuWSz0 NF4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Y3DsbW6bT4ongNhuZsn8qHSvQRFnPO2wBHqmzFTpJLY=; b=XrbrLppmY/Sa/AmR+h7tFlvxADKdW379+gYT31kMNqa30IsZlhmGpD/8wIyAkpeTRY fil+ffWQ2i+yqsn3R+O70bKO/mR/oFzUFC+NLo++t1HpCOzfq0IDLf1PaR+9wugsy2j0 Hnre2mtPl0VbQtxz0/jinon6Uju6wcVHPulBIxTX331emogYZZzzhq3rkVKBqhj5hxgJ P2PSfdIaatVZAf0ddJxQ7n998xsbGemFyB7YYyqPfsDzKl0wX2P2ezCAcKyscv2BdXEM KQ23D06ryi+VEj+sEEHL/dxPiONb7m/aBrqwzGffJGa6WXPOujKlOYvco4AZJ6MTdSWR F68Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QXCsDbeo; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id se21si10636139ejb.558.2021.03.03.06.19.34; Wed, 03 Mar 2021 06:20:02 -0800 (PST) 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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QXCsDbeo; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244071AbhCAVDV (ORCPT + 99 others); Mon, 1 Mar 2021 16:03:21 -0500 Received: from mail.kernel.org ([198.145.29.99]:46318 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237548AbhCARMR (ORCPT ); Mon, 1 Mar 2021 12:12:17 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id B6E1A65023; Mon, 1 Mar 2021 16:43:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614617023; bh=Z63VApUmDYyFtduQAowoytzZUocTAgtZM8Z0lSVh0nc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QXCsDbeonDGD5IP+DCskSG1Q4AZ6hlXVhxxylTmo267fZsSJ2MAC1Gt6MFqK5ygtI bnk0jMlEPNJZn8DjXkdgUyKdPS0U8d+LGRffSediLYn04FpBWTc+a7kFV+QoQFtbO6 G0r43TI42to9o89Yh5SLDGi7GsI3+8HDnEGrxPfU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dave Stevenson , Maxime Ripard , Florian Fainelli , Wolfram Sang , Sasha Levin Subject: [PATCH 4.19 175/247] i2c: brcmstb: Fix brcmstd_send_i2c_cmd condition Date: Mon, 1 Mar 2021 17:13:15 +0100 Message-Id: <20210301161040.223627067@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161031.684018251@linuxfoundation.org> References: <20210301161031.684018251@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Maxime Ripard [ Upstream commit a1858ce0cfe31368b23ba55794e409fb57ced4a4 ] The brcmstb_send_i2c_cmd currently has a condition that is (CMD_RD || CMD_WR) which always evaluates to true, while the obvious fix is to test whether the cmd variable passed as parameter holds one of these two values. Fixes: dd1aa2524bc5 ("i2c: brcmstb: Add Broadcom settop SoC i2c controller driver") Reported-by: Dave Stevenson Signed-off-by: Maxime Ripard Acked-by: Florian Fainelli Signed-off-by: Wolfram Sang Signed-off-by: Sasha Levin --- 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 826d320499961..2086a96307bf9 100644 --- a/drivers/i2c/busses/i2c-brcmstb.c +++ b/drivers/i2c/busses/i2c-brcmstb.c @@ -318,7 +318,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.27.0