From patchwork Fri Feb 10 15:29:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frode Isaksen X-Patchwork-Id: 9566995 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 00F6860573 for ; Fri, 10 Feb 2017 15:38:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E2AC2285A2 for ; Fri, 10 Feb 2017 15:38:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D760D285A4; Fri, 10 Feb 2017 15:38:07 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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 940B8285A2 for ; Fri, 10 Feb 2017 15:38:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753085AbdBJPiF (ORCPT ); Fri, 10 Feb 2017 10:38:05 -0500 Received: from mail-wm0-f54.google.com ([74.125.82.54]:38009 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752654AbdBJPiD (ORCPT ); Fri, 10 Feb 2017 10:38:03 -0500 Received: by mail-wm0-f54.google.com with SMTP id r141so51667895wmg.1 for ; Fri, 10 Feb 2017 07:38:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=MgqP5dF2E/HBKcX6RKkKoEwrdrk/0g/6J0Zvdhyy0oY=; b=MH263rrMWiA2Xiy3BZwwt2HXXMnvUc2CMtKQCYqghWoNiVwzXC5XQX6VuPnl7EMyAG pl+ZsywgHdj6+38Z/pQPJBdpQETloAYhjpsGrYrk+8pv6JudWNz6+e6InL1CLx3DKjwq j1YvXCU3fjYTpekIoiNcYlSQTIhgw9latJ8QhGkiwU/dihV1a6azmF97OXuTNxO3BYL1 JsUk+Db5RJRe9WAtE0myiXNtM1EUtEzLlAyPUwWw6nBMz3K7vuzp+7oj+bFuMFa4+n8x Z7aMnYrCPj9zVh/NWFZCiRDBM3999ImkZY4txsej8DpN1HOEHkxD4dY67mPHOgvbjV74 qUbA== 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=MgqP5dF2E/HBKcX6RKkKoEwrdrk/0g/6J0Zvdhyy0oY=; b=VFGqgjHrSrdQtWwqqT85Limmu1G+3tmdYMlN9UERrbLg2vDteq76oCVpzQSQBI2Xe9 FBxwi0VOLfloMWK0rSUuYZcMK3lYwpMK2idyiK38A356wVCfssQaKTgjSb14OP6O4W/H DeG5I6LlpWbtnBM5HpxbcIdu1xQQeRGVWGce6K/rceHdJ/YBY+N+RtHY7n9KbIBEGZP1 t6OjBi9b8TC97S2r1vu6+9Z+zzwMT6gZ01Dyzs/3EEu5y/ImLIJ5zoRi9taT/Wr7Ccsb bsnDOZUNaZ7J27HtYeRZE0byzPsN1pXx5+9j+uw7HgJkRWprbiaN+Y7cXucRioLoYtQk abeA== X-Gm-Message-State: AMke39k3aOjaY7fHWB5QA+KhtN2lnY1MxC9p/kD2z98PzPiHRMD39CGHmI8s+PNl7NahGOWG X-Received: by 10.28.174.14 with SMTP id x14mr26364315wme.75.1486740647186; Fri, 10 Feb 2017 07:30:47 -0800 (PST) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id o143sm2068192wmd.3.2017.02.10.07.30.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 10 Feb 2017 07:30:46 -0800 (PST) From: Frode Isaksen To: nsekhar@ti.com, khilman@baylibre.com, ptitiano@baylibre.com, linux-arm-kernel@lists.infradead.org Cc: broonie@kernel.org, linux-spi@vger.kernel.org, Frode Isaksen Subject: [PATCH 8/8] spi: loopback-test: limit length to spi_max_transfer_size() Date: Fri, 10 Feb 2017 16:29:44 +0100 Message-Id: <1486740584-17875-9-git-send-email-fisaksen@baylibre.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1486740584-17875-1-git-send-email-fisaksen@baylibre.com> References: <1486740584-17875-1-git-send-email-fisaksen@baylibre.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 Limit length to spi_max_transfer_size() in the spi loopback test driver. Signed-off-by: Frode Isaksen --- drivers/spi/spi-loopback-test.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/spi/spi-loopback-test.c b/drivers/spi/spi-loopback-test.c index 5618df3..e1e698e 100644 --- a/drivers/spi/spi-loopback-test.c +++ b/drivers/spi/spi-loopback-test.c @@ -796,6 +796,9 @@ static int spi_test_run_iter(struct spi_device *spi, return 0; } + /* limit length to spi max transfer size */ + len = min(spi_max_transfer_size(spi), len); + /* write out info */ if (!(len || tx_off || rx_off)) { dev_info(&spi->dev, "Running test %s\n", test.description);