From patchwork Tue Sep 29 21:09:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 7290371 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CF16F9F302 for ; Tue, 29 Sep 2015 21:16:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EE3EB2068D for ; Tue, 29 Sep 2015 21:16:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 21F6C2068C for ; Tue, 29 Sep 2015 21:16:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751609AbbI2VQw (ORCPT ); Tue, 29 Sep 2015 17:16:52 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:33781 "EHLO mail-wi0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751195AbbI2VQw (ORCPT ); Tue, 29 Sep 2015 17:16:52 -0400 Received: by wiclk2 with SMTP id lk2so170043802wic.0 for ; Tue, 29 Sep 2015 14:16:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:subject:to:cc:message-id:date:user-agent:mime-version :content-type:content-transfer-encoding; bh=T+NWK5y0clKDpcjfIiB6KzVyvXF5pCoOPufEWLTuUkI=; b=GXrVLBgSLgV201NT8V4tI9piVmoPWQC2YcKlBCOyRSXeHNLschHufcSxUUQVXpvHjI Nk3YLLJHR3+KfntTQHSSxEzDk/8gJ9L5ofB1WvX1aFsrH/NE6p8rYAHPus0j+WgrCkjQ 4XYrd+FKuqDmbWhD7EJJLb59zcQ3BKnSwbwnMujrXyFYyMs0sOJ40H8hwwdazOMwfHXR qV2Mx1zwQyi22KBnNTqKwfuiAEVRHRzrdNqsPX0tlpcNBtS1CfSy7zYiTST0gqixImQR kSs4Ki18V2DwZhIoK8uidjKb7wLSU1jy6Uldjk0lZ9y2iIXMXO3F34KU6t7F0LeLNge6 4r8w== X-Received: by 10.194.185.16 with SMTP id ey16mr195599wjc.32.1443561410909; Tue, 29 Sep 2015 14:16:50 -0700 (PDT) Received: from ?IPv6:2003:62:5f33:d300:1523:ac93:90b7:c328? (p200300625F33D3001523AC9390B7C328.dip0.t-ipconnect.de. [2003:62:5f33:d300:1523:ac93:90b7:c328]) by smtp.googlemail.com with ESMTPSA id hd7sm20599526wib.23.2015.09.29.14.16.49 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 29 Sep 2015 14:16:50 -0700 (PDT) From: Heiner Kallweit Subject: [PATCH 1/2] spi: bitbang: remove unneeded check To: Mark Brown Cc: "linux-spi@vger.kernel.org" Message-ID: <560AFE0D.7000307@gmail.com> Date: Tue, 29 Sep 2015 23:09:33 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 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.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, 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 Remove an unneeded check. The SPI core (__spi_validate) takes care that these fields are always populated. Signed-off-by: Heiner Kallweit --- drivers/spi/spi-bitbang.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/drivers/spi/spi-bitbang.c b/drivers/spi/spi-bitbang.c index ef43ef5..ad3168d 100644 --- a/drivers/spi/spi-bitbang.c +++ b/drivers/spi/spi-bitbang.c @@ -272,7 +272,6 @@ static int spi_bitbang_transfer_one(struct spi_master *master, struct spi_transfer *t = NULL; unsigned cs_change; int status; - int do_setup = -1; struct spi_device *spi = m->spi; bitbang = spi_master_get_devdata(master); @@ -288,19 +287,10 @@ static int spi_bitbang_transfer_one(struct spi_master *master, list_for_each_entry(t, &m->transfers, transfer_list) { - /* override speed or wordsize? */ - if (t->speed_hz || t->bits_per_word) - do_setup = 1; - - /* init (-1) or override (1) transfer params */ - if (do_setup != 0) { - if (bitbang->setup_transfer) { - status = bitbang->setup_transfer(spi, t); - if (status < 0) - break; - } - if (do_setup == -1) - do_setup = 0; + if (bitbang->setup_transfer) { + status = bitbang->setup_transfer(spi, t); + if (status < 0) + break; } /* set up default clock polarity, and activate chip;