From patchwork Fri Aug 22 14:22:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 4765271 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4B8859F2E8 for ; Fri, 22 Aug 2014 14:22:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7E07B2013A for ; Fri, 22 Aug 2014 14:22:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AF1C0200DF for ; Fri, 22 Aug 2014 14:22:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756366AbaHVOWq (ORCPT ); Fri, 22 Aug 2014 10:22:46 -0400 Received: from mail-la0-f52.google.com ([209.85.215.52]:52953 "EHLO mail-la0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756329AbaHVOWp (ORCPT ); Fri, 22 Aug 2014 10:22:45 -0400 Received: by mail-la0-f52.google.com with SMTP id b17so10152746lan.11 for ; Fri, 22 Aug 2014 07:22:44 -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=wTykBBJvoO8SFsxIGHSIRJTv7KitDVjLy5600VYgApg=; b=e6xdEYo4qgL27JL54L1GKAbpM4jA1ujzFZlqtHf0DPpOTf9//I9SiZa9vyXsd+xIsQ fv29sZVvWoxBG1Ly4OPm8dqB+OVX3WeWo5SLkoBuld0JI96jmQpyeqC28jJEnujSvjYD CE7ZkYeuLJyiqV5kZPFFEP1BFNFfoZT4DuPK0MoTN4e8G+yyU1X4T/rR1CoZPvQLWDUx 9x/y+jrq2NfYimrUTnGBWWQLc5yZB0GQadInxJpEtyEQmlmCJi4ZXaXSiCR1J8m8ovlO DEqYbxz0n8EleWaA2og5dXpxExTBL3UL502VtcwLnL5BNKKkiVdQxZ/dlKj/u4kJQSYF m1Bg== X-Gm-Message-State: ALoCoQlkeuyNVdV9etuKp5XbOHPg8zZ4OwWSigbyY3JLG+kROdFIPlQ0IvXEL+PSREcYaxslW6lJ X-Received: by 10.112.42.167 with SMTP id p7mr3194489lbl.83.1408717364316; Fri, 22 Aug 2014 07:22:44 -0700 (PDT) Received: from wasted.cogentembedded.com (ppp26-47.pppoe.mtu-net.ru. [81.195.26.47]) by mx.google.com with ESMTPSA id a1sm18284938lak.45.2014.08.22.07.22.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Aug 2014 07:22:42 -0700 (PDT) From: Sergei Shtylyov To: wsa@the-dreams.de, linux-i2c@vger.kernel.org Cc: linux-sh@vger.kernel.org Subject: [PATCH 1/3] i2c-rcar: simplify check for last message Date: Fri, 22 Aug 2014 18:22:41 +0400 Message-ID: <88047351.0D2gRUkLKi@wasted.cogentembedded.com> Organization: Cogent Embedded Inc. User-Agent: KMail/4.13.3 (Linux/3.15.10-200.fc20.x86_64; KDE/4.13.3; x86_64; ; ) In-Reply-To: <32018817.zX4x1fdR4T@wasted.cogentembedded.com> References: <32018817.zX4x1fdR4T@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.6 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 --- 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 @@ -432,7 +432,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);