Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1288388ybh; Thu, 23 Jul 2020 05:19:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzi5RK1FpHsZwBXAmzk27axDS/q6syfYrEna/SBWYtOQP46HMufJrnSXIwd6RjLQzNx6+ha X-Received: by 2002:aa7:dd14:: with SMTP id i20mr4048161edv.41.1595506780504; Thu, 23 Jul 2020 05:19:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595506780; cv=none; d=google.com; s=arc-20160816; b=VkmFklUN+m09GFVJrt2eP4pyi0QVHWj8ZE6+8ibI+lG2dFWJUr2hUJYnaQltMAhRSW ZlXasoKpUM+AI08xThtl99whMCh7qMTY8B1Hsk9D3uLrRqNIglIHzbXPg7/R+mrT8Jnk sZRojS3sbzgttVgbG2IFbfQqVk5BEb/y2B9/A/vHP773D1/cWq7Vo4A+oxV0nIEyRwve 9r3lJb/2xBNhGVlTOZ6bkatqGSBOM38CcbBiiUyblTmcrpj5ZxtMBSBWZ4pSUdBhPtTD vrhnzqNe2aTy8kYE87cDqbXNG+Sx453aJVTUMo8rwl7gXo7sTGGDsqNvVi8nbgIpT5OB 2Mnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from; bh=fa+P5jAGVjPVirFmB1xYmlo1dz271n97QHWg6liSJZc=; b=MpFFZLs8wuXcmentID3WqaXs5S/4enEKpgCtBIUKr2DWFiyrJHgnz7hjke034r63lH s3jC/NQgVoAj+zXH9ss1+JmrFvH2ugJaz5ak2AX+zFk8HYGnTTxK/B9FfWyIfUi5VPzr gNrTbM9xguO4NcF8uFadxo+UngtitXYfS6WpeYbbyP4zJQ9jtkb86XOiW0Q7IZE12U3S VkvKT6R/hfWpKE32pu9qUI6HM7yMvpvh1AxhCRB+iKmbuGlqJzscqPftGjiAaDB7Nld+ rwEJOA7c6i9anGSc6rZLAdGKVom1w0TwNZZ2hj2r2FjjllxL1sNowuXtjFpaJjb2NJYX XNIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=dqdCbynR; 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=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qt10si1976243ejb.196.2020.07.23.05.19.17; Thu, 23 Jul 2020 05:19:40 -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=@nvidia.com header.s=n1 header.b=dqdCbynR; 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=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728134AbgGWMTI (ORCPT + 99 others); Thu, 23 Jul 2020 08:19:08 -0400 Received: from hqnvemgate25.nvidia.com ([216.228.121.64]:7232 "EHLO hqnvemgate25.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726109AbgGWMTH (ORCPT ); Thu, 23 Jul 2020 08:19:07 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Thu, 23 Jul 2020 05:18:04 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Thu, 23 Jul 2020 05:19:06 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Thu, 23 Jul 2020 05:19:06 -0700 Received: from HQMAIL101.nvidia.com (172.20.187.10) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 23 Jul 2020 12:19:06 +0000 Received: from rnnvemgw01.nvidia.com (10.128.109.123) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Thu, 23 Jul 2020 12:19:06 +0000 Received: from kyarlagadda-linux.nvidia.com (Not Verified[10.19.64.169]) by rnnvemgw01.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Thu, 23 Jul 2020 05:19:05 -0700 From: Krishna Yarlagadda To: , , CC: , , , , , , Krishna Yarlagadda Subject: [PATCH 1/7] i2c: tegra: remove dead code Date: Thu, 23 Jul 2020 17:48:47 +0530 Message-ID: <1595506733-10307-1-git-send-email-kyarlagadda@nvidia.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1595506684; bh=fa+P5jAGVjPVirFmB1xYmlo1dz271n97QHWg6liSJZc=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: MIME-Version:Content-Type:Content-Transfer-Encoding; b=dqdCbynRWBTP0EBgNI6Jsw3LPfIDlnGpA5wTxo6YBYDADj05qQq6N62gGYPQRvode kSOeqaydNeULiJkUJELwwU1WPYuGGJCRnf8YnDMukhubNRerzk+xxiMuauyBHWqd8a +oJGTQOJnvRt6hBMFBEj4TJHpncqJihryRdX372SWX1D4R72sDTqm7nn3Srbh0rcok ecu+okg5mzW5BVQHyTGLzL1LRnz+3DMP4EiKp5KQDbj7RfB7jst0Afcsc9zetFkx63 Dq3A+ZPomsk3pLgRYff5tSxyGaBr3QtJVwD497rROpCjj2/BuG1t06fr2dRVLwNNVs pCQLncIXiqPGw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shardar Shariff Md When I2C_HEADER_CONT_ON_NAK bit in IO header is set then =E2=80=9CNo ACK from slave=E2=80=9D error is not reported (NACK is considered as ACK and transfer is continued). So if I2C_ERR_NO_ACK is set, it would imply I2C_M_IGNORE_NAK is not set and hence this code will never execute. When I2C_HEADER_CONT_ON_NAK bit in IO header is set then =E2=80=9CNo ACK from slave=E2=80=9D error is not reported. Condition (msg->flags & I2C_M_IGNORE_NAK) will never be hit Signed-off-by: Shardar Shariff Md Signed-off-by: Krishna Yarlagadda --- drivers/i2c/busses/i2c-tegra.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.= c index 1577296..c6c870c 100644 --- a/drivers/i2c/busses/i2c-tegra.c +++ b/drivers/i2c/busses/i2c-tegra.c @@ -1336,11 +1336,8 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *= i2c_dev, return -EAGAIN; } =20 - if (i2c_dev->msg_err =3D=3D I2C_ERR_NO_ACK) { - if (msg->flags & I2C_M_IGNORE_NAK) - return 0; + if (i2c_dev->msg_err =3D=3D I2C_ERR_NO_ACK) return -EREMOTEIO; - } =20 return -EIO; } --=20 2.7.4