From patchwork Wed Mar 19 04:00:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 3857181 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EB799BF540 for ; Wed, 19 Mar 2014 18:03:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3CBE920279 for ; Wed, 19 Mar 2014 18:03:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 353342021F for ; Wed, 19 Mar 2014 18:03:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750914AbaCSEAh (ORCPT ); Wed, 19 Mar 2014 00:00:37 -0400 Received: from mail-pd0-f175.google.com ([209.85.192.175]:61505 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750785AbaCSEAe (ORCPT ); Wed, 19 Mar 2014 00:00:34 -0400 Received: by mail-pd0-f175.google.com with SMTP id x10so8018273pdj.6 for ; Tue, 18 Mar 2014 21:00:33 -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=SAc8QgAqFbLuPvta6JZYy11yLdIDx8WVkSJAepcC+lk=; b=mlIv8EalPFKxCpbXxu3RVSAz9lvbuJ7IZFMHi+JAjjaNLTANcgpcrZhCxTQ+MwGpNx WqbYSSJA8oW5PfNKwcl0Tjm63O0sz2w7hDKoA0ocvukEHTMsCmAD574/iswDn/n5nJ0/ 2SYSd1hci8Zj0Lf54NAaeV5xUFIShwZnGH7IN9mCe5IuxD8+ZQPLz8ahWZaHw92sCG9c mBqT5wRkRq7B5rCrL8ihn1FyfmHSUyxamIw/0mfbIltEtHt3BVqu3dRAomX87chXxEpH h25euZhQ6fARbj1pzlWZm5PygoYJvQw3sN6OLf8CTNNcNCP1qbYLKSg+9Gq09JvzNYJN SE8Q== X-Gm-Message-State: ALoCoQk/MiVCm6hcCEtRW0hM93SLSW/Gt+/QwBIWs6NmTXhOhUe3OH2AYCgkFV82K2hz2gCrsLOz X-Received: by 10.68.36.41 with SMTP id n9mr36154127pbj.99.1395201633699; Tue, 18 Mar 2014 21:00:33 -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 ha2sm57663027pbb.8.2014.03.18.21.00.31 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 18 Mar 2014 21:00:33 -0700 (PDT) Message-ID: <1395201629.16346.9.camel@phoenix> Subject: [PATCH 7/7] spi: bitbang: Let spi core validate Tx/Rx buffers for non-zero length transfer From: Axel Lin To: Mark Brown Cc: linux-spi@vger.kernel.org Date: Wed, 19 Mar 2014 12:00:29 +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-bitbang.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/spi/spi-bitbang.c b/drivers/spi/spi-bitbang.c index 3bfdb85..4beabea 100644 --- a/drivers/spi/spi-bitbang.c +++ b/drivers/spi/spi-bitbang.c @@ -317,10 +317,6 @@ static int spi_bitbang_transfer_one(struct spi_master *master, ndelay(nsecs); } cs_change = t->cs_change; - if (!t->tx_buf && !t->rx_buf && t->len) { - status = -EINVAL; - break; - } /* transfer data. the lower level code handles any * new dma mappings it needs. our caller always gave