From patchwork Tue Feb 24 11:32:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 5872281 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 77AD69F169 for ; Tue, 24 Feb 2015 11:32:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AE14920656 for ; Tue, 24 Feb 2015 11:32:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8C2E520653 for ; Tue, 24 Feb 2015 11:32:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752279AbbBXLcS (ORCPT ); Tue, 24 Feb 2015 06:32:18 -0500 Received: from mga03.intel.com ([134.134.136.65]:10257 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751498AbbBXLcR (ORCPT ); Tue, 24 Feb 2015 06:32:17 -0500 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP; 24 Feb 2015 03:26:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,638,1418112000"; d="scan'208";a="458873118" Received: from smile.fi.intel.com (HELO smile) ([10.237.72.90]) by FMSMGA003.fm.intel.com with ESMTP; 24 Feb 2015 03:16:48 -0800 Received: from andy by smile with local (Exim 4.84) (envelope-from ) id 1YQDio-0003iZ-Lq; Tue, 24 Feb 2015 13:32:14 +0200 From: Andy Shevchenko To: Mark Brown , linux-spi@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH v1 1/5] spi: dw: move piece of code out of condition Date: Tue, 24 Feb 2015 13:32:10 +0200 Message-Id: <1424777534-14246-2-git-send-email-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1424777534-14246-1-git-send-email-andriy.shevchenko@linux.intel.com> References: <1424777534-14246-1-git-send-email-andriy.shevchenko@linux.intel.com> 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=unavailable 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 There is no sense to keep a member assignment in the internal structure inside the condition which reprograms HW. It makes code readability better if kept outside of the condition. Signed-off-by: Andy Shevchenko --- drivers/spi/spi-dw.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c index 5a97a62..29157f0 100644 --- a/drivers/spi/spi-dw.c +++ b/drivers/spi/spi-dw.c @@ -494,10 +494,11 @@ static void pump_transfers(unsigned long data) dw_writew(dws, DW_SPI_TXFLTR, txint_level); spi_enable_chip(dws, 1); - if (cs_change) - dws->prev_chip = chip; } + if (cs_change) + dws->prev_chip = chip; + if (dws->dma_mapped) dws->dma_ops->dma_transfer(dws, cs_change);