From patchwork Fri Mar 17 18:17:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 9631151 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6E845602D6 for ; Fri, 17 Mar 2017 18:18:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A1D5284CB for ; Fri, 17 Mar 2017 18:18:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5EDCB2852D; Fri, 17 Mar 2017 18:18:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 780AC285EB for ; Fri, 17 Mar 2017 18:18:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751262AbdCQSSE (ORCPT ); Fri, 17 Mar 2017 14:18:04 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:34544 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751047AbdCQSSD (ORCPT ); Fri, 17 Mar 2017 14:18:03 -0400 Received: by mail-pg0-f67.google.com with SMTP id b5so11146613pgg.1 for ; Fri, 17 Mar 2017 11:18:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=JA47ovqX+L5HtgAwmwaya4yHaVLXR1ycCMOkwb88P3o=; b=abHfXW5vDPfS2dLp7ietcYgasOLKTgBgZc2uDCkNff/J76DurEn7lRdUXmV3sp+mOF mOBvyf0+IfhM2IPlrRlrBndNJQgzmjxM0UHUC0HVvTIzTcKRcNvIMlUEQ5F1FDplZ5kb 7W0hU/cYVyd952yqmx4t7ZZqEHK9zv5sUeN/MQzq0T5ODj5cq1VzInOWq7GzXxvSy8IX 6M4KM/z/P85IX+4bYqc64etczfYfpIYYbIznTwXXwu8XRC2apAMq6vgM+1Kil2ojfyP8 VMEzPakGwGIuOXFkpH1ggl6BkXHNO+nYV/QD5tys4BpZvUmHk5KRa1PYjUAbmEDbxWsl x2tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=JA47ovqX+L5HtgAwmwaya4yHaVLXR1ycCMOkwb88P3o=; b=elu2aUeixqLORKWB4UJWT4g3PY5lV3xfeUlSjXi0YC6fdnN2OxZYce2qiwjdL4e1MT sU0pKoVZImD9wKNUUJ9PchY7gLnGaaJFRiVlT8icA52qndGIYe5zankWQekkb03UX6OC qfwBCwELX3T0lYkZ/48w7xUcyeHoVMwr85LkUakxmR+uZzGITsLJxyoBJR1NYYp21dLl /lbeU7TSnSf5PQiBVCg0rjzXFwbeaghAx8KKAxWRGWIoFIbJZk7mxEXA1WqlpUAFiua4 OxjJBstSjVoG0mZRnHA2ura4W+r6BxJvicwR3L2P3VMCtQWqU+7FJB/WU3zJYoVSOe+D kOWw== X-Gm-Message-State: AFeK/H3FQdHO0Gt1iDffUelbFJUxZJbzC8vNOX+pZr6mgst7ZpJ7EL9LOhHfuVtQ7z67oQ== X-Received: by 10.84.174.131 with SMTP id r3mr21670275plb.30.1489774682212; Fri, 17 Mar 2017 11:18:02 -0700 (PDT) Received: from mita-ThinkPad-T540p.local ([240f:4:c2bc:1:273e:de02:139f:cc26]) by smtp.gmail.com with ESMTPSA id 189sm7104355pgd.39.2017.03.17.11.18.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Mar 2017 11:18:01 -0700 (PDT) From: Akinobu Mita To: linux-spi@vger.kernel.org Cc: Akinobu Mita , Martin Sperl , Mark Brown Subject: [PATCH 2/6] spi: loopback-test: don't skip comparing the first byte of rx_buf Date: Sat, 18 Mar 2017 03:17:27 +0900 Message-Id: <1489774651-30170-3-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1489774651-30170-1-git-send-email-akinobu.mita@gmail.com> References: <1489774651-30170-1-git-send-email-akinobu.mita@gmail.com> Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When the loopback parameter is set, rx_buf are compared with tx_buf after the spi_message is executed. But the first byte of buffer is not checked. Cc: Martin Sperl Cc: Mark Brown Signed-off-by: Akinobu Mita --- drivers/spi/spi-loopback-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-loopback-test.c b/drivers/spi/spi-loopback-test.c index 99422f3..85c0c4e 100644 --- a/drivers/spi/spi-loopback-test.c +++ b/drivers/spi/spi-loopback-test.c @@ -507,7 +507,7 @@ static int spi_test_check_loopback_result(struct spi_device *spi, continue; /* so depending on tx_buf we need to handle things */ if (xfer->tx_buf) { - for (i = 1; i < xfer->len; i++) { + for (i = 0; i < xfer->len; i++) { txb = ((u8 *)xfer->tx_buf)[i]; rxb = ((u8 *)xfer->rx_buf)[i]; if (txb != rxb)