From patchwork Wed Mar 19 03:58: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: 3857161 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 2A01F9F369 for ; Wed, 19 Mar 2014 18:03:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5FA4220120 for ; Wed, 19 Mar 2014 18:03:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D370820131 for ; Wed, 19 Mar 2014 18:03:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758176AbaCSD6t (ORCPT ); Tue, 18 Mar 2014 23:58:49 -0400 Received: from mail-pa0-f43.google.com ([209.85.220.43]:58309 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756662AbaCSD6s (ORCPT ); Tue, 18 Mar 2014 23:58:48 -0400 Received: by mail-pa0-f43.google.com with SMTP id bj1so8332088pad.2 for ; Tue, 18 Mar 2014 20:58:48 -0700 (PDT) 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=Zrd/JJ0F9F0Z8rInaVHEKy9KMg3M0D3fvxPqDxgO1pQ=; b=XD0BpzdUqX2B0PEsaWLW4/nre+W678wrzDLTDyMDm2ufgOLZZqFBgHYn951NFi69vG HYMel+jxwilj13srmxoEYIM3FO115hWdd5JE6InAa6erWzYnrx06MI2q6dL9KP5acLUC lGjJODMTwVJTcVqrx/p+VVZRh9/haLvKQbOp+gDJyJ+1UM4a3y5/vKCEnJRGnLR6M3We DhWlLlBrUofrhzybDQ9gzCnm9ZjipTwrwjw9ZKoTsCDHPmTO7brIKA2nfPKP7jf8oebU ZAon5j+HT+8zYgg7l8TDmH6unvLEBmA6VzH2obI7zeWSpTRJkT7wKj2ymKWJyyo4Tfig Pr7g== X-Gm-Message-State: ALoCoQnRhDamOJGpASDRN1Td0fmPMhRCjiu8bcCxpNUdTWpPl1HD+ugWHQQkc8ULxtuqda9NKhrV X-Received: by 10.66.147.130 with SMTP id tk2mr19469057pab.125.1395201528241; Tue, 18 Mar 2014 20:58:48 -0700 (PDT) Received: from [192.168.0.102] (218-164-140-191.dynamic.hinet.net. [218.164.140.191]) by mx.google.com with ESMTPSA id gg3sm57633274pbc.34.2014.03.18.20.58.46 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 18 Mar 2014 20:58:47 -0700 (PDT) Message-ID: <1395201523.16346.7.camel@phoenix> Subject: [PATCH 5/7] spi: txx9: Let spi core validate Tx/Rx buffers for non-zero length transfer From: Axel Lin To: Mark Brown Cc: Atsushi Nemoto , linux-spi@vger.kernel.org Date: Wed, 19 Mar 2014 11:58:43 +0800 In-Reply-To: <1395201227.16346.1.camel@phoenix> References: <1395201227.16346.1.camel@phoenix> X-Mailer: Evolution 3.8.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, T_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 Signed-off-by: Axel Lin --- drivers/spi/spi-txx9.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/spi/spi-txx9.c b/drivers/spi/spi-txx9.c index 820b499..10ffbc0 100644 --- a/drivers/spi/spi-txx9.c +++ b/drivers/spi/spi-txx9.c @@ -299,17 +299,10 @@ static int txx9spi_transfer(struct spi_device *spi, struct spi_message *m) { struct spi_master *master = spi->master; struct txx9spi *c = spi_master_get_devdata(master); - struct spi_transfer *t; unsigned long flags; m->actual_length = 0; - /* check each transfer's parameters */ - list_for_each_entry(t, &m->transfers, transfer_list) { - if (!t->tx_buf && !t->rx_buf && t->len) - return -EINVAL; - } - spin_lock_irqsave(&c->lock, flags); list_add_tail(&m->queue, &c->queue); queue_work(c->workqueue, &c->work);