From patchwork Tue Feb 25 11:19:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 3715661 Return-Path: X-Original-To: patchwork-linux-spi@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 DB6769F2F7 for ; Tue, 25 Feb 2014 11:19:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1B07D201BF for ; Tue, 25 Feb 2014 11:19:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4CFD4201C7 for ; Tue, 25 Feb 2014 11:19:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751463AbaBYLTv (ORCPT ); Tue, 25 Feb 2014 06:19:51 -0500 Received: from mail-pa0-f46.google.com ([209.85.220.46]:53732 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751344AbaBYLTv (ORCPT ); Tue, 25 Feb 2014 06:19:51 -0500 Received: by mail-pa0-f46.google.com with SMTP id rd3so7896282pab.5 for ; Tue, 25 Feb 2014 03:19:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:content-type:mime-version:content-transfer-encoding; bh=ZhHvhAmabTTVn9IJ4c1rrV+NOzzPm2dLbaQjfJH6gaY=; b=QfTvyge13gyauYat4m24pISpB2tkgw7RPQwyezLENCdkiDP2qZc0g79nbsKFvYVXTS hPq5KG/59bEDoe1ddYFOW+qyCxQzog2PxNNssBKNAbjy5sJroJ0H7KomI2MN21JhQgb9 mWVT7JqvJAFcKqcqBoAQM7SSQ8PFySum9u+qS65hAtoLg6pbVz/Od4aWQeLJrsVUMR/c X3aUvnlaRaPD44YL7xG1cfUgcCawGRnlc2IxSRWIZW3N7MZRWRLYw7wATetLu3BRaR6G LxUDMsOCU/dEwc/vbn+ciK1KW8DR1PgkRcDZi7sYQXiU6bGe7rzA86Ha4wrYqLrSQBaD dnxA== X-Gm-Message-State: ALoCoQlD3NuTdXT2CpyxeWJ1BHPoJJBJUrM3UPctPqLj5nf/G2mY2/EOGrD8EbSh6jC4OsdHJIkk X-Received: by 10.67.13.226 with SMTP id fb2mr1031534pad.146.1393327190818; Tue, 25 Feb 2014 03:19:50 -0800 (PST) Received: from [220.138.156.149] (220-138-156-149.dynamic.hinet.net. [220.138.156.149]) by mx.google.com with ESMTPSA id vf7sm9628307pbc.5.2014.02.25.03.19.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 25 Feb 2014 03:19:50 -0800 (PST) Message-ID: <1393327183.6723.5.camel@phoenix> Subject: [PATCH 3/3] spi: txx9: Let spi core handle validating transfer length From: Axel Lin To: Mark Brown Cc: Atsushi Nemoto , linux-spi@vger.kernel.org Date: Tue, 25 Feb 2014 19:19:43 +0800 In-Reply-To: <1393327017.6723.1.camel@phoenix> References: <1393327017.6723.1.camel@phoenix> X-Mailer: Evolution 3.6.4-0ubuntu1 Mime-Version: 1.0 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-6.9 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 spi core will handle validating transfer length since commit 4d94bd21b333 "spi: core: Validate length of the transfers in message". So remove the same checking in this driver. Signed-off-by: Axel Lin Reviewed-by: Atsushi Nemoto --- drivers/spi/spi-txx9.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/spi/spi-txx9.c b/drivers/spi/spi-txx9.c index 523f13d..b5f5dc8 100644 --- a/drivers/spi/spi-txx9.c +++ b/drivers/spi/spi-txx9.c @@ -306,12 +306,8 @@ static int txx9spi_transfer(struct spi_device *spi, struct spi_message *m) /* check each transfer's parameters */ list_for_each_entry(t, &m->transfers, transfer_list) { - u8 bits_per_word = t->bits_per_word; - if (!t->tx_buf && !t->rx_buf && t->len) return -EINVAL; - if (t->len & ((bits_per_word >> 3) - 1)) - return -EINVAL; } spin_lock_irqsave(&c->lock, flags);