Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4186352pxk; Tue, 8 Sep 2020 12:58:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztJEVReNhUTg4HXSG6NafTUy7bWKmjdee555rZBkGUBrZTXK9dGMpjM4DtgAQO0iXSGLQA X-Received: by 2002:a17:906:e4c:: with SMTP id q12mr68612eji.425.1599595132261; Tue, 08 Sep 2020 12:58:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599595132; cv=none; d=google.com; s=arc-20160816; b=kE/I7tUw5513YIdPAF1VffFDIZ1BLYD5g+16/OnFccEuVYjXmzdTIehjB3nTmmsksX mXqFKFKaucn6Aj5SEQK7pDtSTS5X3Eme9wKPoEaKAjP7xa19mYiTxq58ZanKglSjhnxZ Ldqb89C8ffSLVk+MNqvS8uGzqFXP3Rmy9vi3jbVOMuFEjG48p2ekwrJ8KunH3h7i9Mbg oP+PEYLOEyjBOxFJYQJ7DZuI/VFF+y/29u+b8O+JoiHsDAuMHtAEdwh8aaKDieSM14Rb i0YTXpd75UhyMANv4H/A3/MfPIK61ozZthPbDDbEbI5MzGYFrSeBQUdznAS/+N7id/4B Wo5g== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=4HPa8XWIXVc0UC28mF9vfEk3jbPySdxlAHC5WdmvDng=; b=cJmYxxkBaxjNmYbH7QjCM+7nuIL2wRjiga3P821lUwz5Ky5TL/pBQNXTSgR3MG5QYN mNQy1HHGvnpEp4UxhTwnDT2swo3wJ+nPyNs07iRpDIjOGierHpEiY+aQwu7HlOcaOcrd Z9r696IpdrayAknYwOggECZSjvyboTyLmwgIF9VbLR2L/j50scduZphz4KYjq0HLkFdl ZlOKTyhHLv6iEE3S5Vha9GXPM4Wjn/p+KX5pvMHGIpTZVH68EAh5V4pcSRLHvI7fyg+o MA9HSmYakHuKQv0ojcv+MZAtZKP8FJ1G+p13VISLdsIxAxe224ZOIKZuME+eGmmbz0Dg Eacw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XruphBz3; 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=fail (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 r20si22669ejc.678.2020.09.08.12.58.29; Tue, 08 Sep 2020 12:58:52 -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; dkim=pass header.i=@kernel.org header.s=default header.b=XruphBz3; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732416AbgIHT5p (ORCPT + 99 others); Tue, 8 Sep 2020 15:57:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:60646 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730550AbgIHPfu (ORCPT ); Tue, 8 Sep 2020 11:35:50 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E7ABB2253A; Tue, 8 Sep 2020 15:35:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599579306; bh=d5CrpnaLe/hzDWsm51N0bFeSs/nJtCjmHu60f90JOmk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XruphBz39kWy3UDqzhZ51I/LYHFzbs6tF04ff40rBgl5aBPJVJCrRzK4xECGfBkvF CzzY/ouHwxOSJiGDyGdgbJhFUbAKJchV7ja0Fy4HLinxTYy+A2o1UjWiFCxOxJ1gS7 HsuDn+2E+AeRKsTG2LbF7rTug39hiR9ntQLbIyrs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wolfram Sang , Ray Jui , Florian Fainelli , Sasha Levin Subject: [PATCH 5.8 023/186] i2c: iproc: Fix shifting 31 bits Date: Tue, 8 Sep 2020 17:22:45 +0200 Message-Id: <20200908152242.780369073@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200908152241.646390211@linuxfoundation.org> References: <20200908152241.646390211@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ray Jui [ Upstream commit 0204081128d582965e9e39ca83ee6e4f7d27142b ] Fix undefined behaviour in the iProc I2C driver by using 'BIT' marcro. Reported-by: Wolfram Sang Signed-off-by: Ray Jui Acked-by: Florian Fainelli [wsa: in commit msg, don't say 'checkpatch' but name the issue] Signed-off-by: Wolfram Sang Signed-off-by: Sasha Levin --- drivers/i2c/busses/i2c-bcm-iproc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-bcm-iproc.c b/drivers/i2c/busses/i2c-bcm-iproc.c index 688e928188214..d8295b1c379d1 100644 --- a/drivers/i2c/busses/i2c-bcm-iproc.c +++ b/drivers/i2c/busses/i2c-bcm-iproc.c @@ -720,7 +720,7 @@ static int bcm_iproc_i2c_xfer_internal(struct bcm_iproc_i2c_dev *iproc_i2c, /* mark the last byte */ if (!process_call && (i == msg->len - 1)) - val |= 1 << M_TX_WR_STATUS_SHIFT; + val |= BIT(M_TX_WR_STATUS_SHIFT); iproc_i2c_wr_reg(iproc_i2c, M_TX_OFFSET, val); } @@ -738,7 +738,7 @@ static int bcm_iproc_i2c_xfer_internal(struct bcm_iproc_i2c_dev *iproc_i2c, */ addr = i2c_8bit_addr_from_msg(msg); /* mark it the last byte out */ - val = addr | (1 << M_TX_WR_STATUS_SHIFT); + val = addr | BIT(M_TX_WR_STATUS_SHIFT); iproc_i2c_wr_reg(iproc_i2c, M_TX_OFFSET, val); } -- 2.25.1