From patchwork Sun Sep 14 20:14:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 4902361 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2EB20BEEA5 for ; Sun, 14 Sep 2014 21:10:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 62C8720220 for ; Sun, 14 Sep 2014 21:10:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 69337201FB for ; Sun, 14 Sep 2014 21:10:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752907AbaINVKM (ORCPT ); Sun, 14 Sep 2014 17:10:12 -0400 Received: from mail-we0-f182.google.com ([74.125.82.182]:38590 "EHLO mail-we0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752905AbaINVKK (ORCPT ); Sun, 14 Sep 2014 17:10:10 -0400 Received: by mail-we0-f182.google.com with SMTP id k48so3060620wev.27 for ; Sun, 14 Sep 2014 14:10:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=2cz8jeB+kRLrnDoJIpqtHku3tXheb776NgwZGwQgPyE=; b=etbE7piuR0W37lI+r+A445pgInpoWnt6dXTAhcrqzPbjHGpiJvZjZ8I5h00ct2swlU fDRsunegJFY4kpDKlYsuSSLjGY7GQbzTbQw9thVPJZ/QDcjSCXSlunOZd/0n0m2uF48r h7Y0mHUpp9AqrXf1WhbDgnAFYxmRPbDLvbEYXPzzYuAPw2hc9vHetuIed7LtKougz/Ue 0z0JNhixclgLb3UsZut6AghxfwwaMcR6stybQ/JZHKfzYhQ0jpOoh+sJalDGpz4ExLYS /iA0A6dSB+rEnlIyV3auV+9xeDmzOD6i+3wr0PBI8ZHF0YBOZWydwBz6ACOx5wNXQ6gw BhYw== X-Gm-Message-State: ALoCoQk4fc9pmmbhXVu6Ipm32tHYIiICXR5Md8UpTdlii1j/QD0/XsR4vy937bhARLgknLduAgYB X-Received: by 10.180.19.233 with SMTP id i9mr18260280wie.17.1410729009560; Sun, 14 Sep 2014 14:10:09 -0700 (PDT) Received: from wasted.cogentembedded.com (80.178.206.101.adsl.012.net.il. [80.178.206.101]) by mx.google.com with ESMTPSA id ju1sm12512620wjc.1.2014.09.14.14.10.08 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Sep 2014 14:10:08 -0700 (PDT) From: Sergei Shtylyov To: wsa@the-dreams.de, linux-i2c@vger.kernel.org Cc: linux-sh@vger.kernel.org Subject: [PATCH v2 1/3] i2c-rcar: simplify check for last message Date: Mon, 15 Sep 2014 00:14:14 +0400 Message-ID: <1757193.42K2JNstnx@wasted.cogentembedded.com> Organization: Cogent Embedded Inc. User-Agent: KMail/4.13.3 (Linux/3.15.10-201.fc20.x86_64; KDE/4.13.3; x86_64; ; ) In-Reply-To: <2245366.q99HVYG3pL@wasted.cogentembedded.com> References: <2245366.q99HVYG3pL@wasted.cogentembedded.com> MIME-Version: 1.0 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP rcar_i2c_master_xfer() needlessly compares the message pointers (using indirect addressing) in order to detect the last I2C message, while it's enough to only compare the message indexes. Signed-off-by: Sergei Shtylyov --- Changes in version 2: - refreshed patch. drivers/i2c/busses/i2c-rcar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux/drivers/i2c/busses/i2c-rcar.c =================================================================== --- linux.orig/drivers/i2c/busses/i2c-rcar.c +++ linux/drivers/i2c/busses/i2c-rcar.c @@ -453,7 +453,7 @@ static int rcar_i2c_master_xfer(struct i priv->msg = &msgs[i]; priv->pos = 0; priv->flags = 0; - if (priv->msg == &msgs[num - 1]) + if (i == num - 1) rcar_i2c_flags_set(priv, ID_LAST_MSG); ret = rcar_i2c_prepare_msg(priv);